Save
computer science
cs paper 2
2.3 robust programs
Save
Share
Learn
Content
Leaderboard
Learn
Created by
anisah
Visit profile
Cards (39)
What is the main purpose of testing a program?
To ensure that a program works correctly regardless of
user input
View source
What are the key considerations for creating a secure and robust program?
Anticipating
misuse
Input sanitisation
Validation
Verification
Authentication
Maintainable
code
View source
Why is it important to test a program?
To ensure user
requirements
are met,
errors
are removed, and the program doesn't
crash
View source
What does anticipating misuse involve in defensive design?
Planning ahead
to
take
steps
against
potential misuse
View source
What are the two types of testing mentioned?
Iterative Testing
Final Testing
View source
What occurs during iterative testing?
The programmer
develops
a module,
tests
it, and
repeats
until it works as expected
View source
What is input sanitisation in programming?
Checking
and
cleaning
up
data
that
has
been
input
View source
What is final testing also known as?
Terminal testing
View source
When does final testing take place?
After
development
and before the
program
is released to the end user
View source
What is the purpose of validation in programming?
To check whether input data follows specific
criteria
View source
What is a syntax error?
A mistake in the
grammatical
rules of the
programming language
View source
What does verification check in a program?
Whether
data
that
has
been
entered
is
correct
View source
What happens when a syntax error occurs?
The program cannot be
compiled
and
executed
View source
What is authentication in the context of programming?
Ensuring only
authorised
users can gain access to a system
View source
Give an example of a syntax error.
Incorrect spelling:
pront
("hello")
View source
What does maintainable code allow other programmers to do?
Read and
quickly
understand code that has been written
View source
What is a logical error?
A mistake made by the
programmer
that causes incorrect output
View source
What are the types of validation checks mentioned in the study material?
Range
Check
Type
Check
Format
Check
Presence
Check
Lookup
Table
Length
Check
View source
What does a range check verify?
That
data
is within a certain range
View source
What is the outcome of a logical error?
The program runs without
crashing
but displays the
wrong output
View source
What does a type check ensure?
That data is a certain
data type
View source
What is a format check used for?
To ensure data is
entered
in a certain way
View source
Give an example of a logical error.
Incorrect calculation: total =
num1
-
num2
View source
What does a presence check confirm?
That data has
actually
been entered and not left blank
View source
What is test data used for?
To test whether a
program
is functioning correctly
Should cover a range of possible and incorrect
inputs
Designed to prove a program works or highlight flaws
View source
What is a lookup table in programming?
A table of
acceptable
entries, also known as a list
View source
What does a length check verify?
That the length of the
input
is within a certain
amount
View source
What are the four types of test data?
Normal data
- Sensible data the program should accept
Boundary data
- Data at the extreme boundary of data ranges
Invalid data
- Correct data type that does not meet validation rules
Erroneous data
- Wrong data type that the program cannot process
View source
What are the examples of making a program maintainable?
Using subprograms for code reuse
Appropriate variable names
Using indentation for readability
Adding comments for understanding
Using constants for consistency
View source
What is normal data in testing?
Sensible data that the
program
should accept and process
View source
What is modularisation in programming?
Using
subprograms
to reuse code and make it easier to test
View source
What is boundary data?
Data at the
extreme
boundary of any data ranges
View source
Why are appropriate variable names important in programming?
They ensure the purpose of a variable is
immediately
understood
View source
What is invalid data?
Data of the correct type that does not meet
validation
rules
View source
How does indentation improve code readability?
It clearly shows each
‘block’
of code
View source
What is erroneous data?
Data of the wrong
data type
that the program cannot process
View source
What is the purpose of comments in code?
To enable a
programmer
to understand the purpose of each line of code
View source
Why is using constants beneficial in programming?
It keeps the program code
consistent
, making it easier to read and debug
View source
What are the questions related to Defensive Design in the study material?
Describe the different considerations a
programmer
should make for a defensive design.
Describe each
validation check
and give a suitable example.
Explain the different ways a program can be maintained.
View source