January 2010 Monthly Meeting Summary
Test Driving to Clean Code
We'll see how to keep code working and clean, by letting tests drive coding
progress. By expressing what the code should do in a test, we'll see how
the techniques of Test Driven Development and refactoring leads to simple, well tested designs.
Through some live coding demos, we'll leverage JUnit 4 and the power of the built
in refactoring capabilities of Eclipse, to arrive at a simple design, more
readable code, and gain the confidence to refactor the code at any time.
Presenter Bio: Kenrick Chien
is the CTO of Critical Phase, Inc. a software development consulting
company based in Northern VA. He has been developing software professionally
since 2000, and is passionate about writing clean, testable code through TDD
and pair programming. He recently participated in the "Programming with the
Stars" competition at Agile 2009, where he and James Grenning performed TDD,
refactoring, SDD, etc. in front of a live audience and came in second place.
Took place on: Wed. January 13 2010 6:30 PM
Kenrick Chien provided a live coding demo of developing code for a bowling scoring applicatiom, which
provided insights into the thought processes and approach for test driven development, using Java and
JUnit 4 in Eclipse with a plugin called Infinitest. The demonstration showed coding from the
perspective of first thinking about expected beaviors/scenarios and expected results for each
behavior, writing tests/assertions, and then the functional code. Also included in the demo
was refactoring of code - including test code - and periodically extracting common code.
Other meeting notes:
- Good code has 'low WTF's per minute'
- The TDD cycle can be described as Red, Green, Refactor
- Changing from the old approach to a TDD approach was hard
- Fast feedback during development is of great value
- TDD developers/teams use a variety of checkin practices
- The TDD goal is not to test all paths but to test intended behavior, which has implications for
project QA and testing personnel/teams
- Some possible limitations to consider for TDD that were mentioned included: some feel that
UI development is not as amenable to TDD; if the entire team is not doing TDD it can limit
its effectiveness significantly
- Kenrick's powerpoint presentation (5 MB)
NoVaTAIG Home Page
Copyright 2009 Northern Virginia Test Automation Interest Group
Test Automation Interest Group