PRINCIPALCHAPTER 33

What the research says about tests, reviews and defects

Eight studies, what each one measured, how many things it looked at, and what it cannot tell you. Then a ten-bug replication of the best-known one on the checkout lab

55 MINSOFTWARE TESTING AND QUALITYUPDATED 2026-11-24
PREDICT

You take one codebase and a pool of its tests. You draw many random sub-suites, some of 4 tests, some of 20, and measure each sub-suite's coverage and how many known bugs it catches. Across all the sub-suites together, coverage and bugs caught rise together strongly. Inside the group of sub-suites that all have 10 tests, what do you expect?

You have met several of these studies already in passing: Inozemtseva and Holmes in the coverage chapter, Fucci and Nagappan in test-driven development, Luo and Gruber in flaky tests. Each time the chapter used the result for a local point. This one reads them side by side and adds four more. The aim is not a list of findings to quote. It is a way of reading a result: what was measured, how many, by whom, and what the number does not say.

Every claim below comes from a paper’s abstract or from the paper itself, read on 2026-11-24. I read Yuan and colleagues in full. For the other papers I read the abstract: the full text of the ACM and IEEE papers is behind publisher walls that block scripted access, so I confirmed each record through Crossref and read its abstract from the published record. Where a limit below goes past what an abstract says, it is marked as my reading, and you should check it in the paper’s own threats-to-validity section.

Three kinds of evidence, and what each can carry

Before the studies, the vocabulary. A claim that a practice works can rest on three different designs.

  • An experiment assigns the practice at random. If the groups differ afterwards, the practice is the likeliest reason, because chance spread everything else evenly. It is rare in software, because developers and teams are expensive to randomise and the tasks are small.
  • An observational study watches what happens without assigning anything: teams that chose a practice against teams that did not, or projects with high coverage against projects with low. Any difference can come from the practice or from whatever else those teams share. That second source is a confounder. A team that is careful enough to adopt a practice is probably careful in other ways too.
  • A mining or reanalysis study takes public data (issue trackers, repositories) and fits a model. It is cheap, large and prone to the same confounders, plus problems of its own: what counts as a bug, which commits were counted, which projects were chosen.

Then three questions to ask of every result.

  1. What is the unit, and how many? Thirty-nine developers, 357 faults, 198 failures, 31,000 suites. The number matters less than what it counts: 31,000 suites from five programs is five programs.
  2. What did they measure instead of what you care about? You care about bugs that reach customers. A study may count seeded faults, mutants, issue-tracker tickets or functional correctness on a small task. Each is a stand-in, and the gap between the stand-in and your goal is a limit on the result.
  3. Who or what else could explain the difference? Name the confounder. If you cannot, you have not read the design yet.

One more word, because it appears in every chapter that quotes a study: correlation is a measured tendency of two numbers to move together. Causation is the claim that changing one changes the other. A correlation is the start of that claim, and size and team discipline are two common reasons it fails.

Coverage, size and faults caught

Inozemtseva and Holmes (ICSE 2014) are the best-known test of whether coverage predicts a suite’s strength. The abstract states the design. They generated 31,000 test suites for five systems of up to 724,000 lines of source code, measured statement, decision and modified-condition coverage for each suite, and used mutation testing to measure how many faults each suite detected. They report a low to moderate correlation between coverage and effectiveness when the number of test cases is controlled for, and that stronger forms of coverage gave no greater insight. Their conclusion: coverage is useful for finding under-tested parts of a program and should not be a quality target.

Read the limits as carefully as the finding.

  • The faults are mutants. Effectiveness is the share of mutants a suite kills. If mutants behave unlike real bugs, the result is about mutants. That is the question the next study asks.
  • Five systems, all in Java. The abstract says so by describing “large Java programs”. The suites are 31,000, but the programs are five, and the suites from one program are not independent evidence about another.
  • Suite size is the confounder they control for, which is the whole point. Pooled over sizes, coverage and effectiveness rise together. Hold the number of tests fixed and the link weakens. This is the shape you reproduce in the lab.
  • They did not claim that coverage is useless. Low to moderate is not zero, and the abstract’s own phrase is “useful for identifying under-tested parts”.

