Skip to content

Course home

Robust and secure programming

Robust and secure programming

EasyMediumHard
12345678
Question 8

A developer writes a security-focused input validator for custom security passcodes. The algorithm is designed to validate passcode strings and ensure they strictly conform to a 5-character format:

  • It must start with a single uppercase letter ('A'–'Z').
  • It must be followed by exactly three digits ('0'–'9').
  • It must end with a single lowercase letter ('a'–'z').

If the input passcode matches these rules, the program outputs 'ACCEPTED'. Otherwise, it outputs 'REJECTED'.

The developer tests their implementation with only one test case:

  • Input: 'R902k'
  • Output: 'ACCEPTED'

The test was successful, but testing with only a single test case is insufficient to prove the robustness of the validator.

Using example test data, state three further tests that the developer should use to improve the testing of their code. For each test, you must state the input data and the expected output.

[3]
Markscheme

Robust and secure programming Questions

  1. GCSE
  2. /Computer Science
  3. /Robust and secure programming

27 exam-style questions on AQA GCSE Computer Science Robust and secure programming. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank