Tomorrow I will be giving a talk on TDD at CMAP. The demo code and outline I will be using can be found on bitbucket here.
Here is the outline for the talk:
- I. Tools
- A. Framework
- B. Test Runner
- C. Brains
- II. Test Architecture
- A. Test Fixture
- B. Setup
- C. Test Method
- D. TearDown
- III. Process
- A. Red
- B. Green.
- C. Refactor.
- D. Rinse and Repeat.
- IV. Conventions
- A. At least one testfixture per class.
- B. At least one test method per public method.
- C. Test Method naming conventions
- i. MethodUnderTest_ConditionUnderTest_ExpectedResult
- D. Test Method section conventions
- i. Arrange
- ii. Act
- iii. Assert
- V. Other Issues
- A. Productivity Study
- B. Testing the UI
- i. Not technically possible without more tooling/infrastructure
- ii. MVC patterns increate unit-test coverage.
- iii. Legacy code.
- a. Presents special problems.
- b. Touching untested legacy code is dangerous.
- c. Boy-Scout rule.
- d. Use your own judgment
- C. Pros and Cons
- i. Pros
- a. Quality.
- b. Encourage a more loosely-coupled design.
- c. Document the work that is done.
- d. Regression testing.
- e. Increased confidence in working code means changes are easier to make.
- f. Encourages devs to think about code in terms of API instead of implementation.
- 1. Makes code more readable.
- 2. Readable code communicates intent more clearly.
- 3. Readable code reduces the need for additional non-code documentation.
- ii. Cons
- a. Takes longer to develop.
- b. Test code must be maintained as well.
- c. Requires that devs adapt to new ways of thinking about code.
- D. Notes
- i. You’re already doing it.
- ii. "The Art of Unit Testing" by Roy Osherove
- iii. "Clean Code" by Robert C. Martin
- iv. "Head First Design Patterns” by Elizabeth and Eric Freeman, Bert Bates, and Kathy Sierra
Posted on November 5, 2010, 7:12 pm By crmckenzie
No comments yet Categories: Code, Practices, Presentations, TDD Tags: Presentations, TDD