Logic and Languages 2 Flashcards
What is defensive design?
An approach to software development that aims to produce robust and reliable programs.
What is the purpose of authentication?
To ensure a person is who they claim to be
What are some examples of anticipating misuse?
- Malicious inputs
- Attempts to remotely connect
- Attempts to alter access rights
- Brute Force Attacks
What are brute-force-attacks?
Software programs which will try out every combination of letters, numbers and special character
What is data validation?
Checks data meets a set of criteria before you process it and can ensure that data entered is of the right type.
What are the types of validation checks?
Range check Type check Length check Presence check Format check
What is the difference between validation and verification?
Validation can only check that the data entered is reasonable
Verification is used to double-check that the data has been typed in correctly
What is double-entry verification?
Entering data twice
Range check
A number or date is within a sensible/allowed range
Type check
Data is of the right type, such as integer, letter or text
Length check
Text entered is not too long or too short – for example, a password is between 8 and 15 characters
Presence check
Checks that data has been entered, i.e. the field has not been left blank
Format check
Checks that the format of, for example, a postcode or email address is correct
How can programs be written in a way that makes them easily maintainable?
Indentation
Commenting
Use of sub programs
Appropriate naming conventions
Why are sub programs used?
To create code that can be reused multiple times in the program or by other programs, and allows bugs to easily be fixed
What are appropriate naming conventions?
It involves good use of variable and sub program names to make the program easier to read and understand
Why is indentation used?
Indentation makes it easier to see which lines of code are part of different structures (show nesting) - easier to read
Why is commenting used?
Commenting helps programmers understand what a program does and how it does it
What are the types of errors?
syntax error
logic error
What is a syntax error?
A syntax error is one where the programming code written doesn’t conform to the rules of the language
Why does a syntax error appear?
The compiler doesn’t know how to translate the program into machine code so will give the programmer a syntax error. The program cannot be run until all syntax errors are fixed
What is a logic error?
Logic errors appear when the program’s execution appears to run as normal, but not as the programmer intended
What are the types of testing?
iterative testing
final/terminal testing
What is iterative testing?
Iterative testing tests modules and parts of a program as the program is developed
What is final testing?
Final testing tests the whole program at the end of production
What does a test plan test for?
Normal data
Boundary data
Invalid/Erroneous data
What is normal data?
Normal data is test data that is typical (expected) and should be accepted by the system. A number between 0-100, e.g. 5
What is boundary data?
Boundary data is test data at the upper or lower limits of expectations that should be accepted by the system. A number between 0-100, e.g. 0 and 100.