Changes for page TDD Workflow Example
Last modified by chrisby on 2023/12/08 07:51
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -4,7 +4,7 @@ 4 4 5 5 ### The Role of Git 6 6 7 -The goal of TDD is to take many small, simple, and safe steps iteratively. A save step, meaning all tests pass, should be physically saved to provide the ability to compare current changes tothelast safe step, or to rollback.Ifsomething goes wrong, the last safe step is not far away, andfindingtheroblemin a smallsnippet of changed codemakesdebuggingmucheasier.7 +The goal of TDD is to take many small, simple, and safe steps iteratively. A save step, meaning all tests pass, should be physically saved to provide the ability to roll back. Whenever something goes wrong, the last save step is not far away, and rolling back is cheap because only an insignificant amount of code and effort is thrown away. 8 8 9 9 * When a test passes, **stage the changes** via `git add .` 10 10 * When a test passes and is complete, **commit the staged changes** via `git commit -am "..."` ... ... @@ -17,7 +17,7 @@ 17 17 1. **Implement production code** until it passes all tests. Stage changes. 18 18 1. **Refactoring**: If code quality is sufficient proceed to step 4. Otherwise, refactor and run all tests. 19 19 * When all tests pass, stage the changes. Repeat step 3 until the code quality is satisfactory. 20 - * If one or more tests fail, fix the production code. 20 + * If one or more tests fail, fix the production code. If the problem can't be found quickly, rolling back to the last index and starting over may be an alternative. 21 21 1. **Test Completeness Check** 22 22 * If test is incomplete, implement test code until it fails and return to step 2. 23 23 * If test is complete, commit the staged changes and proceed to step 5.