Our test generator writes "FILL IN" instead of guessing

DetentShell · August 2026 · 2 min read

A test generator can see your function’s shape: the parameters, the output, the calls inside. It cannot see what the function is supposed to do. Correctness lives in your head. Most generators bridge that gap by inventing plausible assertions, which produces the worst artifact in software: a green test suite that verifies nothing.

DetentShell generates Pester tests, and the rule underneath the feature is that it never fakes knowledge. Run Tools, Generate Pester Tests with your caret in a function. If the file has several functions and the target is ambiguous, a picker asks. What comes back is a Pester v5 file split into two kinds of content.

Facts the generator can derive become assertions. The script file exists, the function is declared in it, the declared parameters are accepted. Structural truths, pulled from the syntax tree, asserted plainly.

Everything that requires knowing your intent becomes a skipped stub marked FILL IN, with a comment stating what value or behavior only you can supply. Skipped, in Pester’s own sense. Run the file untouched and the tally reads something like 4 passed, 0 failed, 6 pending. That’s the true state: structure verified, meaning awaiting a human. The banner above the generated tab shows the placeholder count, and its “Next placeholder” button jumps stub to stub so filling them is a short loop.

The generator applies the same honesty to itself. One of its checks verifies the source file carries a change-log header, but only when your file already uses that convention. If it doesn’t, the check generates as a skipped stub with a note that it won’t assert a convention the source never claimed.

The banner also shows a testability score. A function that’s mostly derivable structure scores well. A function that’s all side effects scores lower, and that low score is usually telling you about the function, not the generator.

So yes, generated tests arrive with homework attached. The generator did the scaffolding, the structural checks, the Pester idioms, and the parameter cases, then handed you a marked-up worksheet for the part only you can answer. A pending test is an honest question. The alternative was a fabricated pass, and we weren’t going to ship a feature whose main output is false confidence.

← All posts