The FSE 2014 mutant study, second in the reading list, asks whether the mutant stand-in is fair. Their experiments used 357 real faults in five open-source applications totalling 321,000 lines, with both developer-written and automatically generated test suites, and they considered the effect of coverage on the mutant detection rate explicitly. The abstract reports a statistically significant correlation between mutant detection and real fault detection, independently of code coverage, and also that the results “reveal some inherent limitations” of mutation analysis. Two cautions follow. A significant correlation is not a strong one: the abstract does not give the strength, so read the paper before you quote it as such. And the real faults are those that developers found and fixed, which are the faults that a test or a user once exposed. Faults nobody found are not in the sample.

Put the two together. The best reading of both: once you hold suite size fixed, coverage is a weak predictor of how many faults a suite finds, and mutant detection is a better one, though neither is a guarantee. That matches the working rule in the coverage chapter, and the second paper supports the instrument that the first one used. If the mutants had been poor stand-ins, the first result would have been much harder to believe.

Test-first, and the practices that go with it

Test-driven development cited two studies. Reading them next to the others adds a point about design.

Nagappan and co-authors (2008) report four industrial teams that adopted TDD, each compared with a similar team that did not. It is the kind of study a manager wants: real teams, real products. It is also observational. The teams chose, or were put, into TDD, and the comparison team was chosen to be similar, which is not the same as random. Those two facts do not make it wrong. They set what it can say: in these four comparisons, TDD went with fewer defects and more development time. They cannot say TDD caused the whole difference.

Fucci and colleagues (IEEE TSE 2017) look inside TDD. They analysed 82 data points from 39 professionals, each capturing the process used on one development task, and built regression models of quality (functional correctness) and productivity on four process characteristics: sequencing, granularity, uniformity and refactoring effort. Quality and productivity were positively associated with granularity and uniformity. Sequencing, the order of writing test and code, had no important influence. The authors’ reading is that TDD’s benefits may come from fine-grained, steady steps and not from test-first. Note what this is: a regression on tasks that people did. It names the likeliest mechanism. It does not run an experiment in which the same developers change only the order.

Basili and Selby (IEEE TSE 1987) are the oldest paper here, and the one closest to a controlled comparison. They compared three techniques: code reading by stepwise abstraction, functional testing (equivalence partitioning and boundary values) and structural testing to 100% statement coverage. Thirty-two professional programmers and 42 advanced students applied the techniques to four unit-sized programs in a fractional factorial design. With the professionals, code reading found more faults than functional testing, and functional testing found more than structural testing. With the students the picture was mixed: in one group, reading and functional testing tied and both beat structural testing, and in the other there was no difference. The authors also report that the number of faults found, the rate and the effort depended on the kind of software, and that each technique found different classes of faults: reading found more interface faults, functional testing more control faults. These details come from the 1985 technical report and summaries of it, because the TSE abstract is behind a publisher’s wall.

The honest limits are obvious. The programs were four and unit-sized. The study is from 1987, before test frameworks, fast feedback and continuous integration. It compares people applying techniques once, not a suite that runs on every commit for five years. What survives is the structural idea: techniques find different classes of faults, and 100% statement coverage as a method did not outperform a method that picks inputs from the specification. The seeded bugs show the same thing at small scale: most of them are caught by one test, written for that bug’s input.

Reviews: what they find and what they are for

Bacchelli and Bird (ICSE 2013) studied modern, tool-based code review at Microsoft. They observed, interviewed and surveyed developers and managers, and manually classified hundreds of review comments across diverse teams. Finding defects was still the main motivation for review, but reviews were “less about defects than expected” and gave other benefits: knowledge transfer, team awareness and alternative solutions. They report that understanding the code and the change was the key activity.

This is an expectations-and-outcomes study. It is not a measurement of defects prevented per hour of review, and the abstract does not claim to be. It is also one company, in one period, with one tooling style. What it supports is narrow and useful: do not justify review only by defects found, and do not measure it only that way. A team that counts review comments tagged as defects will undercount the value, and may push reviewers toward the wrong behaviour.

Where production failures come from

Yuan and colleagues (OSDI 2014) studied 198 randomly sampled, user-reported failures in five systems: Cassandra, HBase, HDFS, Hadoop MapReduce and Redis. I read the paper, not only the abstract. The selection is described in the methodology: tickets marked Blocker, Critical or Major, dated 2010 or later, with duplicates and test-system failures removed. Of the 198, 48 (24%) were catastrophic, meaning they stopped all or most users from reaching the system. Of those catastrophic failures, 92% were the result of incorrect handling of non-fatal errors that the software had explicitly signalled. The authors judged that in 58% of them the underlying faults could easily have been detected by simple testing of error-handling code, and that 35% fell into three trivial patterns, for example an empty error handler or one that only logged. In the non-catastrophic failures, only 25% involved incorrect error handling. A static checker built from those patterns, Aspirator, would have prevented over 30% of the catastrophic failures and found 143 bugs and bad practices in nine systems.

