跳到正文
DEV Community· CH·· 17 天前AI 評分64

Bite 檢查 AI 編碼工具聲稱已修復的問題是否有測試保障

Your AI says "fixed". Would a test notice if it wasn't?

AI 導讀

Bite 是一款免費工具,會逐一撤回程式碼中的近期修復並重跑測試,找出測試仍然通過、因而未能保障修復的項目。它在公開專案 prosemirror-py 找到一項提交曾表示已修復的記憶體洩漏,相關修復其後已合併;Bite 只在程式碼副本上運作,不會修改原始碼。

正文

Cover image for Your AI says "fixed". Would a test notice if it wasn't?

CH

When an AI coding tool says "Fixed, and I added a test", how do you know the test would catch the bug coming back?

Bite is a small free tool that checks. It takes each recent fix back out of your code and runs your tests. If they still pass, nothing guards that fix, and Bite names it. On real public projects, not a staged demo, it found a memory leak in prosemirror-py that a commit said it had fixed. The fix for it has since been merged there.

Try it, no key needed. It works on copies and never edits your code. With plain Python, two lines in any terminal:
python -m pip install bite-check
python -m bite_check --free
It shows a demo on a made-up project first, then tells you how to check your own (drag its folder into the window). Have pipx or uv? pipx run bite-check --free or uvx bite-check --free.

Doing MLH Hack Week (Nov 6-12)? Bite has good first issues: small Python fixes, each with "where to look" and "done when". They get picked up fast, so the label always shows what's still open. Comment on one to claim it.
https://github.com/connabyss/bite/labels/good%20first%20issue

So: which of your AI's "fixed" commits would you bet on? Run it and find out.

The Bite cat says hi.

來源:DEV Community · dev.to