Defensive Design + Errors and Testing Flashcards

1
Q

What can Data Validation routines do?

A

Ensure that data entered is of the right type.

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

What can Validation not do?

A

Ensure that the user has not made a spelling error or entered the wrong value.

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

What can Validation ensure?

A

Validation can only check that the data entered is reasonable.

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

What does Data Verification do?

A

Verification is used to double check that the data has been typed in correctly.

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

What is double entry verification?

A

A good example of double entry verification is when two passwords don’t match their password will be needed to be rentered.

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

What is Authentication?

A

Confirm that the person is who they are.

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

What are some common examples of Authentication?

A

Commonly, you are asked to enter a username and password.

You may also be asked to confirm these details on a separate device (2FA).

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

Why do Programs need to be maintained?

A

This will be to improve the code, fix bugs or add new features.

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

What are some examples of things that appear in maintainable programs?

A

Use of subprograms (functions + procedures)
Using appropriate naming conventions
Indentation
Commenting

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

What do subprograms include?

A

Functions and Procedures.

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

Will Subprograms take inputs?

A

Yes, well written subroutines will take inputs through parameters and if necessary return a value.

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

What makes a well written subprogram?

A

They should be written so they can be reused multiple times in the program.

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

Can you have the same function and variable name?

A

NO, this is inappropriate naming conventions.

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

Can you have the same function and variable name?

A

NO, this is inappropriate naming conventions.

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

Why does indentation improve code?

A

Indentation makes it possible to easily see which lines of code are part of different structures.

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

Why are comments usually written?

A

Parts of the program that are difficult to understand.

At start of function or procedure to explain what it does/.

17
Q

What is a syntax error?

A

An error where the code written does not conform to the rules of the language,

18
Q

Can interpreters and compilers execute the code if there is a syntax error?

A

No, they will not know how to translate the flawed program into machine code so it will give the programmer a syntax error.

19
Q

What is a logic error?

A

Produces an unexpected output, the IDE will not detect the error.

20
Q

Can interpreters and compilers run with logic errors?

A

Yes, the code will still run fine but it will produce an unexpected output.

21
Q

What are the three types of testing?

A

Normal
Boundary
Erroneous

22
Q

When is iterative testing carried out?

A

During the development of the program.

23
Q

When is final testing carried out?

A

After the program is complete.

24
Q

When is final testing carried out?

A

After the program is complete.

25
Q

What is the purpose of the trace table?

A

Record the value of every variable as it changes.

26
Q

How are trace tables useful?

A

Useful for tracing through a program in order to find a logic error.