2.3 producing robust programs

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:58 PM on 3/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

What is defensive design?

2
New cards

What are two key aspects of defensive design?

  • Anticipating misuse → considering how users may misuse a program + thus ensuring that it caters to all likely inputs

  • Authentication → confirms identity of user to ensure only authorised users can gain access to a system

3
New cards

What is input validation?

The process of checking whether and ensuring input data meets a certain criteria.

4
New cards

What is the difference between input validation and verification?

Validation checks whether the input data meets a certain criteria, while verification checks whether data is accurate or correct.

5
New cards

What are some examples of input validation?

  • Presence check

  • Type check

  • Range check

  • Format check

  • Length check

6
New cards

How can input validation be implemented in code?

EX: presence check

name = input("Enter your name: "):
while name == "":
	print("Name cannot be empty.")

EX: range check

age = input("Enter your age: "):
while age < 0 and age > 120:
	print("Age must be between 0 and 120")

7
New cards

What is maintainability?

The ease of understanding, modifying and updating a program.

8
New cards

What are 4 ways maintainability can be improved?

  • Subprograms

  • Appropriate variable names

  • Indentation

  • Comments

9
New cards

How does using subprograms improve maintainability?

It allows blocks of code to be reused and individually tested.

10
New cards

How does using appropriate variable names improve maintainability?

It ensures that the purpose of the variable is immediately understood.

11
New cards

How does using indentation improve maintainability?

It improves readability, makes it easier to identify block of code and find errors.

12
New cards

How does commenting improve maintainability?

It explains the purpose of each line of code.

13
New cards

What is the purpose of testing?

To identify (and fix) errors in a program in order to ensure that it runs correctly.

14
New cards

What are the two types of testing?

  • Iterative

  • Final/terminal

15
New cards

What is the difference between iterative and final/terminal testing?

Iterative testing is the process of testing different modules of program during its development, whereas terminal testing is the process of testing the program at the end of its development.

16
New cards

What are the two key types of programming error?

  • Syntax error

  • Logic error

17
New cards

What is a syntax error?

An error that breaks the grammatical rules of the programming language, stopping it being translated and running.

EX: Print("Hello")

18
New cards

What is a logic error?

An error that produces an unexpected output, but doesn’t stop the program from running.

EX: outputting wrong variable

age = 12
name = Steve
print(f"Hello {age}")

19
New cards

What are the 4 main types of test data?

  • Normal

  • Boundary

  • Invalid

  • Erroneous

20
New cards

What is normal test data?

Data which should be accepted by a program without causing any errors.

EX: 13 is an example of normal test data for a program that accepts ages between 10-18 inclusive.

21
New cards

What is boundary test data?

Data that is on the extreme of an input range (and of the correct data type) that should be accepted by a program without causing any errors.

EX: 18 is an example of boundary test data for a program that accepts ages between 10-18 inclusive.

22
New cards

What is invalid test data?

Data that is of the correct data type but does not meet the validation criteria (e.g. is outside of a certain range) and should not be accepted by the computer system.

EX: 20 is an example of invalid test data for a program that accepts ages between 10-18 inclusive.

23
New cards

What is erroneous test data?

Data that is of the incorrect data type and should not be accepted by the computer system.

EX: “Ten” is an example of erroneous test data for a program that accepts ages between 10-18 inclusive.

Explore top flashcards

flashcards
EntreCulturas 1 Review Vocab
165
Updated 980d ago
0.0(0)
flashcards
English Unit 6 Vocab
20
Updated 1044d ago
0.0(0)
flashcards
LDA Final Jeopardy
26
Updated 1197d ago
0.0(0)
flashcards
Chapter 19 Vocabulary
20
Updated 37d ago
0.0(0)
flashcards
AP World Unit 2
30
Updated 159d ago
0.0(0)
flashcards
Greek and Latin List 3
20
Updated 910d ago
0.0(0)
flashcards
DCUSH semester 1
184
Updated 1192d ago
0.0(0)
flashcards
APUSH Terms 5.2
47
Updated 1168d ago
0.0(0)
flashcards
EntreCulturas 1 Review Vocab
165
Updated 980d ago
0.0(0)
flashcards
English Unit 6 Vocab
20
Updated 1044d ago
0.0(0)
flashcards
LDA Final Jeopardy
26
Updated 1197d ago
0.0(0)
flashcards
Chapter 19 Vocabulary
20
Updated 37d ago
0.0(0)
flashcards
AP World Unit 2
30
Updated 159d ago
0.0(0)
flashcards
Greek and Latin List 3
20
Updated 910d ago
0.0(0)
flashcards
DCUSH semester 1
184
Updated 1192d ago
0.0(0)
flashcards
APUSH Terms 5.2
47
Updated 1168d ago
0.0(0)