2.3 Producing Robust Programs Flashcards

1
Q

Defensive Design

A
  • Anticipate how user may misuse program , and prevent it.
  • Ensure code is well-maintained
  • Testing to reduce errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Input Validation

A

Checking if data entered meets a certain criteria before passing into the program

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

Types of Input Validation

A
  • Range Check - checks data is in specified range
  • Presence Check
  • Format Check
  • Look-up Check - checks the data against a table of accepted values
  • Length Check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Defensive Design: Authentication

A

Confirming the identity of a user before they can access certain parts of the program.
Can do this through passwords

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

How to increase the security of password - based authentication

A

Force users to use:
* Strong passwords
* Limit no. of failed attempts

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

Problem with authentication

A

If there is too much, the user may not use it.

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

Factors that affect the maintainability of code

A
  • Commenting
  • Indentation
  • Variables, sub programs, parameters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Maintainability: Comments

A

Explain what the key features of the code do, so that different programmers can understand the program

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

Maintainability: Indentation

A

To seperate different statements in a program

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

Maintainability: Variables, subprograms, parameters

A
  • Should be named appropriately (what they actually are)
  • Follow standard naming conventions - must not start with a number or have spaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Types of Testing

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

Iterative Testing

A

Program is tested during its development
Test a module, fix errors, then move on to next one

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

Final testing

A

Program is tested at end of its development

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

What is iterative testing used for?

A

To find + fix small errors to prevent larfger errors forming later on

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

What is final testing for?

A

To make sure modules work well together

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

What is final testing for?

A

To make sure modules work well together

16
Q

Best way to test

A

Combination of iterative + final testing

17
Q

Test Plan

A

Outlines exactly what the programmer will test and how
Covers all routes through the program

18
Q

Types of Test Data

A
  • Normal Data - things that the user is likely to input
  • Boundary Data - things at the limit of accepted values
  • Invalid Data - inputs with correct data type, but rejected
  • Erroneous Data - wrong data type, rejected
19
Q

Syntax Errors

A

When compiler doesn’t understand it because it doesn’t follow the rules or grammar of the programming language

20
Q

Logic Errors

A

When compiler can run the program, but gives an unexpected output