2.3 Producing robust programs Flashcards
(36 cards)
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
What is Iterative testing?
Is testing while the programing is being developed
What is Final testing?
The program is tested at the end of the development process. The whole program is tested at the same time to check that it is working correctly.
What is a Test plan?
Outlines exactly what you are testing and how you’re intended to do that.
(A good test plan anticipates potential issues)
What are the 4 test datas?
Normal data
Boundary data
Invalid data
Erroneous data
What is normal data?
Things that a user is likely to input
What is Boundary data?
Values at the limit of what a program can handle.
What is invalid data?
Data that should be rejected
What is erroneous data?
use of incorrect data type and should be rejected
What is machine code?
0 and 1s (binary)