Skip to content

Course home

Robust and secure programming

Robust and secure programming

EasyMediumHard
12345678
Question 2

A genomic analyst develops an algorithm designed to compress DNA sequences composed strictly of the uppercase characters 'A', 'C', 'G', and 'T'. The algorithm masks repeating sequences by replacing any consecutive run of 4 or more identical nucleotides with a single representative letter followed by its count in square brackets (e.g., 'AAAA' becomes 'A[4]'). Any run of 3 or fewer identical nucleotides must remain completely uncompressed.

For example, the input 'CCGGGGTAAA' should output 'CCG[4]TAAA'.

The developer tests their implementation with only a single test case:

  • Input: 'TTTTT'
  • Output: 'T[5]'

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

State three further distinct tests that the developer should perform to thoroughly test their algorithm. For each test, you must state:

  1. The purpose/category of the test (e.g. normal, boundary, erroneous).
  2. The specific input data used.
  3. 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