2.3 Producing Robust Programs Flashcards

(10 cards)

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 Verification

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 the main reason for testing and 3 other reasons

A
  1. To ensure the program works no matter what data is inputted
    Other reasons: So the program meets the requirements, To make sure there are no bugs, To make sure program is secure against malware
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
- individually tests each program until it works as expected
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