Design, Testing & IDE’s - 2.4/5 Flashcards
What is a structure diagram (4)?
Show the smaller tasks to a larger problem
Made by decomposing the program into manageable modules
Each module is decomposed further until their individual tasks which can be written as sub programs
They main program can be written by these sub programs
Advantages of structure diagrams?
Coding is easier
Easier to test
Each module can be individually improved/updated without affecting the whole program
Can reuse sub programs in the future
What factors can help maintain a program (4)?
Comments - explain what key features of code does
Indentation - separate different statements
Naming of variable, sub programs, parameters
Using sub programs
What is defensive design?
Helps ensure a program functions properly
Program shouldn’t break or produce errors
Ways programmers protect their programs with defensive design?
Anticipate how users may misuse data and attempt to prevent it
Ensure code is well-maintained
Reduce number of errors by testing
What is input validation (2)?
Checking if data meets a certain criteria before passing it on to the next criteria
Prevents misuse of data by users
Types of input validation (5):
Range check - checks if data is in a certain range
Presence check - checks data has been entered
Format check - checks data is in correct format
Look-up table - checks the data against a table of acceptable values
Length check - checks the data is the correct length
What is authentication (3)?
Helps protect programs
Confirms the identity of a user before they have access to parts of a program
Passwords
Ways to increase security of passwords (3)?
Force users to create strong passwords and change them regularly
Limit number of failed attempts
Use 2 factor authentication
What are the types of common errors in a program?
Syntax errors
Logic errors
Run-time
What are syntax errors?
When the compiler or translator doesn’t understand something written as it doesn’t follow the rules of the programming language
Found by compilers and interpreters
What are logic errors (3)?
When the compiler or interpreter can run the program but it does something unexpected
More difficult to diagnose
Found through general use of program
What are the main types of testing?
Iterative - program is tested while being developed
Foxes smaller details, helps prevent errors occurring later on
Final - program is tested at the end of the development
What is a test plan (3)?
Outlines what you’re going to test and how
Good test plan anticipates potential issues and selects appropriate test data
What are the 4 categories test data fall into? What they mean?
Normal - things that a user is likely to input into the program
Boundary - values at the limit of what the program should handle
Invalid - inputs with correct data type that should be rejected
Erroneous - inputs with an incorrect data type that should be rejected by the program