2026-11-26 15:47 UTC

Andrew Lamb proposes readable transcript tests for reviewing AI-generated code

state: seedheat: lowuncertainty: mediumrelevance: mediumcoding-agent-verification software-testing code-reviewAndrew A. LambApache DataFusion

What is this?

Andrew A. Lamb’s November 13, 2026 post proposes β€œTranscript Testing,” a way to make tests show a readable account of system behaviorβ€”such as which parts of a Parquet file a query readsβ€”and compare it with expected output. Lamb describes implementing the approach with a collaborator in an Apache DataFusion pull request, adapting familiar snapshot or β€œgolden output” testing patterns. He argues that AI coding tools can produce tests that are comprehensive but difficult for reviewers to understand. The evidence is Lamb’s own account and a Hacker News listing, not an independent evaluation of the method’s effectiveness or adoption.

Why it matters

As AI tools generate more code and tests, passing tests may offer limited assurance if reviewers cannot tell what behavior they encode. Readable behavioral transcripts could make changes easier for humans to inspect and challenge, though they do not by themselves establish that the expected behavior is correct. The notable shift is an author’s argument that AI may lower the cost of creating this more reviewable form of testingβ€”not a new testing technique proven at scale.

Current assessment

New: Lamb reports that he and a collaborator implemented transcript-style tests in an Apache DataFusion PR, using readable snapshots of file I/O to make a behavior change easier to inspect than indirect counter assertions. He says this approach helped illustrate which Bloom filters were read or skipped, and argues that AI makes it easier to generate transcript tests even when producing their transcript machinery takes more code. Context: he acknowledges that transcript, snapshot, expect, and golden-output tests have precedents; the proposed change is broader use, especially for human verification of AI-assisted code. His claim that AI-generated tests can be hard to understand, and that transcripts help, is practitioner experience and argument, not comparative research. The supplied sources provide no independent validation, adoption data, or evidence that readable snapshots prevent incorrect expectations or flawed implementations. Potential implication: teams may gain a more legible review artifact as code production scales, but human judgment about whether the recorded behavior is desirable remains necessary.

Measured heat

now 0 pts/hpeak 1 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 338h
points/hour across evidence Β· reading as of 2026-11-27 02:23:58.509736+11:00 Β· deterministic, not a model opinion

How the heat travelled

11-12 13:00⭐ origin echo-reconstructedThe post describes transcript tests that turn behavior such as file I/O into readable snapshots, arguing these can help humans verify change
Andrew A. Lamb on blog (echo) Β· attributed from hn.story.50485731
β€”
11-13 16:20first on hacker news Β· published Β· +27.3hTranscript Testing: Helping Humans Verify AI Code
qianli_cs
β€”
11-13 16:20amplified on hacker news πŸ‘‘hn.story.50485731
qianli_cs
peak 2 Β· 0 comments Β· 103% of case engagement
11-13 17:21our radar first saw it Β· +28.4hdiscovery anchor: hn.story.50485731β€”
pace: p11 vs 1845 stories at the 336h mark (now 338h old) β€” behind adobe-max-ai-agents-creative-tools-mcp (0.5x)

Evidence (2) β€” ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnTranscript Testing: Helping Humans Verify AI Code
Retrieved article excerpt

Open article Β· Retrieved 2026-11-13T17:22:28.566593+00:00

Software tests in the AI era should be explicitly written for humans to read, to
help us verify and understand the systems we are building. This is even more
important as AI tools mean we write less code in programming languages.
This post proposes β€œTranscript Testing” to help.

## Introduction

There is much speculation about the future role of humans in implementing and maintaining
software systems, but at least in the short term, the consensus is that humans
need to verify AI output. Traditionally, a substantial part of software
engineering was the creation and maintenance of software tests, both to prevent
regressions and to precisely document expected system behavior.

