2.3 Flashcards

1
Q

What types of checks can you do to data input? (5)

A
  • Type check: data type
  • Range check: within range
  • Presence check: something has been entered
  • Format check: correct format
  • Length check: min/max
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why are input validation techniques important? (3)

A
  • More robust
  • More user-friendly
  • Prevent further errors from occurring later
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the anticipating misuses? (4)

A
  • Division by zero: would crash because computer cannot compute
  • Communication error: unable to establish connection, server overloaded, should allow cancel/report
  • Printer and peripheral errors: running out of paper/ink, allow reprint
  • Disk errors: programs that need files (read/write) must consider the file not being found/out of storage space/corrupt data/end of file reached, and must be checked before further processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can data used by systems be secure? (5)

A
  • Username and password (forms of authentication)
  • Recover password using email
  • Encryption
  • reCAPTCHA software
  • Awareness of SQL injection and other methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why do programs need to be tested? (4)

A
  • No bugs
  • Has an acceptable performance
  • Ensure no unauthorised access
  • Check it meets the requirements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does iterative testing mean? (3)

A
  • Each function was individually tested as written
  • Ensures that it can handle incorrect data
  • Checking it does not introduce new errors in code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does terminal testing mean? (3)

A
  • Meets all requirements
  • Testing that all functions work together
  • Able to produce results with any data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a syntax error? (2)

A
  • Rules of the language are broken
  • e.g. variable undeclared, wrong data type, incorrect assignment, mispelling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a logic error? (2)

A
  • Produces an unexpected output
  • e.g. wrong conditions/arithmetics, incorrect sequence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a normal input?

A
  • Accepted without errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a boundary input?

A
  • Correct data type which is on the edge of accepted validation boundaries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an invalid input?

A
  • Correct data type but outside accepted validation checks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an erroneous input?

A
  • Incorrect data type: rejected
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you handle inputs to make the program more robust? (2)

A
  • Anticipate a range of possible outputs
  • Descriptive and helpful prompts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you deal with invalid data?

A
  • While not in range, keep asking for input
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you deal with erroneous data?

A
  • Try int(input())
  • Except wrong data type displays error message
17
Q

Describe three ways in which a programmer can make their code maintainable PPQ

A
  • Use functions
  • Use comments
  • Use variables
  • Used indentations
18
Q

State what is meant by ‘input validation’

A
  • Checking that the input has the correct data type and format before using it in the rest of the program
19
Q

State a feature that shows that something is a function and not a procedure PPQ

A

It returns a value