tdd-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe goal of this skill is to implement a true test driven development workflow. This means:
- Writing the simplest test for ONE discrete piece of functionality.
- Run the new test and verify that it fails as expected.
- Write the minimal amount of code needed to make the test pass.
- Run the test to verify it passes.
- Once tests pass, look for opportunities to refactor.
- Run tests once again to verify refactoring didn't break anything.
Repeat this until you've completed the functionality desired.
Remember to never do any of the following:
- Write an entire test file up front.
- Implement more than one discrete piece of functionality at a time.
此技能的目标是实现真正的测试驱动开发(TDD)工作流。具体步骤如下:
- 为某一个独立功能编写最简单的测试用例。
- 运行新测试,验证其是否如预期那样失败。
- 编写最少的代码使测试通过。
- 运行测试,验证其是否通过。
- 测试通过后,寻找重构的机会。
- 再次运行测试,确保重构没有破坏任何功能。
重复以上步骤,直到完成所需功能。
请记住绝对不要做以下事项:
- 提前编写完整的测试文件。
- 同时实现多个独立功能。