Appendix H. Cheat Sheet
By popular demand, this “cheat sheet” is loosely based on the little recap/summary boxes from the end of each chapter. The idea is to provide a few reminders, and links to the chapters where you can find out more to jog your memory. I hope you find it useful!
Initial Project Setup
-
Start with a User Story and map it to a first functional test.
-
Pick a test framework—
unittestis fine, and options likepy.test,nose, orGreencan also offer some advantages. -
Run the functional test and see your first expected failure.
-
Pick a web framework such as Django, and find out how to run unit tests against it.
-
Create your first unit test to address the current FT failure, and see it fail.
-
Do your first commit to a VCS like Git.
The Basic TDD Workflow
-
Double-loop TDD (Figure H-1)
-
Red, Green, Refactor
-
Triangulation
-
The scratchpad
-
“3 Strikes and Refactor”
-
“Working State to Working State”
-
“YAGNI”
Figure H-1. The TDD process with functional and unit tests
Moving Beyond Dev-Only Testing
-
Start system testing early. Ensure your components work together: web server, static content, database.
-
Build a staging environment to match your production environment, and run your FT suite against it.
-
Automate your staging and production environments: ...