2.3 - Producing robust programs

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

8 Terms

1
New cards

What are defensive design considerations? List them

Defensive design considerations are considerations when creating a program that is secure and robust

  • Anticipating misuse (planning ahead to take steps against potential misuse)

  • Input sanitation (eg. removing special characters to prevent an SQL injection)

  • Validation (checking whether data follows specific criteria that should be accepted)

  • Verification (checking data entered is correct)

  • Maintainable code (allow others to be able to quickly and read and understand code that has been written)

  • Authentication (to confirm the identity of a user)

2
New cards

What is validation?

A process to check that data is reasonable or sensible before it is accepted

3
New cards

Give types of input validation

  • Length check (length of input is within a range)

  • Range check (data is within a certain range)

  • Type check (data is of a certain data type)

  • Format check (data is entered in a certain way)

  • Presence check (data has actually been entered and not left blank)

4
New cards

Give methods of making a program maintainable

  • Commenting (enables programmers to understand the purpose of the code)

  • Indentation (improves readability)

  • Subprograms (reuse code and make them easier to test)

  • Appropriate variable names (purpose of a variable is understood)

  • Using constants (keeps programs consistent, easy to read and debug)

5
New cards

What is the purpose of testing programs?

To ensure that a program works correctly no matter what input has been entered by the user

6
New cards

Explain the two types of testing

  • Iterative: repeatedly testing the small parts of the program (modules) during the development of the program (until it works as expected)

  • Terminal: testing the program after it has been developed and before the program is released to the end user. Takes place once all of the modules have been individually tested to ensure the whole program works all together as expected

7
New cards

Explain the two types of errors:

  • Syntax: errors where the code doesn’t follow the rules of the programming language, so the computer cannot compile and execute it

  • Logic: the program can be run but does not work as intended, producing an unexpected output

8
New cards

Explain the four types of test data

  • Normal test data: test data which should be accepted by a program without causing errors

  • Boundary test data: test data that is data of the correct type but is at the edge of the data range/ not being valid

  • Invalid test data: test data that is data of the correct data type which should be rejected by the computer (does not meet the validation rules)

  • Erroneous test data: test data is data of the incorrect data type which should be rejected by a computer system