DESIGN, TESTING, IDEs Flashcards
(22 cards)
what do structure diagram show
smaller tasks of a larger program
what are the advantages of using structure diagrams
- coding can be easier as you’re writing code to carry out simple tasks
- many programmers can work on 1 program as each module can be written independently
- easier to test as each module can be tested
- individual sub programs and modules can be fixed and updated without affecting the rest of the program
- able to reuse sub programs and modules in programs you write in the future
why should your program be well-maintained
makes it easy for other programmers to understand what the code does
how can you make your program well-maintained
- comments using #, useful to explain whats happening
- indentation, to separate different statements in a program
- naming variables appropriately, helps to understand what they do and can keep track of it easily
- using sub programs, help other programmers to see different parts of a program work
what is defensive design used for
to ensure program functions correctly and never produce errors
what is input validation
checking if data meets certain criteria before passing it into the program
how can you protect your program using defensive design
- anticipate how users might misuse the program and preventing it
- ensure code is well-maintained
- reduce number of errors by testing
name 2 examples of input validation
length check, range check
how does authentication protect your program
confirms identity of user before they are allowed to access certain pieces of data
how can you increase the security of a password-based authentication system
- force users to create strong passwords and change them regularly
- limit number of failed password attempts
what is a syntax error
when the compiler or interpreter doesn’t understand something because it doesn’t follow the rules/grammar of the programming language
what is a logic error
when the compiler or interpreter is able to run the program but the program does something unexpected
what are the 2 main types of testing
- iterative testing (testing while being developed)
- final testing (testing after program is finished being developed
When testing data what is normal, boundary, invalid and erroneous data
normal = things that a user is likely to input in a program
boundary = values at the limit of what the program can handle
invalid = inputs with the correct data type that should be rejected by the program
erroneous = inputs with an incorrect data type that should be rejected by the program erroneous
what is low-level language and name 2 examples
source code that is tricky for humans to read and write but easy for a computer to run
machine code and assembly language
what is high-level language and name 2 examples
source code that is easy for humans to write but computers need to translate it before hey can read and run it
python and C++
what does a compiler do
translate high-level code directly into machine code
translates all of the source code at the same time to create 1 executable file
what does a interpreter do
translates and runs the source code 1 instruction at a time, but doesn’t create an executable file
what are the differences between compilers and interpreters
- compilers are only need once, interpreters are need each time you want to run the program
- compilers returns a list of errors for the entire program, interpreter will return the first error it finds and the stop
- compilers can run the program very quickly after being compiled, interpreter runs more slowly as code is being translated while running
what does IDE stand for
integrated development environment
what is the main purpose of an IDE
software that provides features to help a programmer to develop their program
what are 5 common features of an IDE
- code editor (main part), where the code is written
- output window, shows the output from a program when it is run
- line numbering and automatic code colouring
- error diagnostics to help find and fix errors in a a program
- a translator (compiler or interpreter) allows source code to be understood by the computer