中文译文
我有一个 bug:${bug}。采用测试优先的方法:1) 阅读相关源文件和现有测试。2) 编写一个能复现该确切 bug 的失败测试。3) 运行测试套件以确认它失败。4) 实现最小修复。5) 重新运行完整测试套件。6) 如果有任何测试失败,分析失败原因,调整代码,然后重新运行——重复此过程直到所有测试通过。7) 然后在代码库中搜索可能存在相同问题的相关代码路径,并为它们也添加测试。8) 总结所做的每一处更改及其原因。不要问我问题——做出合理的假设并记录下来。
English original
I have a bug: ${bug}. Take a test-first approach: 1) Read the relevant source files and existing tests. 2) Write a failing test that reproduces the exact bug. 3) Run the test suite to confirm it fails. 4) Implement the minimal fix. 5) Re-run the full test suite. 6) If any test fails, analyze the failure, adjust the code, and re-run—repeat until ALL tests pass. 7) Then grep the codebase for related code paths that might have the same issue and add tests for those too. 8) Summarize every change made and why. Do not ask me questions—make reasonable assumptions and document them.