AS · Practice questions · Test data and maintenance

Plan the tests.

Six original Cambridge-style questions on test data, test plans and maintenance, with mark-scheme style solutions.

Original questions All questions on this page are original work, written in the Cambridge AS & A Level style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Data, then expected result.

01
Data
[4 marks]

A program accepts the number of days of a hotel booking: a whole number from 1 to 28. Give one example of normal, abnormal, extreme and boundary test data, with the expected result for each.

  • Normal: e.g. 7, accepted. ✓
  • Abnormal: e.g. 40 or −2 or "week", rejected. ✓
  • Extreme: 1 or 28, accepted. ✓
  • Boundary: e.g. 0 rejected / 29 rejected (with 1 / 28 accepted). ✓
02
Explain
[3 marks]

Explain the need for a test plan and describe its likely contents.

  • Needed so that testing is planned, thorough and repeatable, and results can be checked against what should happen. ✓
  • Contents: test number, purpose / what is being tested, test data, type of test data. ✓
  • Expected result, actual result, pass / fail and any action taken. ✓
03
Recall
[3 marks]

Describe corrective, adaptive and perfective maintenance.

  • Corrective: fixing errors / bugs found after the program is in use. ✓
  • Adaptive: changing the program to meet new requirements or a changed environment (e.g. new law, hardware or operating system). ✓
  • Perfective: improving a program that works, e.g. its performance or ease of use. ✓
04
Apply
[3 marks]

Identify the type of maintenance in each case. (a) A shop's program is changed to accept a new payment card. (b) A bug that printed the wrong date on receipts is fixed. (c) A menu is redesigned so tasks need fewer clicks.

  • (a) Adaptive. ✓
  • (b) Corrective. ✓
  • (c) Perfective. ✓
05
Write
[4 marks]

The function returns the delivery charge for an order:

FUNCTION Delivery(OrderTotal : REAL) RETURNS REAL
    RETURN 4.99
ENDFUNCTION

Amend the function so that delivery is free (0) for orders of 50.00 or more, and 4.99 otherwise.

  • Keeps the header FUNCTION Delivery(OrderTotal : REAL) RETURNS REAL. ✓
  • IF OrderTotal >= 50.00 THEN ✓
  • RETURN 0 ... ELSE RETURN 4.99 (or assign to a variable and return it). ✓
  • ENDIF ... ENDFUNCTION. ✓
06
Data
[3 marks]

For the amended Delivery function, give three values of OrderTotal that test the condition, with the expected result for each.

  • 49.99: 4.99 (just below the limit). ✓
  • 50.00: 0 (at the limit). ✓
  • A normal value either side, e.g. 20.00: 4.99 or 80.00: 0. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.