75 exam-style questions on this topic, at up to four difficulty levels, with full mark schemes. Notes and past-paper booklets are open to everyone. Practice needs a free account.
Or take a quick quiz: 10 questions on this subtopic in GCSE Computer Science (Edexcel), marked as you tap.
Robust software keeps working correctly even when it gets unexpected input, meets an error or is attacked. You need to know why robustness matters and two ways of finding vulnerabilities in software: code reviews and audit trails. Paper 1 asks 'Explain why…' and 'Describe how…' questions, sometimes with a short piece of code or an audit log to examine.
Key facts
Robust software: keeps working correctly with unexpected input, errors or attacks
Vulnerability: a weakness that could be exploited or could cause failure
Code review: other programmers systematically check the code for errors and vulnerabilities
Audit trail: a time-ordered record of who did what, and when
Audit trail of code changes → trace the change that caused a fault, and roll it back
Audit trail of user activity → spot unusual behaviour that suggests an attack
Common weaknesses: unvalidated input, hard-coded passwords, unlimited log-in attempts, unencrypted data
Notes
Robust software
Robust software keeps working correctly when things go wrong: unexpected or invalid input, missing files, heavy use or a deliberate attack. It does not crash or behave unpredictably.
A vulnerability is a weakness in software that an attacker could exploit, or that could make it fail.
Why it matters: crashes can lose work and data; vulnerabilities let attackers steal data or money; failures in systems such as medical equipment or cars can hurt people; organisations can face fines, legal action and loss of trust.
It is much cheaper to find and fix problems before the software is released than afterwards.
Code reviews
In a code review, programmers who did not write the code examine it systematically, line by line, before it is released.
They look for weaknesses such as inputs that are not validated, passwords written into the code (hard-coded), sensitive data that is not encrypted, unlimited log-in attempts, logic errors and code that does not follow the team's standards.
A fresh pair of eyes spots mistakes the original programmer missed. Problems found are recorded and fixed before release.
Automated tools can also scan code for known risky patterns. Reviews take time, and reviewers can still miss problems.
Audit trails
An audit trail is a record of events, in time order, showing who did what and when.
During development, it records every change made to the code. If a bug or vulnerability appears, the team can trace the change that caused it and undo it (roll back to an earlier version). Programmers are accountable for their changes.
In a working system, it logs activity such as log-ins, failed log-in attempts and data viewed or changed. Unusual patterns, such as a log-in at 3 am or thousands of records downloaded, can reveal someone exploiting a vulnerability.
An audit trail must be protected so that ordinary users cannot change or delete it.
How to answer each type of question
Explain why robust software is important
2 to 4 marksGrade 5
Say what could go wrong if the software crashed or behaved unexpectedly.
Say what an attacker could do through a vulnerability.
Link every point to the people in the scenario.
Example. A hospital uses software to work out doses of medicine for patients. Explain why it is important that this software is robust. (3)
Show the model answerHide the model answer
Any three from: if the software crashed, staff might not be able to work out doses when they are needed (1); unexpected or invalid input could produce a wrong dose, which could harm a patient (1); a vulnerability could let an attacker see or change patients' records (1); the hospital could face legal action and lose the trust of patients (1).
Describe how code reviews and audit trails identify vulnerabilities
2 to 4 marksGrade 6
Code review: say who does it (other programmers), how (line by line) and what they look for.
Audit trail: say what it records (who, what, when) and how that helps trace or detect a problem.
Finish with what happens next: the problem is fixed or rolled back.
Example. (a) Describe how a code review can help to make software robust. (2) (b) A development team keeps an audit trail of all changes to its program code. After an update, a vulnerability is found. Explain how the audit trail helps the team. (2)
Show the model answerHide the model answer
(a) Programmers who did not write the code examine it carefully, line by line (1). They look for weaknesses, such as inputs that are not validated, so these can be fixed before the software is released
(1).
(b) The audit trail shows who changed the code, what they changed and when (1), so the team can find the change that introduced the vulnerability and fix it or roll back to the earlier version
(1).
Identify vulnerabilities in code and suggest fixes
4 marksGrade 7
Check every input: is it validated before it is used?
Look for passwords or PINs written into the code.
Look for log-in loops with no limit on attempts.
Give the line number, the problem and a matching fix.
Example. This Python code is about to be checked in a code review.
Identify two vulnerabilities in the code. For each one, describe how it could be fixed. (4)Show the model answerHide the model answer
Line 01: the PIN is written into the code (hard-coded), so anyone who can read the code knows it (1). Fix: store the PIN outside the code, e.g. in an encrypted file that users cannot read
(1).
Lines 04 to 06: there is no limit on the number of attempts, so someone could keep guessing until they find the PIN (1). Fix: use tries to stop the loop and lock the device after, for example, 3 wrong attempts
(1).
Don’t lose marks
Saying a code review is when programmers check their own code, or confusing it with testing (running the program).
Saying an audit trail stops attacks. It records events, which helps you detect and trace problems.
Writing 'make it more secure' without saying how.
Saying robust software has no bugs at all. It copes with problems without failing.
Naming a problem in code without saying which line it is on, or without giving a matching fix.
More tips
Memory tricks
Audit trail = who, what, when.
Code review = fresh eyes on someone else's code, before release.
Robust = it does not break when you give it something unexpected.
For any code snippet, check: inputs validated? passwords in the code? limit on attempts?
Exam technique
In code questions, quote the line number and pair each problem with a fix.
Link 'why robust' answers to the scenario: patients, customers' money, personal data.
For audit trails, 'who, what and when' is what examiners look for.
Keep code reviews and testing separate: a review reads the code; testing runs it.
What each grade needs
What you need to be able to do, from the first marks up to the top grade.
Grade 3
Define robust softwareSoftware that keeps working correctly, without crashing, even with unexpected input or when attacked.
Grade 4
State what an audit trail recordsWho did what, and when: for example who changed the code, or who logged in and what they accessed.
Grade 5
Explain why robust software is importantCrashes and vulnerabilities can lose data or money, harm people, and damage an organisation's reputation.
Grade 5
Describe how a code review finds vulnerabilitiesOther programmers check the code line by line for errors and weaknesses before it is released.
Grade 6
Explain how audit trails help find problemsThey show which change caused a fault, or reveal unusual activity that suggests an attack.
Grade 7
Spot vulnerabilities in a piece of codeLook for unvalidated input, passwords written into the code and unlimited log-in attempts, and suggest a fix for each.
Grade 8
Evaluate ways of making software robustWeigh code reviews, audit trails and testing against their cost and the fact that none of them can find every problem.
Quick recall
Cover the answers and test yourself. The app has these as flashcards that come back just before you'd forget them.
Define the term 'robust software'.
Software that keeps working correctly even with unexpected input or attacks.
Complete the two sentences using words from the box.
record keyboard vulnerabilities monitor
An audit trail is a ……… of the actions that users carry out in a system. A code review can find ……… in a program before it is released.
record; vulnerabilities
State the two pieces of information that the program stores in the audit trail for each action.
The user ID and the action.
Give one way a programmer can make a program more robust when it asks the user to enter data.
Validate the input and ask again if it is not valid.
Describe what is meant by a vulnerability in a program.
A weakness in a program that an attacker could use to cause harm.
A student says: ‘A code review means running the program with test data.’ Is the student correct? Give a reason.
No. A code review examines the program code to find problems.
Sample questions
Written for this site in the style of Edexcel exam questions. They are not taken from real past papers.
Question 1Easy3 marks
(a) Define the term 'robust software'.
[1]
(b) Identify a method of identifying vulnerabilities in program code.
[1]
Code review
Disk defragmentation
Data compression
Cable management
(c) State one piece of information recorded in an audit trail.
[1]
Show the answer and mark scheme
(a)Answer: Software that keeps working correctly even with unexpected input or attacks.
software that keeps working correctly (does not crash), even when it receives unexpected or invalid input or is attacked
(b)Answer: Code review
(c)Answer: Who made each change (also what and when).
who made a change or accessed the system / what was changed or done / when it happened (date and time)
Question 2Medium4 marks
A bank is developing a new mobile banking app. Explain why it is important that the app is robust.
[4]
Show the answer and mark scheme
Answer: Bugs could lose customers' money; vulnerabilities could let hackers steal from accounts; the bank risks fines and lost trust.
if the app crashes or has bugs, customers may be unable to access their money, or payments may be lost or made twice
vulnerabilities could be exploited by hackers to access customers’ accounts or data
which could lead to money being stolen / fraud
the bank could be fined or face legal action (e.g. under the Data Protection Act) if personal data is exposed
customers would lose trust in the bank and move to a competitor
fixing problems after release costs far more than preventing them
Question 3Hard4 marks
A programmer has written this Python code. It is about to be checked in a code review.
01 password = "admin123"
02 attempt = input("Enter password: ")
03 if attempt == password:
04 print("Access granted")
05 total = float(input("Enter the total bill: "))
06 people = int(input("Enter number of people: "))
07 share = total / people
08 print("Each person pays", share)
Identify two problems that the code review should find in this code. For each problem, explain how it could be fixed.
[4]
Show the answer and mark scheme
Answer: Hard-coded password (store it securely instead); unvalidated numeric input can crash the program, including division by zero (validate and range-check the input).
line 01: the password is written into the code (hard-coded), so anyone who can read the code knows it
fix: store the password securely outside the code, e.g. as an encrypted or hashed value in a protected file
lines 05–06: if the user enters something that is not a number, float() or int() causes a runtime error and the program crashes
fix: validate the input (check that it is numeric) before converting it, and ask again until valid data is entered
line 07: if the user enters 0 people, dividing by zero causes a runtime error
fix: check that the number of people is greater than 0 before dividing (a range check)