computer science 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/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:52 AM on 5/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

19 Terms

1
New cards

What is defensive design?

Writing programs that anticipate and handle misuse — ensuring the program behaves correctly even when given unexpected or invalid inputs — making programs reliable and secure

2
New cards

What is input validation?

Checking that data entered by a user meets specific criteria before it is processed — rejects invalid data and asks the user to re-enter — prevents errors and crashes

3
New cards

Write OCR ERL code that validates a user enters a number between 1 and 10

num = int(input("Enter a number 1-10")). while num < 1 OR num > 10. print("Invalid — try again"). num = int(input("Enter a number 1-10")). endwhile

4
New cards

What is authentication?

Confirming the identity of a user before allowing access — typically using a username and password — prevents unauthorised access

5
New cards

Write OCR ERL code for a simple username and password check

username = input("Username"). password = input("Password"). if username == "admin" AND password == "pass123" then. print("Access granted"). else. print("Access denied"). endif

6
New cards

What are naming conventions and why are they important?

Using clear descriptive names for variables and subprograms — eg totalScore instead of x — makes code easier to read and maintain — allows others to understand the code

7
New cards

What is indentation and why is it important?

Adding spaces or tabs to show the structure of code — makes it clear which statements are inside loops or selection statements — improves readability and maintainability

8
New cards

What is commenting and why is it important?

Adding notes to code using // in OCR ERL — explains what sections of code do — does not affect execution — helps others understand and maintain the code

9
New cards

What is the purpose of using subprograms in terms of maintainability?

Breaks code into smaller named sections — each section can be developed and tested independently — reduces repetition — makes code easier to read update and debug

10
New cards

What is the purpose of testing?

To ensure a program works correctly — identifies and fixes errors before the program is used — checks the program behaves as expected for all possible inputs

11
New cards

What is iterative testing?

Testing modules of a program during development — testing each section as it is written — allows errors to be found and fixed early before they affect other parts

12
New cards

What is final or terminal testing?

Testing the complete finished program at the end of development — checks the whole system works together correctly — checks it meets the original requirements

13
New cards

What is a syntax error and give an example?

An error that breaks the grammatical rules of the programming language — prevents the program from running — eg missing closing bracket — misspelled keyword — missing quotation mark

14
New cards

What is a logic error and give an example?

An error where the program runs but produces incorrect output — eg using > instead of >= causing a boundary to be missed — or an infinite loop due to the wrong condition

15
New cards

What is normal test data?

Data that is valid and within the expected range — should be accepted and processed correctly by the program — eg entering 5 for an input expecting a number between 1 and 10

16
New cards

What is boundary test data?

Data that is on the very edge of what is valid — tests the limits of the program — eg entering exactly 1 or exactly 10 for a range of 1 to 10 — should be accepted

17
New cards

What is invalid test data?

Data of the correct data type but outside the acceptable range — should be rejected by the program — eg entering 0 or 11 for a range of 1 to 10

18
New cards

What is erroneous test data?

Data of the completely wrong data type — should be rejected — eg entering "hello" for a field expecting an integer — tests type checking and validation

19
New cards

Create a test plan for a program that accepts ages between 0 and 120

Normal — enter 25 — expected: accepted. Boundary — enter 0 — expected: accepted. Boundary — enter 120 — expected: accepted. Invalid — enter -1 — expected: rejected. Invalid — enter 121 — expected: rejected. Erroneous — enter "hello" — expected: rejected