The result is a strong argument for one cheap kind of test, and the limits are the paper’s own. Its limitations section says that, as with all characterisation studies, the findings may not be representative. It rests on five open-source distributed data systems and on severe tickets, so a payments service with a relational database is a different population. “Could have been prevented by simple testing” is the authors’ judgement made after reading the failure and the fix, which is easier than writing the test before it happened. The paper’s statistical note gives a 6.9% margin of error at 95% confidence for 198 samples, and the subset of 48 catastrophic failures is much smaller, so the percentages on it carry wider margins than the paper’s headline margin for the whole sample. The practical reading for Ojaline’s checkout is modest and specific: test the handler for every error the code already detects, such as PaymentUnavailable and a declined card, as hard as the happy path. Chapter fakes, stubs and mocks showed how.

When a published correlation falls apart

Berger and colleagues (TOPLAS 2019) did something rare: they tried to reproduce a well-known result. The original study by Ray and colleagues claimed a statistically significant association between eleven programming languages and defects in GitHub projects. Berger et al. report that a repetition of the experiment partly succeeded, and supported the original claim for ten languages. Then they re-examined the data and the modelling and found flaws that undermined the conclusions. In their analysis only four languages show a significant association with defects, and even those effects are very small. They close with other sources of bias and recommendations for practice.

The lesson is about the process more than about languages. A large dataset, a respected venue and a clean story did not stop a correlation resting on a flawed analysis. Mining-based studies about what causes bugs are the ones where this risk is highest, because the data (commits, labels, “bug fix” keywords) was not made for the question. Treat a surprising claim of that kind as a hypothesis until someone else has reproduced it.

What the eight add up to

Study Looked at Size Design What it cannot say
Inozemtseva and Holmes 2014 Coverage against mutants killed 31,000 suites, 5 Java systems Generated suites, measured That coverage is useless, or that it predicts real faults
FSE 2014 mutant study Mutants against real faults 357 faults, 5 applications Measured on fixed faults How strong the link is in your code
Nagappan et al. 2008 TDD against defects 4 industrial teams Observational, matched teams That TDD alone caused the gap
Fucci et al. 2017 Process traits against quality 82 data points, 39 professionals Regression An experiment on order alone
Basili and Selby 1987 Reading, functional and structural testing 74 people, 4 small programs Controlled comparison Anything about modern pipelines
Bacchelli and Bird 2013 What review is for Teams at one company, hundreds of comments Observation, interviews, survey How many defects review prevents
Yuan et al. 2014 Where catastrophic failures come from 198 failures, 48 catastrophic, 5 systems Sampled tickets, read by hand That a different kind of system fails the same way
Berger et al. 2019 Languages against defects GitHub data, 11 languages Reproduction That language never matters

Three patterns run through the table.

Size and effort confound almost every comparison. More tests, more careful teams and more review all go with more of everything else. The best studies here either control for the confounder (suite size in the first paper) or admit they cannot.

Stand-ins are everywhere. Mutants for faults, tickets for failures, a task’s functional correctness for quality in production. Each paper is honest about its stand-in, and the first two papers test one of them directly.

The strong claims are the narrow ones. Error-handling code deserves tests. Coverage finds what you never ran. Techniques find different faults. Order is not what matters in TDD, steady small steps are. None of these is the slogan on the board’s slide.

So what does Anneke tell Willem? Tests are worth paying for, and the studies support particular uses: boundary and specification-based cases, tests on error handling, small and steady cycles, review for more than defects. They do not support a coverage percentage as a target, a claim that one process halves bugs, or any number that is not measured on his own system. The cheapest way to learn about his own system is to run a small version of the experiment on it, which is the lab.

Your replication

The lab repeats the shape of the first study on a much smaller scale, with the checkout service as the program and its ten seeded bugs as the faults. You already know the bugs from the project; they are real defects of the kind the lab teaches, but they were seeded by the lab’s author, not found in production.

