Let’s try something new to really TDD.
Do not touch source unless there is a failing test.
We have to be disciplined to make sure we’re only changing code related to the test.
Delete uncovered code immediately.
This helps with the step above and also removes junk once it’s been refactored out. This could/should be automated, but I haven’t done it yet.
Commit every time tests are green.
Obviously, these intermediate steps should be rebased before going to the remote, but this gives you another stepping stone every time you find solid ground.
Using ptw, we can include this as
ptw --onpass "git add .; git commit --no-verify -m 'green'" -- tests/ -vv --ff --exitfirst