OpenCyber Academy
Engineering · Chapter 30 · English
Course code: OCA-117Chapter 30: OCA-117-C030

Chapter 30 — Verification laboratory I

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Lesson map

Lesson 30 published. Map, example, EX088.

flowchart TD
  N0["Learning outcomes"]
  N1["30.1 Test plan"]
  N2["30.2 Running tests"]
  N3["30.3 A failed test"]
  N4["30.4 Test versus control"]
  N0 --> N1 --> N2 --> N3 --> N4
  N4 --> EX["Worked example"]
  EX --> Q["Exercise EX088"]

Logical drawing

flowchart LR
  N0["Learning outcomes"]
  N1["30.1 Test plan"]
  N2["30.2 Running tests"]
  N3["30.3 A failed test"]
  N4["30.4 Test versus control"]
  N0 --> N1 --> N2 --> N3 --> N4 --> Q["EX088"]
[Learning outcomes]
    |
    v
[30.1 Test plan]
    |
    v
[30.2 Running tests]
    |
    v
[30.3 A failed test]
    |
    v
[30.4 Test versus control]
    |
    v
[Worked example] --> [Exercise EX088]

Learning outcomes

You will (1) verify controls with planned tests; (2) record test evidence; (3) distinguish test failure from control failure.

30.1 Test plan

In the verification laboratory, Lindiwe writes a test plan for four controls she helped build: the baseline check, the password-guessing measure, the address-change alert and the asset reconciliation. For each, she defines inputs, expected results and pass criteria. The baseline check should fail a planted server with root login enabled; the guessing measure should flag a planted burst of ten failures in four minutes. Prof. Hale approves the plan before testing starts. Each test is listed with its planted input and the expected outcome in one table.

30.2 Running tests

Lindiwe runs the tests on synthetic data. The baseline check correctly fails the planted server. The guessing measure flags the planted burst and ignores a planted slow sequence, as intended. The address alert fires for a planted change one hour before dispatch. The asset reconciliation correctly lists a planted unregistered host. She records each run with date, inputs, outputs and the version of each script, so results can be reproduced. All four controls pass their first planned cases. She stores the planted inputs alongside the scripts.

30.3 A failed test

One test fails: a planted burst of exactly ten failures spanning precisely five minutes is not flagged. Lindiwe examines the code and finds the comparison treats the boundary inconsistently with her written definition. She corrects the code, reruns all tests and confirms the planted case is now flagged and the earlier results unchanged. Prof. Hale notes that boundary cases are where definitions and code most often disagree. She adds the boundary case to the permanent test set, so the same mistake would be caught again. The fix is a single changed comparison.

30.4 Test versus control

Lindiwe reflects on what the failed test meant. The control itself, detecting guessing, was sound; the implementation had a boundary error. Had the test not existed, a real attack exactly at the boundary would have been missed. She writes in her laboratory report that tests verify implementations against definitions, and that keeping planted test cases permanently lets future changes be checked quickly. Prof. Hale asks her to present this example to the class, because it shows clearly why verification needs planned cases at every boundary rather than only typical inputs.

Worked example

Lindiwe tests four controls with planted cases, finds a boundary error in the guessing measure, fixes it and reruns all tests.

Synthetic case. Tests are synthetic.

Errors and limits

Untested boundary cases often reveal disagreement between definition and code.

Exercises

Worked answers

EX088. Ten failures within four minutes.

EX089. A burst of ten failures spanning exactly five minutes.

EX090. So future changes can be checked quickly.