The method:

  1. The pool. A set of tests that all pass on the clean code: the starter suite plus the answer-key tests in seeded/reference_tests, 35 tests in all.
  2. Per-test coverage. Run the pool once under pytest-cov with --cov-context=test, which records which lines each test ran. The coverage of any sub-suite is then the union of its tests’ lines, with no further run.
  3. Per-test detection. Apply each seeded bug in turn with scripts/seed_bugs.py, run the whole pool, and record which tests fail. A sub-suite catches a bug if any one of its tests fails with that bug applied.
  4. Random sub-suites. For sizes from 2 to 22 tests, draw 40 random sub-suites each, and record each one’s coverage and number of bugs caught.
  5. Two correlations. One over all sub-suites pooled, one inside each size.

The design copies the paper’s logic and none of its scale: the paper had 31,000 suites over five systems up to 724,000 lines, and you have 320 sub-suites over one system of 442 statements and ten bugs. A result that matches the shape tells you the lab is behaving like the paper. A result that differs tells you nothing about the paper, because a ten-bug study cannot overturn a five-system one.

Before you run it, write down what the study cannot tell you. The list is part of the method, and you will compare it with what you find.

Checking a claim before you act on it

When someone brings you a number, a short list is enough.

  • Find the paper itself, not a post about it. Read the abstract and then the limitations section.
  • Write down the size and what it counts.
  • Name the stand-in for the thing you care about.
  • Name one confounder.
  • Ask whether anyone has reproduced it.
  • Run a small version on your own system if you can, and write down what yours cannot say either.

A claim that survives that list is not proved. It is one you can use with its limits stated, which is as much as this field offers.

LAB Replicate the coverage study on ten seeded bugs ~40 MIN
YOU NEEDPython 3.9 or laterlabs/testing set up with its .venv (see its README)The lab as shipped: tests/ and checkout/ unchanged, no seeded bug appliedNo Docker, no network, no servers

You will write one script that draws random sub-suites from the lab’s tests, measures each one’s coverage and the seeded bugs it catches, and prints the correlation pooled and inside each suite size. It applies each seeded bug to checkout/ for a few seconds and reverts it. Work from labs/testing. The numbers below are from the shipped lab, and the selection is seeded, so yours match them exactly if tests/ is unchanged. If you added tests in the project, your counts differ and the shape should not.

cd labs/testing
export CHECKOUT_DB=/tmp/research-lab.sqlite
mkdir -p data
.venv/bin/python scripts/seed_bugs.py status

Ten lines starting clean, one per seeded bug. If any says applied, run .venv/bin/python scripts/seed_bugs.py revert all first. The script below reverts each bug in a finally block, but if you interrupt it, run that command.

1. Count the pool. The pool is the starter tests plus the answer key’s tests, all of which pass on the clean code (two are strict xfails for real bugs in the clean code, and count as passing).

.venv/bin/pytest --collect-only -q -p no:randomly tests/unit tests/integration tests/extras seeded/reference_tests | tail -1

35 tests collected in 0.17s (the time varies). The three starter folders alone give 23.

2. Write the replication script. Create scripts/replicate_coverage.py. It has two commands. collect runs the pool once for per-test coverage, then once per seeded bug for per-test detection, and saves everything to data/replication.json. analyse draws the sub-suites and prints the correlations. It uses only the standard library and coverage, which pytest-cov already installed.

"""A small replication of Inozemtseva and Holmes (2014) on the checkout lab.

From labs/testing:
  .venv/bin/python scripts/replicate_coverage.py collect   # per-test coverage, per-test bug results
  .venv/bin/python scripts/replicate_coverage.py analyse   # random sub-suites, correlations
"""
import glob
import json
import os
import random
import subprocess
import sys

import coverage

LAB = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
PY = os.path.join(LAB, ".venv", "bin", "python")
POOL = ["tests/unit", "tests/integration", "tests/extras", "seeded/reference_tests"]
OUT = os.path.join(LAB, "data", "replication.json")

def pytest(*args):
    cmd = [PY, "-m", "pytest", "-p", "no:randomly", "-p", "no:cacheprovider", "-q", "--tb=no", "-rfE", *POOL, *args]
    return subprocess.run(cmd, cwd=LAB, capture_output=True, text=True)

def test_ids():
    out = pytest("--collect-only").stdout
    return [line for line in out.splitlines() if "::" in line]

