Section Six: Design, Testing and IDEs Flashcards

1
Q

How do programmers try to protect their programs?

A
  1. Anticipating how users might misuse the program, then attempt to prevent it from happening
  2. Ensure their code is well-maintained
  3. Reduce the number of errors in the code through testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Two ways to prevent users from entering something you don’t want them to

A

Input Validation

Input Sanitisation

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

Input Sanitisation

A

Removing any unwanted characters before passing data through the program

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

Input Validation

A

Checking if data meets certain criteria before passing it onto the program. E.g. checking that an email address contains a @ symbol and has a suitable ending

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

Types of input validation checks

A
Range Check
Presence Check
Check Digit
Format Check
Look-up table
Length check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Range Check

A

Checks the data is within a specified range

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

Presence Check

A

Checks the data has actually been entered

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

Check Digit

A

Checks numerical data has been entered accurately

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

Look-up Table

A

Checks the data against a table of acceptable values

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

Length Check

A

Checks the data is the correct length

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

Format Check

A

Checks the data has the correct format (e.g. a date)

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

Authentication

A

Confirms the identity of a user before they’re allowed to access certain pieces of data or features of the program. A common way that program do this is using passwords

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

Ways to increase the security of a password-based authentication system

A
  1. Force users to use strong passwords and get them to change their passwords regularly
  2. Limit the number of failed authentication attempts before access to an account is lost
    3 Ask for a random selection of characters from the passwords on each authentication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is meant by a “well-maintained” program?

A

A program that is easy for other programmers to understand what the code does.
They should also be able to make changes to parts of the source code without the risk of causing problems elsewhere in the code.

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

Features to improve the maintainability of source code

A
  1. Comments (after // or #) are useful for explaining what the key features of a program do
  2. Indentation can be used to separate different statements in a program. This allows other programmers to see the flow of the program more clearly and pick out the different features
  3. Variables and sub-programs should be named so that they refer to what they actually are
  4. Only use global variables when necessary as they could affect the rest of your code. Variables with a local scope will only affect the sub programs they are declared in.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Syntax Errors

A

When the compiler or interpreter doesn’t understand something you’ve typed because it doesn’t follow the rules or grammar of the programming language.

17
Q

Logic Errors

A

When the compiler or interpreter is able to run the program, but the program does something unexpected.

18
Q

Functionality testing

A

Seeing if the program meets its initial requirements.

19
Q

Performance Test

A

Test how quickly certain features run and their impact of computer resources

20
Q

Usability Test

A

Tests how user-friendly the interface and features are

21
Q

Security Test

A

Tests vulnerability to attacks and how securely data is stored

22
Q

Load/Stress Test

A

Tests how it copes under extreme conditions, e.g. lots of users at the same time

23
Q

Diagnosing Syntax Errors

A

Syntax errors can be diagnosed by compilers and interpreters.
They’ll be unable to turn the source code into machine code and a syntax error will be returned

24
Q

Diagnosing Logic Errors

A

Logic Errors are more difficult to diagnose and track down - compilers and interpreters won’t pick them up. Logic errors are found through general use of the program and by systematically testing it using a test plan.