Difference between revisions of "Different Styles of TDD"
From CitconWiki
Jump to navigationJump to search (Added some of the stuff we talked about during the session.) |
|||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
Uncle Bob's rules of TDD: http://blog.jeffreyfredrick.com/2008/06/27/blog-recursion/ | Uncle Bob's rules of TDD: http://blog.jeffreyfredrick.com/2008/06/27/blog-recursion/ | ||
Michael Feather's rules of unit tests: http://www.artima.com/weblogs/viewpost.jsp?thread=126923 | Michael Feather's rules of unit tests: http://www.artima.com/weblogs/viewpost.jsp?thread=126923 | ||
| + | |||
| + | BY SPEED | ||
| + | |||
| + | 1. Quick Test (in CI: 100 tests/sec) | ||
| + | 2. Slow Test | ||
| + | |||
| + | BY TEST DOUBLE | ||
| + | |||
| + | 1. Stub | ||
| + | 2. Mocks | ||
| + | steve freeman - paper/newsletter - mock is not for testing, but interface discovery | ||
| + | i.e always write adapter to talk to 3rd party library | ||
| + | 3. Object Mother | ||
Types of Test Doubles: http://xunitpatterns.com/Test%20Double.html | Types of Test Doubles: http://xunitpatterns.com/Test%20Double.html | ||
| + | |||
| + | BY LEVELS | ||
| + | |||
| + | 1. Atomic - test double | ||
| + | 2. Molecular - a few classes together | ||
| + | 3. Integration | ||
| + | 4. Functional / Acceptance | ||
| + | |||
| + | BY ASSERTION TYPE | ||
| + | |||
| + | 1. example | ||
| + | 2. theory | ||
Randomized test data/Theories: http://xunitpatterns.com/Test%20Double.html | Randomized test data/Theories: http://xunitpatterns.com/Test%20Double.html | ||
| + | |||
| + | DEV: does the work code as dev expect | ||
| + | QA/TESTER: does the app work as client expect | ||
Latest revision as of 21:25, 29 June 2008
Uncle Bob's rules of TDD: http://blog.jeffreyfredrick.com/2008/06/27/blog-recursion/
Michael Feather's rules of unit tests: http://www.artima.com/weblogs/viewpost.jsp?thread=126923
BY SPEED
1. Quick Test (in CI: 100 tests/sec) 2. Slow Test
BY TEST DOUBLE
1. Stub
2. Mocks
steve freeman - paper/newsletter - mock is not for testing, but interface discovery
i.e always write adapter to talk to 3rd party library
3. Object Mother
Types of Test Doubles: http://xunitpatterns.com/Test%20Double.html
BY LEVELS
1. Atomic - test double 2. Molecular - a few classes together 3. Integration 4. Functional / Acceptance
BY ASSERTION TYPE
1. example 2. theory
Randomized test data/Theories: http://xunitpatterns.com/Test%20Double.html
DEV: does the work code as dev expect QA/TESTER: does the app work as client expect