def per_test_lines():
    data_file = os.path.join(LAB, "data", ".coverage")
    if os.path.exists(data_file):
        os.remove(data_file)
    env = dict(os.environ, COVERAGE_FILE=data_file)
    subprocess.run([PY, "-m", "pytest", "-p", "no:randomly", "-p", "no:cacheprovider", "-q", "--tb=no", *POOL,
                    "--cov=checkout", "--cov-context=test", "--cov-report="], cwd=LAB, env=env, capture_output=True)
    cov = coverage.Coverage(data_file=data_file)
    cov.load()
    data = cov.get_data()
    files = sorted(glob.glob(os.path.join(LAB, "checkout", "*.py")))
    total = sum(len(cov.analysis2(f)[1]) for f in files)
    lines = {}
    for f in data.measured_files():
        for lineno, ctxs in data.contexts_by_lineno(f).items():
            for c in ctxs:
                if c:
                    lines.setdefault(c.split("|")[0], set()).add((os.path.relpath(f, LAB), lineno))
    return {k: sorted(v) for k, v in lines.items()}, total

def failing(bug):
    subprocess.run([PY, "scripts/seed_bugs.py", "apply", bug], cwd=LAB, check=True, capture_output=True)
    try:
        out = pytest().stdout
    finally:
        subprocess.run([PY, "scripts/seed_bugs.py", "revert", bug], cwd=LAB, check=True, capture_output=True)
    return sorted({line.split()[1] for line in out.splitlines() if line.startswith(("FAILED", "ERROR"))})

def collect():
    os.makedirs(os.path.dirname(OUT), exist_ok=True)
    ids = test_ids()
    lines, total = per_test_lines()
    bugs = sorted(os.path.basename(p)[:-6] for p in glob.glob(os.path.join(LAB, "seeded", "*.patch")))
    caught = {b: failing(b) for b in bugs}
    json.dump({"tests": ids, "lines": lines, "total_statements": total, "caught_by": caught}, open(OUT, "w"))
    print(len(ids), "tests,", total, "statements,", len(bugs), "bugs")
    for b, fails in caught.items():
        print(f"{b:34s} caught by {len(fails)} test(s)")

def ranks(xs):
    order = sorted(range(len(xs)), key=lambda i: xs[i])
    r = [0.0] * len(xs)
    i = 0
    while i < len(order):
        j = i
        while j + 1 < len(order) and xs[order[j + 1]] == xs[order[i]]:
            j += 1
        for k in range(i, j + 1):
            r[order[k]] = (i + j) / 2 + 1
        i = j + 1
    return r

def pearson(a, b):
    n = len(a)
    ma, mb = sum(a) / n, sum(b) / n
    va = sum((x - ma) ** 2 for x in a)
    vb = sum((y - mb) ** 2 for y in b)
    if va == 0 or vb == 0:
        return float("nan")
    return sum((x - ma) * (y - mb) for x, y in zip(a, b)) / (va * vb) ** 0.5

def spearman(a, b):
    return pearson(ranks(a), ranks(b))

def analyse(per_size=40, seed=1):
    d = json.load(open(OUT))
    ids = d["tests"]
    lines = {k: {tuple(x) for x in v} for k, v in d["lines"].items()}
    caught = {b: set(f) for b, f in d["caught_by"].items()}
    rng = random.Random(seed)
    rows = []
    for k in (2, 4, 6, 8, 10, 14, 18, 22):
        if k > len(ids):
            continue
        for _ in range(per_size):
            pick = rng.sample(ids, k)
            cov_lines = set().union(*(lines.get(t, set()) for t in pick))
            hit = sum(1 for b in caught if caught[b] & set(pick))
            rows.append((k, 100 * len(cov_lines) / d["total_statements"], hit))
    size, cov, hit = zip(*rows)
    print(f"{len(rows)} random sub-suites from {len(ids)} tests, seed {seed}")
    print(f"all sizes mixed: Spearman(coverage, bugs caught) = {spearman(cov, hit):+.2f}"
          f"   Spearman(size, bugs caught) = {spearman(size, hit):+.2f}")
    print("size  mean cov%  mean bugs  Spearman(coverage, bugs) inside this size")
    within = []
    for k in sorted(set(size)):
        sub = [(c, h) for s, c, h in rows if s == k]
        r = spearman([c for c, _ in sub], [h for _, h in sub])
        within.append(r)
        print(f"{k:4d}  {sum(c for c, _ in sub) / len(sub):8.1f}  {sum(h for _, h in sub) / len(sub):9.2f}  {r:+.2f}")
    ok = [r for r in within if r == r]
    print(f"mean of the within-size correlations = {sum(ok) / len(ok):+.2f}")

