Defensive Design Considerations: Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the different checks?

A
  • Type Check.
  • Pressence Check.
  • Range.
  • Format.
  • ## Length.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is input validation?

A
  • Checking data inputted by the user.

- Meets specific criteria + rules before processing.

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

What is a type check?

A
  • Checks whether it is the correct data type.
  • E.g:
  • Integer.
  • Strings.
  • Real.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a range check?

A
  • Checks whether the data is entered in the correct range.

-

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

What is presence check?

A
  • Checks if data has been entered or in required fields.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a format check?

A
  • Checks if the format is correct.
  • E.g: Days, months years.
  • Postcode.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a length check?

A
  • Checks if it is the specific number of characters or over the specific minimun number of chaarcters.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the advantages of validation?

A
  • More robust.
  • User friendly.
  • Prevents errors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What errors can occur in a programme?

A
  • Division by 0.
  • Communication.
  • Printer + Peripheral error.
  • Disk errors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is division by 0 error?

A
  • No number when multiplied or divided by 0 will output a value/number.
  • Make sure the code is dividing a number not by 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a communication error?

A
  • Online systems require connection to host servers.
  • If server drops could cause programme to crash.
  • Programmer should enable ways for the user to cancel requests + fail gracefully + reporting the connection error.
  • Programme can automatically resume when connection is avaliable again.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a printer and peripheral error?

A
  • When a Programme outputs a hardcopy, printer could run out of ink and paper, jam.
  • Programmer should not assume:
  • Output to printer was sucessful.
  • Should always have options to reprint reports and receipts.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a disk error?

A
  • Programs that read and write to files need to handle many types of exceptions:
    e. g:
  • file/folder not found.
  • disk being run out of space.
  • data in file being corrupted.
  • robust programmes handles this:
  • Checks files + data before attempting to use them for further processing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly