Topic 8 - Producing robust programs Flashcards

1
Q

Structure diagrams

A
  • they decompose the program into smaller, more manageable modules – that eventually perform individual tasks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

advantages of using structure
( E, LofP, R )

A
  • coding is easier as you are only coding very simple tasks
  • lots of programmers can work together as each module can be written independently
  • can reuse sub programs in future programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

defensive design

A

Defensive design ensures that programs function properly and never produce errors

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

how do programmers try to protect their programs through defensive design?

A
  • anticipate how users might misuse their program then prevent it
  • ensure the code is well maintained
  • reduce number of errors in code through testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is it important that code is well-maintained?

A

so it is easy for other programmers to understand what the code does, so they can use the code

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

how can you make code more maintainable?

A
  • Indentation
  • Meaningful variable names
  • Subroutines
  • Comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Indentation

A
  • groups together functions
  • ## makes longer programs much easier to read and follow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

comments

A
  • explains the code and its function in more detail
  • using psuedocode that all programmers will understand
  • can also inform other programmers of a bug or issues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

meaningful variable names

A
  • variables should be named to refer to what they actually are
  • they should also be easy to read and use capital letters and underscores to make it easier to read
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

subroutines

A

they give a program structure
- easier to see how different parts of a program come together

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

Input validation

A

checking if data meets certain criteria before passing it into the program

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

types of input validation

A
  • format check
  • data type check
  • length check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

verification

A

checks if the input has been entered correctly ( not double entry or no entry )

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

authentication

A

method of confirming the identity of the user before allowing them access to the program

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

how do programmers use authentication

A
  • passwords associated with usernames
  • biometrics
  • limit the number of failed authentication attempts before access to an account is lost
  • strong passwords
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Iterative testing

A

-program is tested as it is developed, line by line
- used to fix small errors which prevent larger errors later on

17
Q

final testing

A

-program is tested at the end of the development process
- modules may work perfectly on their own but errors may occur when the modules interact with each other

18
Q

what are errors?

A

mistakes in the program code that causes the program to run incorrectly

19
Q

logic errors

A

when the compiler/interpreter is able to run the program but produces an unexpected result

20
Q

syntax error

A

when the compiler/interpreter can’t understand a part of the program because it doesn’t follow the grammar/rules of the language

21
Q

how are logic errors diagnosed

A

they are harder to find as compilers/interpreters can’t pick them up.
- test plans & general use of program

22
Q

how are syntax errors diagnosed

A

by compilers/interpreters as they won’t be able to run the program and return a syntax error ( with location)

23
Q

test plan

A

anticipates all the potential issues with program and selects appropriate test data ( normal, boundary, erroneous, invalid )

24
Q

invalid data

A

values higher or lower than the expected range

25
Q

erroneous data

A

incorrect data types that the program shouldn’t accept