cd /news/ai-tools/the-test-that-passed-without-testing… · home › topics › ai-tools › article
[ARTICLE · art-175680] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

The Test That Passed Without Testing the Requirement

A developer rebuilding a personal site on Astro with GitHub Copilot CLI discovered that one of their automated checks, part of a verifier reporting over 2,000 passing assertions, validated hreflang links rather than the visible language switcher visitors click. An AI-assisted code audit showed the test could pass even when the switcher's href pointed to the German homepage instead of the translated article; the developer fixed the verifier to compare the switcher's href against an expected path defined outside the generated HTML.

recommendation

When writing automated checks for generated pages, assert the visible element's href against an independently defined expected path, not just that the link or its destination exists.

more in playbook: Verifying model output
by read6 min views4 publishedNov 24, 2026

An AI-assisted code audit found that my language-switcher test could pass without checking the destination visitors would actually use.

While modernizing my personal website, yonka.dev, I used GitHub Copilot CLI to assist with implementation, code review, and automated verification. I replaced an ASP.NET-based site with Astro, which generates static HTML during a production build.

This was a personal website, not a large production system. I chose it as a manageable place to experiment with AI-assisted engineering. I had taken a course on GitHub Copilot CLI, which helped me learn the tool, but it didn't give me a complete workflow for deciding what to delegate, what to review, or what evidence to trust. Those questions became concrete once I started building.

I didn't begin with an established workflow. I let Copilot analyze the project and propose approaches, then examined the results and learned from the gaps I found. Even on a small website, this gave me problems to work through that a course alone hadn't prepared me for.

One requirement was simple: the site supports English and German, and switching languages should open the equivalent page when a translation exists. My automated verification reports eventually showed more than 2,000 passing assertions. Then a separate AI-assisted code audit found that one check could pass without confirming where the visible language switcher actually led.

The audit did not uncover a broken link on the live site. It uncovered a test that wasn't checking the requirement I thought it was.

A successful Astro build means the site was generated, not that every page behaves as intended. To examine the output, I had used Copilot to help create scripts/verify-dist.mjs, a JavaScript verifier that reads the generated HTML in dist/. In other words, the checks examined the built pages, not merely the source templates. The problem wasn't a discrepancy introduced by Astro during the build; it was what the verifier chose to inspect.

The existing check examined links with a hreflang attribute. These links describe alternative language versions of a page for search engines. That's useful metadata to verify, but it is separate from the language switcher visitors click.

The visible switcher was identified by the CSS class .language-link. Its lang attribute described the language of the link text, while its href determined the destination. To test the navigation requirement, the verifier needed to compare that href against the expected destination for the current page. It didn't.

Consider a visitor reading an English article with a German translation. These two links look nearly identical:

Expected destination:

<a class="language-link"
   lang="de"
   href="https://dev.to/de/writing/example-article/">
  Deutsch
</a>

Wrong destination:

<a class="language-link"
   lang="de"
   href="https://dev.to/de/">
  Deutsch
</a>

Both URLs can point to existing pages. But only the first takes the reader to the translated article; the second sends them to the German homepage. Because the original check inspected different language-related links, it could pass in either case. Checking that a link exists, or even that its destination exists, would not establish that it leads to the right page.

After examining the finding, I used Copilot CLI to update the verifier. The corrected check reads the visible switcher's href and compares it with an expected path defined separately from the generated HTML:

const destination = attr(switcher ?? "", "href");

if (destination !== expectedPath)
  fail(
    page,
    `language switcher points to ${destination ?? "nothing"}, expected ${expectedPath}`
  );

Simplified excerpt from the updated verification script.

The full correction also checks the switcher's lang attribute and handles articles without a German translation. For those pages, the site has an intentional fallback destination. The expected result therefore depends on the route; it cannot be derived simply by assuming every article has a translated counterpart.

Defining those expectations independently is important. If a test gets its expected destination from the same generated link it is validating, it can confirm that the implementation agrees with itself without confirming that it meets the requirement.

The revised verification passed against the normal build. But a passing result alone was exactly what had misled me before. I wanted evidence that the new assertion would reject the specific error the old one had missed.

I asked the agent to run a controlled negative test: take a correctly generated article switcher and replace its destination with the German homepage in a temporary, in-memory copy of the HTML. No source file or deployed page was changed.

When the agent ran the corrected logic against that modified HTML, the assertion failed as expected. It rejected the homepage destination even though the URL itself was valid.

![Diagram showing a correct language-switcher destination, an intentionally incorrect destination, and the verification rejecting the incorrect one.]

The controlled incorrect destination was rejected by the updated check.

This confirmed that the updated check could detect the specific error we introduced. It didn't establish that every possible language-switching scenario was covered.

More than 2,000 passing assertions may sound excessive for a personal website, but many were repeated checks across generated pages. I don't think the count itself tells me much about the quality of verification anymore. In this case, one missing comparison mattered more than all the passing results around it.

I had relied heavily on AI to write and run the checks. A separate AI-assisted audit caught the omission, and the agent also ran the negative test that confirmed the correction. Both were useful, but neither replaced my responsibility to understand what the tests actually proved. I had reviewed the results without looking closely enough at this particular assertion.

What I'm beginning to question is not only an individual test, but how I organize verification work. I had accumulated checks for the site as a whole. For future changes, I want to try a more gradual approach: agree on the expected behavior for a small piece of work, check that behavior before moving on, and use the broader suite to catch regressions. A common verifier can still be part of that approach; it just shouldn't be the only place where I discover whether a requirement was understood correctly.

For this project, the concrete result was modest but useful: the verifier now distinguishes a translated article destination from an existing but incorrect homepage destination. The broader lesson I'm taking into future projects is to treat passing tests as evidence to examine, not as proof that the requirement was tested.

This experience also changed how I think about using GitHub Copilot CLI. I had focused on what I could delegate and automate. I'm now beginning to pay more attention to how I define the work, review the evidence, and decide when a result is good enough to accept.

── more in #ai-tools 4 stories · sorted by recency
── more on @github copilot cli 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-test-that-passed…] indexed:0 read:6min 2026-11-24 · —