(Done) 2. Design, Testing and IDEs Flashcards
What are structure diagrams
- Diagrams that show the smaller tasks of a larger programs
Features of structure diagrams
- The programs you want to write is split up into manageable modules
- Each of those modules is decomposed even smaller modules and eventually into modules that perform individual tasks
Advantages of structure diagrams (5)
- Easier to write code to carry out individual tasks
- Makes cooperation easier as each module can be written individually
- Its easier to test as each module is independent
- Each module can be updated independently
- able to reuse the modules in the future
Define a program being easy to maintain
- It is easy for other programmers to add onto or repair the program
What features of a code can improve the maintainability
- Comments explaining key features of the program
- Indentation separating different segments of the program
- Accurate naming of Variables, sub programs and parameters
- Using sub programs
What is the purpose of defensive design
- To ensure a program functions properly
Define program misuse
- The user doing things the programmer does not expect them to do
Methods of defensive design
- Anticipating how users might misuse their program and attempt to prevent it
- Ensure their code is well maintained
- Reduce the number of errors in their code through testing
Define input validation
- Checking if data meets certain criteria before passing it into the program
Why is input validation used
- To prevent accidental or intentional misuse of a program when entering data
Types of Input validation
- Range check
- Presence check
- Format check
- Look-up table
- Length check
What is a range check
- Checks whether the data is within a specified range
What is a presence check
- Checks whether data has actually been entered
What is a format check
- Checks the data has the correct format (e.g. a date)
What is a look-up table
- Checks the data against a table of acceptable values
What is a length check
- Checks the data is the correct length
What does authentication do
- Confirms the identity of a user before they’re allowed to access certain pieces of data or features in the program (e.g. passwords)
Common ways to increase the security of a password based system
- Force users to use strong passwords and get them to change them regularly
- Limit the number of failed authentication attempts before an account is lost
- Ask for a random selection of characters from the password on each authentication
Types of errors
- Syntax errors
- Logic errors
Define syntax errors
- When the compiler or interpreter doesn’t understand something due to and error in language rules or grammar
Define logic errors
- When the compiler or interpreter is able to run the program, but the program does something unexpected
How are syntax errors diagnosed
- They’ll be unable to translate the source code and a syntax error (with it’s location) will be returned
How are logic errors diagnosed
- Compilers and interpreters will not detect them
- Diagnosed by systematically testing the program
Two main types of testing
- Iterative testing
- Final testing