2.3 Producing Robust Programs Flashcards

1
Q

What are the 5 Input Validation checks?

A

Range Check
Type Check
Format Check
Presence Check
Length Check

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the range check

A

Checks data is within a certain range, usually numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the format check

A

Checks data is entered in a certain way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the presence check

A

Checks data has been entered and not left blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Difference between Input Sanitisation, Validation and Authentication

A

Input Sanitisation is cleaning up input data to reduce redundancy or remove malicious code.
Validation is checking whether input data follows specific criteria and should be accepted.
Verification is checking whether data that has been entered is correct.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are 5 ways of making a program more maintainable?

A
  1. Using constants,
  2. Using subprograms
  3. Using indentation
  4. Appropriate variable names
  5. Add comments
    This improves readability and ease of debugging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give 2-4 reasons for the purpose of testing

A
  1. To ensure there are no bugs
  2. To ensure unauthorised access is prevented
  3. To check the program has an acceptable performance
  4. To check the program meets the requirements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain a difference between iterative and final testing.

A

Iterative:
- used when program is being developed
- programmer develops a module and tests it repeatedly until runs as intended
Final:
- used when program is finished
- tests with normal, boundary, invalid and erroneous data
- used only after each module has been tested

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define syntax error.

A
  • when there is a mistake in the grammar of the programming language
  • the program will not execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define logic error.

A
  • the program will run/be executed but produces an unexpected output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly