2.3 Producing robust programs Flashcards
What are structured diagrams?
They are diagrams showing smaller tasks in larger program
Why use structure diagrams?
- easier for programmer as they can work on sections at a time
- Improves organisation
What are the advantages of using structure diagrams?
- coding is easier as each part is simple
- easier to test individually
- easier to spot issues to fix and update them
- reuse subprograms in future
How to make the program have more maintainability?
- Comments - explain each key feature of a program
- indentation - makes control flow clearer
- variable names - should be relevant fir better understanding
- Sub Programs - Makes code more understandable as it is split up.
What is defensive design?
When programmers protect their program
How can programmers protect their code?
Predict misuse
ensure code is well maintained
reduce errors through extensive testing
What are the methods that programmers can use to protect their code?
Input validation
Authentication
What are the type of checks that input validation uses?
Range Presence Format (eg a date) length look-up table
What is input validation?
Is checking data meets criteria before passing it on
What is Authentication?
Confirms the user identity before they’re able to access certain areas of the program (passwords)
What are the common ways to increase the security on passwords?
- use strong passwords - combination of number and letters
- limit for failed authentication attempts
- ask for random selection of characters
What is syntax errors?
where the interpretor doesn’t understand something due to a grammatical mistake
What is logic errors?
Is where the program runs, but does something unexpected
What is the difficulty of diagnosing syntax errors and logical errors?
Syntax error - easy to identify as complier returns the error and location.
Logical error - harder to track as they are not picked up by compliers
What are the 2 type of testing?
iterative testing
Final (terminal) testing