Fit Lesson 214 Sep 2006
Following on from Fit Lesson 1.
Organise the Fit Tests around your iteration's stories
I like to take small baby steps when I write software. It makes life easy. I don't have to merge very much code, I get regular closure on what I'm doing, I don't have to carry too much around in my head, and I can discard mistakes without loosing too much work.
Automated acceptance tests, such as Fit, can throw a throw a spanner in the works.
I like to explore the problem by writing the Fit test with a domain expert before I start writing any code. I treat the acceptance test(s) as a definition of success. Before I start work on a new feature, I need to understand how I will know when the Customer is happy with what I have done. I flesh out the answer in the fit test (I often have several Fit tests exploring different aspects of the story).
Great, but Fit tests are course grained in nature. I typically make at least 20 baby steps (source code commits) before a story is complete. I don't want to commit the Fit test before I start writing code as the Fit test will fail and break the build. Not good. I don't want to wait until the fit test is complete as that will loose all the advantages of developing in baby steps.
Some teams use different directories to distinguish between the Fit tests that have been completed and should pass, and those that are currently being worked on. The tests get moved around when they have been completed. I guess that solves the baby steps problem, but I've never liked moving files around to indicate completion and it's still hard to see how the Fit tests relate to the originating Customer Stories.
William Jones has a much nicer solution with his Agilifier project. There is not much documentation at the moment (well, it is opensource!), so I will give you a quick overview.
- You group the Fit tests around the stories they are associated with. All the tests associated with a story are contained in a directory. You place the original story in the story.txt file. You simply add your Fit test files to the directory.
- You use test suites to make the distinction between the previously completed tests (i.e. we have broken something if they don't pass - and should fail the build!), the tests associated with the current iteration (i.e. these provide a progress bar of the current iteration) and those tests an individual (or pair) are currently working on. The suites are simple text files containing the tests to be included in the suite.
- Agilifier runs the test suites and glues the story and Fit tests together in a nice html report.
Download it and give it a try. You should be able to figure it out from it's own acceptance tests!