if __name__ == "__main__":
    {"collect": collect, "analyse": analyse}[sys.argv[1] if len(sys.argv) > 1 else "analyse"]()

Read failing before you run it. It applies a patch, runs the pool, and always reverts. The ranks and pearson helpers exist because statistics.correlation needs Python 3.10, and the lab runs on 3.9. Spearman is the rank correlation: it asks whether higher coverage goes with more bugs caught, without assuming the link is a straight line.

3. Collect.

.venv/bin/python scripts/replicate_coverage.py collect

About fifteen seconds, then:

35 tests, 442 statements, 10 bugs
01-discount-boundary               caught by 1 test(s)
02-vat-rounds-down                 caught by 1 test(s)
03-promo-window-in-utc             caught by 1 test(s)
04-stock-released-twice            caught by 2 test(s)
05-idempotency-key-normalised      caught by 1 test(s)
06-timeout-is-decline              caught by 1 test(s)
07-search-leaks-drafts             caught by 1 test(s)
08-instalment-loses-a-kobo         caught by 1 test(s)
09-provider-500-is-200             caught by 2 test(s)
10-reserve-race                    caught by 1 test(s)

Eight of the ten bugs are caught by exactly one test. A random sub-suite catches such a bug only if it happens to contain that test. That alone makes bigger suites catch more.

4. Analyse.

.venv/bin/python scripts/replicate_coverage.py analyse
320 random sub-suites from 35 tests, seed 1
all sizes mixed: Spearman(coverage, bugs caught) = +0.83   Spearman(size, bugs caught) = +0.87
size  mean cov%  mean bugs  Spearman(coverage, bugs) inside this size
   2      16.3       1.00  +0.31
   4      25.5       1.38  +0.43
   6      30.8       1.73  +0.19
   8      33.3       2.75  +0.22
  10      37.0       3.35  +0.22
  14      43.0       4.47  +0.10
  18      45.7       5.42  +0.07
  22      48.3       7.00  +0.16
mean of the within-size correlations = +0.21

Pooled, coverage and bugs caught rise together at +0.83. Inside one size the link is weak: +0.07 to +0.43, mean +0.21. Most of the pooled link was size. This is the shape Inozemtseva and Holmes report, at a hundredth of the scale. The coverage figures are low because the denominator is every statement in checkout/, including the API and the search index, which the pool barely touches.

5. Check that the experiment left the lab clean, and that it is repeatable.

.venv/bin/python scripts/seed_bugs.py status | awk '{print $1}' | sort | uniq -c
.venv/bin/python scripts/replicate_coverage.py analyse | md5sum
.venv/bin/python scripts/replicate_coverage.py analyse | md5sum

10 clean, then the same checksum twice. The selection uses random.Random(1), so the same seed gives the same sub-suites. A different seed gives different sub-suites. With analyse(seed=2) called from a Python prompt in labs/testing, the pooled correlation stays at +0.83 and the mean within-size correlation moves to +0.13, so quote the within-size figure as roughly +0.1 to +0.2 and not to two decimals.

6. Write what the study cannot tell you. Create data/replication-notes.md and fill in each line, in your own words:

Sample: 10 bugs, 1 codebase of 442 statements, 35 tests, all written by the lab's author and by you.
Stand-in: seeded bugs written by the lab's author, not faults found in production.
Confounder I controlled: suite size (compared inside each size).
Confounder I did not: which test is in the sub-suite. 8 of 10 bugs have one detecting test.
Not shown: whether coverage matters in a larger system, or in suites unlike these tests.
Would change my mind: the same shape on a second codebase with real, fixed bugs.

No output. The notes are the deliverable. If a line is blank, you have not yet said what the experiment cannot claim.

7. Put the lab back, after the break below. Later chapters count files from the starter state. Keep data/replication-notes.md if you want it, then delete what the experiment added:

mv data/replication-notes.md ../replication-notes.md   # or delete it
rm -f scripts/replicate_coverage.py data/replication.json .coverage
.venv/bin/python scripts/seed_bugs.py status | awk '{print $1}' | sort | uniq -c
git status --short scripts data tests

