- Split off the long running integration tests and have them only run under a specific maven profile
- Use a faster in-memory database like HSQLDB or H2
Friday, April 17, 2009
Too Much Time Wasted Running Tests
When I arrived at my current project, it had a large stack of integration tests using a combination of Spring, Hibernate, DbUnit and Unitils. The test suite was backed by MySql in all environments. (local, CI and Production.)
The problem with this solution is time! It takes anywhere from 3 to 4 minutes to execute mvn clean test on our dev boxes. Now, that does sound like a long time to wait, and I've worked on projects that have taken over 15 minutes to complete the test suite, but it adds up.
Multiple that time by the number of times a day a developer runs the test suite, times that by the number of developers on the team, and you start to get serious amounts of time spinning your wheels.
I conservatively estimated the team as a whole was waiting over 3 hours a day for the test suite to complete.
Beyond these numbers, we use TDD and it is good development practice to check in as often as you can. If the time taken to run your test suite hinders that, you are already slipping into the dark.
I set about finding a solution; looking around, asking some questions and some scratching of heads these two options were selected.
Labels:
Craftsmanship,
Java,
Testing
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment