Producing robust programs Flashcards

1
Q

what is the purpose of defensive design? (3)

A

-protection against unexpected user inputs or actions,
-maintainability ( ensuring code is readable and understandable)
-minimising/removing bugs

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

what are the 5 forms of validation?

A

-Range check - the input must fall within a specified range.
-Length check - the input must not be too long or too short.
-Presence check - a data value must be entered.
-Format check - the data must be in the correct format
-Type check - the data must be of a specified data type

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

what is the purpose of authentication?

A

to ensure that the user is who they say they are

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

what is the purpose of maintability?

A

to ensure that a program can be easily maintained

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

what are the 4 ways of maintability?

A

sub programs
commenting
indents
sensible variable names

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

what does commenting do?

A

provide information about what the different parts of the program do

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

what should a variable name reflect the purpose of?

A

variable name should reflect the purpose of the variable and the type of data that it is intended to hold

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

why is indentation useful?

A

easily see which code falls within the selection or iteration, and where it ends.

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

what are the two types of programming errors?

A

syntax and logic

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

what is a syntax error?

A

when code written does not follow the rules of the programming language

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

what is a logic error? what happens to the program because of it?

A

error in the way a program works. The program simply does not do what it is expected to do.

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

what is the purpose of testing?

A

help the programmer remove such bugs and to ensure that the program functions as intended

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

what are the 2 forms of testing?

A

iterative and terminal

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

when is iterative testing carried out?
what does a programmer do in this process?

A

-carried out while a program is being developed.
-programmer writes a section of code (module) then tests it.

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

when is terminal testing carried out? why?

A

-when all modules are complete and the program is tested as a whole to ensure that it functions as it should.

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

what are the three forms of test data?

A

normal
boundary
erroneous