Section 10.44

Independent review

Definition

An independent review is a check of a work product, such as code, a calculation, a proof or a measurement result, by a reviewer who did not produce it and who avoids the producer’s likely sources of error. Independence has several dimensions: the person, the method, the implementation, the test oracle §10.5 (the check that decides whether a result is right) and the source of evidence. A review is independent only in the dimensions it actually changes, so a review record names them.

The idea

An author writes a test that computes its expected result with a helper function §2.19. The test passes. A colleague reruns the same test, and it passes again. Two people now agree. But if the helper function is wrong in the same way as the code under test, both runs were bound to pass: the second check repeated the first check’s error. The second signature added a person, not a second way of finding the error.

The aim is a second check that fails in different ways from the first. Every error has a source: a misread requirement, a slip in a formula, a defect in a shared tool, a fault in the recorded data. A second check catches an error only if it does not pass through the same source. The useful question is therefore not whether a second person looked, but which source of error the second look avoided.

How it works

The dimensions in which a review can be independent, and what each one catches:

A review is carried out in this order.

  1. Fix the object. Identify the exact version under review, for example by a cryptographic hash §5.1 of the files, and the claims to be checked.

  2. State the independence. Name the dimensions in which the review differs from the original work, and the premises it shares with that work, such as the same requirement document or the same data.

  3. Give the reviewer primary material: the requirement, the artifact and the raw data §13.16, not the author’s summary, which carries the author’s framing. The reviewer derives results before seeing the author’s, so that the author’s numbers do not anchor the reviewer’s.

  4. Compare. Agreement is evidence in the independent dimensions; disagreement is a finding to resolve.

  5. Record what was checked, by which method, which findings remain open, and what was not checked.

Worked example

A shared oracle. A requirement says that a function returns the square of its input. The author’s code computes x + x by mistake, and the author’s test computes the expected value with a helper that makes the same mistake. For input 3 the code returns 3+3=63 + 3 = 6, the helper expects 6, and the test passes. A reviewer reruns the test, and it passes again. The rerun was independent in author but not in oracle, because both runs used the same helper. A reviewer who derives the expected value from the requirement computes 3×3=93 \times 3 = 9, sees 6 and finds the fault. The choice of input matters too: input 2 would have hidden the fault, since 2+2=4=2×22 + 2 = 4 = 2 \times 2.

Independent replay of a measurement record. A logger records the latency of each request, the time from request to answer, in microseconds. The record holds four values: 900, 1100, 1000 and 3000. The analysis script reports the sample mean §11.12, the sum divided by the count, as 1700 microseconds. A reviewer writes a separate replay script, a new program that recomputes the reported numbers from the same record. It computes (900+1100+1000+3000)/4=6000/4=1500(900 + 1100 + 1000 + 3000) / 4 = 6000 / 4 = 1500 microseconds. The disagreement leads to the fault: the analysis script skipped the first line as if it were a line of column headings, and computed (1100+1000+3000)/3=5100/3=1700(1100 + 1000 + 3000) / 3 = 5100 / 3 = 1700.

The replay script is independent in implementation, but it shares the record with the analysis script, and possibly assumptions taken from the same description of the record, such as its unit. Suppose that the logger’s memory was full at one moment and it dropped a fifth request that took 5000 microseconds. The true mean of the five requests is (6000+5000)/5=11000/5=2200(6000 + 5000) / 5 = 11000 / 5 = 2200 microseconds. Both scripts read the same four values and both miss the dropped one, and so would any number of further scripts. Only independent evidence, such as a count of requests kept by the sender or a second instrument, exposes an error in the record itself.

Stated precisely

Independence is always relative to a kind of error. Let p1p_1 be the probability that the first check misses an error of a given kind, and p2p_2 the probability that the second check misses it. The two checks are independent for that kind of error when the second check’s chance of missing an error is the same whether or not the first check missed it. Then both miss with probability p1p2p_1 p_2. Without independence, the probability that both miss can be as large as the smaller of p1p_1 and p2p_2. With p1=p2=0.1p_1 = p_2 = 0.1, independent checks both miss with probability 0.1×0.1=0.010.1 \times 0.1 = 0.01, while two checks that share the source of the error can both miss with probability up to 0.1, ten times as often.

A review record supports a claim CC about an artifact version VV when it states CC, VV, the method used, the dimensions of independence, the shared premises and the open findings. It supports CC for VV only. It says nothing about other claims, about other versions, or about errors whose source lies in the shared premises.

Limits and common mistakes

People working separately still make the same mistakes. In a 1986 experiment, Knight and Leveson had 27 programs written independently from one specification; statistical tests on their failures rejected the hypothesis that the programs fail independently [440]. A shared specification, shared training and inputs that are hard for everyone correlate errors.

The number of reviewers is not a measure of independence. Three reviewers who rerun one script on one data set add no independence in implementation, oracle or evidence.

A review covers what it covered. Recomputing three equations of a long document checks those three equations. Reading the source code does not measure the hardware’s timing. A citation supports the sentence it is attached to, not the paragraph around it.

A review applies to the version reviewed. After a change, the change itself needs review, and the incremental validation §10.42 entry describes how to decide what else must be rechecked.

A replay of a measurement record checks the computation, not the record: a dropped sample, a wrong unit or a mislabeled run passes through every replay. This sense of replay differs from deterministic replay §10.37, which reruns a program on recorded inputs to reproduce one execution.

Questions answered

What is independent: author, method, oracle, or source evidence?

Any of the four can be independent, and a review is independent only in those it actually changes, so the review record must name them. Author independence means that a different person checks the work; it catches personal slips, but not errors that both people make, such as the same misreading of a requirement. Method independence means a different technique, for example a proof instead of tests; it catches errors specific to one technique. Oracle independence means that the expected result, the value against which the output is judged, is derived again from the requirement instead of being taken from the author’s test; it catches wrong expected values. Source-evidence independence means new data or a second instrument; it catches errors in the data itself.

A second person who reruns the author’s script on the author’s data is independent in author only. If the author’s expected value is wrong, or the data are faulty, the rerun repeats the error. A useful review record therefore lists the dimensions that differ, the premises that are shared, the exact version checked, and the claims that were and were not checked.

Related entries: Test oracle (§10.5), Assurance case (§10.41), Assumption versus guarantee (§1.36), Mechanism versus evidence (§1.37), Differential testing (§10.6), Deterministic replay (§10.37), Incremental validation (§10.42). Further reading: [440, 501].