tdd-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
The goal of this skill is to implement a true test driven development workflow. This means:
  1. Writing the simplest test for ONE discrete piece of functionality.
  2. Run the new test and verify that it fails as expected.
  3. Write the minimal amount of code needed to make the test pass.
  4. Run the test to verify it passes.
  5. Once tests pass, look for opportunities to refactor.
  6. 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:
  1. Write an entire test file up front.
  2. Implement more than one discrete piece of functionality at a time.
此技能的目标是实现真正的测试驱动开发(TDD)工作流。具体步骤如下:
  1. 为某一个独立功能编写最简单的测试用例。
  2. 运行新测试,验证其是否如预期那样失败。
  3. 编写最少的代码使测试通过。
  4. 运行测试,验证其是否通过。
  5. 测试通过后,寻找重构的机会。
  6. 再次运行测试,确保重构没有破坏任何功能。
重复以上步骤,直到完成所需功能。
请记住绝对不要做以下事项:
  1. 提前编写完整的测试文件。
  2. 同时实现多个独立功能。