10 clean, and git status prints nothing for those folders. data/ is the lab’s scratch folder and is ignored by git, so check that ls data shows only files from earlier chapters.

Make the pool thinner. Edit POOL in the script to ["tests/unit", "tests/integration", "tests/extras"], the starter tests only, and run collect and analyse again. On the shipped lab only two bugs (04 and 09) are caught, by one test each, and the numbers move: the pooled correlation falls to +0.76 and the mean within-size correlation rises to +0.43. Nothing about coverage changed. With two detectable bugs the detection count is mostly whether the sub-suite includes one of two tests, and those two tests happen to run a lot of code. A within-size correlation of +0.43 here would be a poor reason to say coverage predicts bugs. Put POOL back before you move on, and say in your notes what this does to the claim.

DECIDE

Willem's board wants one sentence on tests and defects. Anneke has the eight studies and her own replication: coverage and bugs caught rose together at +0.83 across sizes and +0.21 inside a size, on ten bugs in one codebase. Willem proposes an 85% coverage target for every team this half. She has until Friday. What does she recommend?

READING
  1. PAPER
    Coverage Is Not Strongly Correlated with Test Suite Effectiveness Laura Inozemtseva and Reid Holmes, 2014

    The study your lab replicates: 31,000 suites over five Java systems, with suite size controlled. Read the threats section to see what the authors say about mutants as the measure of effectiveness. The publisher blocks scripted fetches; Crossref confirms the record. Read: The abstract, the research questions and the threats to validity; skip the statistics methods.

  2. PAPER
    Are Mutants a Valid Substitute for Real Faults in Software Testing? René Just, Darioush Jalali, Laura Inozemtseva, Michael D. Ernst, Reid Holmes and Gordon Fraser, 2014

    Tests the stand-in used by the first paper: 357 real faults in five applications. Read it for the strength of the correlation, which the abstract does not give, and for the limits of mutation analysis. The publisher blocks scripted fetches; Crossref confirms the record. Read: The abstract, the research questions and the threats to validity; skip the per-project tables.

  3. PAPER
    A Dissection of the Test-Driven Development Process: Does It Really Matter to Test-First or to Test-Last? Davide Fucci, Hakan Erdogmus, Burak Turhan, Markku Oivo and Natalia Juristo, 2017

    82 data points from 39 professionals, and a result that the order of tests and code had no important influence. Read how the process characteristics were measured to see how far the regression can be pushed. Read: The abstract and the threats to validity; skip the model-fitting detail.

  4. PAPER
    Simple Testing Can Prevent Most Critical Failures Ding Yuan, Yu Luo, Xin Zhuang, Guilherme Renna Rodrigues, Xu Zhao, Yongle Zhang, Pranay U. Jain and Michael Stumm, 2014

    198 sampled failures in five distributed systems, and the clearest published case for testing error-handling code. The methodology section shows how the sample was drawn. Open access on the USENIX page. Read: Section 2 (methodology and limitations), Section 4 (catastrophic failures) and the finding on error handling; skip the Aspirator implementation.

  5. PAPER
    Expectations, Outcomes, and Challenges of Modern Code Review Alberto Bacchelli and Christian Bird, 2013

    What review at Microsoft was for, and how that differed from what developers expected. Read it before you measure review by defects found. The publisher blocks scripted fetches; Crossref confirms the record. Read: The abstract and the findings on motivations and outcomes; skip the survey instrument.

  6. PAPER
    On the Impact of Programming Languages on Code Quality: A Reproduction Study Emery D. Berger, Celeste Hollenbeck, Petr Maj, Olga Vitek and Jan Vitek, 2019

    A published, large-data correlation that mostly did not survive reanalysis. Read it as a worked example of what to ask of any mining study. Read: The abstract and the sections on the reanalysis of the original data; skip the statistical appendix on a first read.

  7. PAPER
    Comparing the Effectiveness of Software Testing Strategies Victor R. Basili and Richard W. Selby, 1987

    A controlled comparison of code reading, functional testing and structural testing with 74 participants and four small programs. Read it for the idea that techniques find different kinds of fault. The publisher blocks scripted fetches; Crossref confirms the record. Read: The abstract and the discussion of results by fault class; skip the experimental design tables.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Formal methods where they pay: TLA+, model checking and proofs →