Reviewing human-created PRs included ensuring adequate test coverage (often
there was not). I haven’t seen any PR with inadequate tests in the last 6 months
(thanks to AI coding tools). Instead, I now have the opposite problem: PRs include
many hundreds of lines of hard-to-understand tests. In fact, these tests are so
hard to read and understand that I suspect they are often skimmed, if not
outright skipped, during human review (I admit to doing this occasionally).

If we don’t understand (or can’t summon the mental energy to read) the tests our
agents write, how can we verify the system we are responsible for πŸ€”?

## Tests no one reads

Here is a single typical AI-generated test, from the [initial commit](https://github.com/apache/datafusion/pull/25811/commits/9b4700c9932771c017e6f72893d170e7ddff2c82) of a
[recent PR](https://github.com/apache/datafusion/pull/25811) to [Apache DataFusion](https://datafusion.apache.org/) optimizing how the Parquet reader reads
Bloom filters (don’t worry if you don’t know what that means).[1](https://andrew.nerdnetworks.org/blog/2026/11/13/transcript-testing/#fn:1) The PR
included four test functions (~400 total lines) that covered
combinations of row group contents, writer settings, and predicates.


Click to see the test code (117 lines)

```
#[tokio::test]
async fn incremental_bloom_filter_pruning_short_circuits_remaining_columns() {
    let store = Arc::new(InMemory::new()) as Arc<dyn ObjectStore>;
    // Two row groups, each with columns a and b:
    //   RG-0: a = [99, 98, 97],  b = [900, 980, 970]  β€” no predicate values present
    //   RG-1: a = [10, 20, 30],  b = [100, 200, 300]  β€” contains predicate match
    //
    // Statistics pruning is disabled throughout; Bloom filters are the only pruning
    // mechanism.  Decoder-level filter push-down is enabled so matching rows are
    // physically filtered out of RG-1 where possible.
    let batch_rg0 = record_batch!(
        ("a", Int32, vec![99_i32, 98, 97]),
        ("b", Int32, vec![900_i32, 980, 970])
    )
    .unwrap();
    let batch_rg1 = record_batch!(
        ("a", Int32, vec![10_i32, 20, 30]),
        ("b", Int32, vec![100_i32, 200, 300])
    )
    .unwrap();
    let schema = batch_rg0.schema();
    let props = WriterProperties::builder()
        // Force each batch into its own row group.
        .set_max_row_group_row_count(Some(3))
        .set_bloom_filter_enabled(true)
        .set_statistics_enabled(EnabledStatistics::None)
        .build();
    let data_size = write_parquet_batches(
        Arc::clone(&store),
        "multi_col_bloom.parquet",
        vec![batch_rg0, batch_rg1],
        Some(props),
    )
    .await;
    let file =
        PartitionedFile::new("multi_col_bloom.parquet".to_string(), data_size as u64);

    // ── Query 1: a = 999 AND b = 100 ─────────────────────────────────────────────
    // 'a' Bloom filter is checked first for each row group.  999 is absent from
    // both, so both groups are pruned after reading only the 'a' filter β€” the 'b'
    // filter is never fetched (short-circuit).
    let pred1 =
        logical2physical(&col("a").eq(lit(999)).and(col("b").eq(lit(100))), &schema);
    let metrics1 = ExecutionPlanMetricsSet::new();
    let morselizer1 = ParquetMorselizerBuilder::new()
        .with_store(Arc::clone(&store))
        .with_schema(Arc::clone(&schema))
        .with_predicate(Arc::clone(&pred1))
        .with_pushdown_filters(true)
        .with_row_group_stats_pruning(false)
        .with_enable_bloom_filter(true)
        .with_metrics(metrics1.clone())
        .build();
    let stream1 = open_file(&morselizer1, file.clone()).await.unwrap();
    let bytes_scanned1 = counter_metric_value(&metrics1, "bytes_scanned");
    assert_eq!(collect_int32_values(stream1).await, Vec::<i32>::new());
    let (pruned1, matched1) = bloom_filter_pruning_metrics(&metrics1);
    // Both row groups pruned; no row group survived Bloom evaluation.
    assert_eq!(pruned1, 2);
    assert_eq!(matched1, 0);

    // ── Query 2: a = 10 AND b = 999 ──────────────────────────────────────────────
    // RG-0: 'a' filter doesn't contain 10 β†’ pruned immediately (no 'b' read).
    // RG-1: 'a' filter contains 10 β†’ must read 'b'; 'b' filter doesn't contain 999
    //        β†’ pruned on the second column.
    let pred2 =
        logical2physical(&col("a").eq(lit(10)).and(col("b").eq(lit(999))), &schema);
    let metrics2 = ExecutionPlanMetricsSet::new();
    let morselizer2 = ParquetMorselizerBuilder::new()
        .with_store(Arc::clone(&store))
        .with_schema(Arc::clone(&schema))
        .with_predicate(Arc::clone(&pred2))
        .with_pushdown_filters(true)
        .with_row_group_stats_pruning(false)
        .with_enable_bloom_filter(true)
        .with_metrics(metrics2.clone())
        .build();
    let stream2 = open_file(&morselizer2, file.clone()).await.unwrap();
    let bytes_scanned2 = counter_metric_value(&metrics2, "bytes_scanned");
    assert_eq!(collect_int32_values(stream2).await, Vec::<i32>::new());
    let (pruned2, matched2) = bloom_filter_pruning_metrics(&metrics2);
    assert_eq!(pruned2, 2);
    assert_eq!(matched2, 0);

    // Query 2 must read both 'a' and 'b' filters for RG-1, so it scans strictly
    // more Bloom filter bytes than Query 1 (which short-circuits on 'a' alone).
    assert!(bytes_scanned1 > 0, "expected non-zero bloom filter I/O");
    assert!(
        bytes_scanned2 > bytes_scanned1,
        "query 2 should scan more bloom filter bytes due to loading 'b' filter for RG-1"
    );

    // ── Query 3: a = 10 (one row group pruned, one matched) ───────────────────────
    // RG-0: 'a' filter doesn't contain 10 β†’ pruned.
    // RG-1: 'a' filter contains 10 β†’ matched (not pruned); the actual matching
    //        rows [10, 20, 30] are returned through decoder-level filtering.
    let pred3 = logical2physical(&col("a").eq(lit(10)), &schema);
    let metrics3 = ExecutionPlanMetricsSet::new();
    let morselizer3 = ParquetMorselizerBuilder::new()
        .with_store(Arc::clone(&store))
        .with_schema(Arc::clone(&schema))
        .with_predicate(Arc::clone(&pred3))
        .with_pushdown_filters(true)
        .with_row_group_stats_pruning(false)
        .with_enable_bloom_filter(true)
        .with_metrics(metrics3.clone())
        .build();
    let stream3 = open_file(&morselizer3, file.clone()).await.unwrap();
    // The matching row (a=10) must be returned; decoder filtering removes a=20,30.
    assert_eq!(collect_int32_values(stream3).await, vec![10_i32]);
    let (pruned3, matched3) = bloom_filter_pruning_metrics(&metrics3);
    assert_eq!(pruned3, 1, "RG-0 should be pruned by Bloom filter");
    assert_eq!(
        matched3, 1,
        "RG-1 passed Bloom evaluation and must count as matched"
    );
}
```

By human-written PR standards, the tests were excellent. They fully covered the new
functionality and followed a classic
[Arrange Act Assert](https://xp123.com/3a-arrange-act-assert/) pattern. My own agent double-checked the tests and gave them
a βœ….

However, to truly verify the PR I needed to understand **what is the I/O
before and after this change?** Despite the comprehensive
test coverage, this was extremely mentally taxing, as I had to wade through
400 lines of code, mostly setup unrelated to the change, and mentally
translate asserts on low-level pruning counters into effects on I/O.

## Transcript Tests: designed for humans to understand

To help understand the change and thus verify the PR, [mohitgurav20](https://github.com/mohitgurav20) and I implemented
what I call **Transcript Tests** in [this PR](https://github.com/apache/datafusion/pull/26897). As the name
implies, a Transcript Test creates a human-readable *transcript* (a string) of the
system’s behavior. The actual test then asserts that the transcript
matches an expected transcript (we used the amazing [insta](https://insta.rs/) library to compare
inline).

In this case, since I wanted to verify the I/O behavior, the test
records human-readable descriptions of I/O rather than indirect signals
such as counter values. For example, instead of (just) the requested byte range, it records
the corresponding part of the Parquet file:

```
--- Query: SELECT * FROM t WHERE val = 7 (1 rows) ---
Request 1
    Read Parquet footer (offsets 0..1402)
Request 2
    Read dictionary page and data page 0 for column 'val' (rg 0) (offsets 51..98)
Request 3
    Read dictionary page and data page 0 for column 'val' (rg 1) (offsets 145..192)
Request 4
    Read dictionary page for column 'id' (rg 1) (offsets 98..124)
    Read data page 0 for column 'id' (rg 1) (offsets 124..145)
Produce batch (1 rows)
Request 5
    Read dictionary page and data page 0 for column 'val' (rg 2) (offsets 239..286)
```

You don’t have to understand the details of reading Parquet files or the
existing code to understand this transcript. It is like a story: β€œThe scan reads the
filter column for row group 0, finds nothing, reads it for row group 1, finds a
match, etc.” It is much easier to understand than the equivalent asserts:

```
assert_eq!(pruned3, 1, "RG-0 should be pruned by Bloom filter");
assert_eq!(matched3, 1, "RG-1 passed Bloom evaluation and must count as matched");
```

We then [updated the PR](https://github.com/apache/datafusion/pull/25811/commits/9273c08933077862ed9d6367c55f539c29afb58c), and the transcript differences illustrate
exactly the part of the behavior that changed:

```
 /// Column `a` does not match, so the row group is pruned.
 #[tokio::test]
 async fn test_parquet_bloom_filter_io_pruned() {
     let test = bloom_filter_test().await;
-    // Currently the Bloom filters for all candidate columns (`a` and `b`) are
-    // loaded upfront. With incremental pruning
-    // (https://github.com/apache/datafusion/issues/25811), `a` would be
-    // evaluated first and the Bloom filter for `b` would not be loaded.
+    // Column `a` does not match, so the row group is pruned immediately
+    // and the Bloom filter for column `b` is not loaded.
     assert_snapshot!(test.query("SELECT * FROM t WHERE a = 999 AND b = 100").await, @r"
     --- Query: SELECT * FROM t WHERE a = 999 AND b = 100 (0 rows) ---
     Request 1
         Head (object size and metadata)
     Request 2
         Read Parquet footer (offsets 213..678)
     Request 3
         Read OffsetIndex for columns 'a', 'b' (rg 0) (offsets 192..213)
     Request 4
         Read Bloom filter for column 'a' (rg 0) (offsets 98..145)
-    Request 5
-        Read Bloom filter for column 'b' (rg 0) (offsets 145..192)
     ");
 }
```

Note that this testing style may actually require *more* total lines, as the code to
generate the transcript is non-trivial. However, an agent wrote it super
quickly, and the resulting test output is far more readable and understandable.

## Conclusion

I strongly believe (hope?) that humans will continue to design and maintain
software systems. I think the most likely future is one of programming at a
higher level of abstraction (e.g. natural language rather than classical
programming languages). As this transition happens, we must also increase the
level of abstraction used for verification (aka tests) to keep up. I think
Transcript Tests can help with this transition.

## Appendix: Is this approach really new?

No. I first
qianli_cs20
🟧 echo.blog ⭐The post describes transcript tests that turn behavior such as file I/O into readable snapshots, arguing these can help humans verify changeAndrew A. Lambβ€”β€”

Interpretation history

Decision trace