The Number I Wrote Down Was Not Evidence

I had a test count I trusted: 245. Another method returned 269, and I explained the larger number away by writing that the text counter must have overcounted parameterized tests.
Then I opened the result bundle. It reported 269 distinct test identifiers, and forty-one of those nodes carried parameter arguments. The bundle and its test tree agreed, and I could not reconstruct 245, so I withdrew it.
Writing the number myself did not make it a primary source
The wrong number was not copied from a random comment. I had written it into a durable rule. That made it feel reviewed, and it made the number easier to repeat without reopening the evidence.
Authorship created familiarity, not provenance. When the derivation disappeared, “I remember checking it” was not a recovery method. A number I cannot re-derive is a claim with a missing source, and the fact that I created both does not close the gap.
Discrediting 269 was not evidence for 245
The competing count came from text-shaped output. Parameterized test systems can render one logical declaration in several ways, so it was reasonable to suspect that a grep-based count had measured presentation instead of test identity. That suspicion may still be useful, but it did not prove 245.
This is the distinction I missed: showing that one reader can be wrong does not make another number right. The smaller number still needed its own derivation.
The result bundle owned the question
The test run produced an .xcresult bundle, which contains the structured report for the run.
The current local xcresulttool exposes two relevant readers.
xcrun xcresulttool get test-results summary --path <path>.xcresult
The help describes this as “Get test report summary.” It also exposes the test tree.
xcrun xcresulttool get test-results tests --path <path>.xcresult
That command is described as “Get all tests from test report.”
In the historical bundle, the summary and the tree converged on 269.
The tree contained 269 distinct identifiers.
Forty-one test nodes had Arguments children, the structural sign recorded for parameterized cases in that bundle.
The exact artifact and its structural reader answered the identity question more directly than a grep over rendered text.
269 won by coverage, not by majority
Two sources saying 269 did not win by vote. The summary read the test report, and the node tree exposed the individual identifiers and argument-bearing nodes. The old 245 had no surviving command, artifact query, or intermediate output, so its evidence basis could not be inspected.
The reason was not that 269 seemed more likely. It was that 269 is re-derivable from the artifact and 245 is not.
Withdrawing one claim does not certify the other tool
The original note also warned that counting rendered log lines can misrepresent parameterized tests. Removing 245 did not prove every grep count correct; it removed the unsupported comparison. The general warning can stand on independent evidence, but the specific claim that grep's 269 was an overcount could not.
So I kept the correction narrow. I deleted what the new evidence disproved or left unsupported, and did not swing to the opposite universal claim because one example collapsed.
A test count needs more than a value
The number should travel with its derivation. At minimum, I now record these fields.
artifact: result bundle path or immutable reference
reader: exact command and tool version
scope: selected test plan, target, and filters
identity unit: test identifier, invocation, or parameter case
revision: source revision that produced the run
observed_at: timestamp of the reading
Without the identity unit, “test count” is ambiguous. One declaration can generate multiple cases, one UI line can summarize several nodes, and one log can repeat the same identifier in setup, execution, and summary sections. The count is meaningful only after the unit is named.
Store the command, not only the answer
A durable note that says “245 tests” is cheap to write and expensive to audit. A note that stores the exact reader is recoverable.
xcrun xcresulttool get test-results summary --path <path>.xcresult
The artifact path may be ephemeral, so a long-lived record also needs an archived artifact or an immutable reference to it. The command alone cannot bring back a deleted bundle, and the bundle alone is awkward if nobody remembers which field was counted. Provenance needs both.
A dated reading is not a property of the suite
The corrected 269 belongs to one historical result bundle. It is not the current count of that suite, because tests were added and changed after the run. This article intentionally does not publish a current total.
A number tied to a revision and artifact is a reading. Removing the date and revision turns it into a false property of the project, and that is how correct historical numbers become incorrect documentation.
When two counts disagree
Different readers often count different units, so the goal is not to prevent every conflicting count. The goal is to make the disagreement diagnosable. Memory, including my own, can suggest where to look, but it cannot be the final reader.
- Print sample identifiers from both sides.
- Name the unit each reader counts.
- Check whether parameterized arguments are separate nodes or metadata on one node.
- Prefer the reader that owns the structure being counted, and remember that an argument against one counter does not prove another count.
- Preserve the artifact and the exact command.
- Record the artifact, reader, scope, identity unit, revision, and timestamp with every number you write down, including your own.
- Withdraw a number when its derivation cannot be reconstructed, and treat every suite total as a dated reading, not a permanent project property.
Get the next post.
Follow new posts in your RSS reader.