{"slug": "my-fix-checker-found-two-missing-tests-then-it-wrote-them", "title": "My fix checker found two missing tests. Then it wrote them.", "summary": "A developer released Bite v0.7.0, a fix checker that adds a --write-tests option in which a fresh AI worker drafts a test for each code change no existing test would catch, then verifies the test by running it with and without the change and discarding it if it fails either way. In trials, Bite wrote passing tests for a missing Rich <kbd> style check and a chi XML compression check at a combined cost of $0.34, and it correctly threw out a first chi attempt after a Go test-runner error, a bug fixed in PR #67. Bite runs on the user's own Anthropic API key with a --budget cap and can open pull requests containing the generated tests via GitHub Actions.", "body_md": "In [my last post](https://dev.to/connabyss/rich-click-and-qs-passed-my-fix-checker-my-checker-didnt-12i2), [Bite](https://github.com/connabyss/bite) checked some well-known projects and found a few small gaps: changes that no test would notice if they broke. Two of them:\n\n`<kbd>Ctrl</kbd>` is drawn in bold yellow, and no test checks it.\nFinding a gap is the easy half. Someone still has to write the test. So this week Bite got a new option, `--write-tests`, that tries to write it.\n\nFor each change no test noticed, a fresh AI worker writes one small test on a copy of the project. Then Bite doesn't take its word for it. It runs the test itself:\n\nIf either part goes wrong, Bite throws the test away and says so. It uses your own Anthropic API key, and `--budget` caps what a run spends.\n\n| Gap | Bite's test | With the change | Without it | Cost | \n|---|---|---|---|---|\n| Rich `<kbd>` | prints `<kbd>Ctrl</kbd>` , checks Ctrl is bold yellow | passes, twice | fails: Ctrl not bold yellow | $0.14 | \n| chi XML | sends XML through chi's compressor, checks it comes back gzipped | passes, twice | fails: XML not gzipped | $0.10 | \n\nTotal: $0.34. That's more than the two rows add up to, because of the next part.\n\n**The first chi try got thrown away, and that was Bite's fault.** Go runs tests by folder, not by file, and Bite asked Go to run one file alongside the whole project. Go refused before running anything. Bite's rule caught it: a test that fails before it even runs doesn't count. So it threw the test out instead of showing a fake result. The fix is in [PR #67](https://github.com/connabyss/bite/pull/67), and the second try worked.\n\nBefore Bite could do this, Claude had already written a test for each gap the slow way, to confirm the gaps were real. So there was an answer key.\n\nHere's the Rich one, exactly as Bite wrote it:\n\n```\n# Guards that <kbd>…</kbd> in Markdown renders its text in the markdown.kbd style.\nfrom rich.console import Console\nfrom rich.markdown import Markdown\n\ndef test_kbd_inline_html_is_styled():\n    console = Console(\n        file=__import__(\"io\").StringIO(),\n        force_terminal=True,\n        color_system=\"truecolor\",\n        width=40,\n    )\n    console.print(Markdown(\"Press <kbd>Ctrl</kbd> now\"))\n    output = console.file.getvalue()\n    assert \"\\x1b[1;93mCtrl\\x1b[0m\" in output\n```\n\nOn my own copy of Rich, Bite ran as a GitHub Action on a pull request. It found the `<kbd>` gap, wrote the test, and opened a small pull request with the test in it. I merged that pull request, and Bite's check on the original pull request turned green. Gap found, test written, test merged, without anyone typing a test.\n\nIt's in [v0.7.0](https://pypi.org/project/bite-check/) (`pipx upgrade bite-check`). On your own computer: `bite --write-tests`. In GitHub Actions, the setup is in [Bite's README](https://github.com/connabyss/bite#have-bite-write-the-missing-test-opt-in-your-own-key). Since this trial, Bite also asks a second fresh check whether each test is fair before showing it.\n\n*Disclosure: I'm not a coder. Claude ran these trials, wrote Bite's code and helped me draft this post. The numbers come from the run logs.*", "url": "https://wpnews.pro/news/my-fix-checker-found-two-missing-tests-then-it-wrote-them", "canonical_source": "https://dev.to/connabyss/my-fix-checker-found-two-missing-tests-then-it-wrote-them-58pd", "published_at": "2026-11-01 03:01:28+00:00", "updated_at": "2026-11-01 03:23:11.021387+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Bite", "Rich", "chi", "Anthropic", "Claude", "GitHub Actions", "PyPI"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/my-fix-checker-found-two-missing-tests-then-it-wrote-them", "markdown": "https://wpnews.pro/news/my-fix-checker-found-two-missing-tests-then-it-wrote-them.md", "text": "https://wpnews.pro/news/my-fix-checker-found-two-missing-tests-then-it-wrote-them.txt", "jsonld": "https://wpnews.pro/news/my-fix-checker-found-two-missing-tests-then-it-wrote-them.jsonld"}}