360 Secure SkillHub
360 安全技能中心

Bugfix Without Test

该 Skill 是一份文字规范说明,指出“无测试修复缺陷”的问题征兆,并给出做法:先以失败测试复现缺陷、修复后确认测试通过、将测试留在套件中作回归保护,难以测试时需说明人工验证情况。

mvogt99
mvogt99
热度 42.39
最近更新 2026-05-11 17:45:50
分类:开发依赖:纯提示词应用场景:代码审查 / 调试排错

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add bugfix-without-test
Metadata
name
bugfix-without-test
description
A fix is applied without a reproduction test, leaving no proof the bug is fixed and no regression coverage.
emoji
🧪
metadata
{"clawdis":{"os":["macos","linux","windows"]}}

bugfix-without-test

Fixing a bug without a test means (a) you don't know the fix actually works, and (b) there's nothing to stop the bug from coming back next refactor. A fix without a regression test is provisional at best.

Symptoms

  • Diff contains code changes but no test changes.
  • Existing tests still pass, but none of them would have failed under the original bug.
  • PR description describes a bug scenario that no test exercises.
  • The fix is a one-liner and no one will remember why it exists six months later.

What to do

  • Reproduce the bug as a failing test first. Run it. Confirm it fails for the right reason.
  • Apply the fix. Run the test again. Confirm it passes.
  • Keep the test in the suite. It becomes the regression guard.
  • If the bug is hard to test (timing, environment, flaky), say so explicitly and describe what manual verification was done. Don't silently skip.
  • For bugs discovered in production, add the test at the lowest level that reproduces the issue — unit if possible, integration if not.