I was reading: http://jroller.com/page/peter_pilgrim?entry=my_javaone_2006_conference_second1
where Rod Johnson was quoted:
“It is possible to write unit test for applications in J2EE that run under five minutes. If your unit test take place longer than this, then it is wrong.”
I little more relax time is stated in Martin Fowler's Continuous Integration article
“For most projects, however, the XP guideline of a ten minute build is perfectly within reason. Most of our modern projects achieve this. It's worth putting in concentrated effort to make it happen, because every minute you reduce off the build time is a minute saved for each developer every time they commit. Since CI demands frequent commits, this adds up to a lot of time. “
I completely agree with both of them although I would prefer the five minute constrain. Slow builds could have huge impact on the productivity of an Agile/XP team. Some of the reasons for slow build times are if we use database fixtures (as the accepted practices in RoR) or if we don’t bother to use stabs/mocks when appropriate in our test. All of that could be disregarded by many as unnecessary complication but from my previous experience on various projects using db fixtures or not using stabs/mocks have been an issue at some point or another.
An example is the fact that the build for my current project that has been continuing for the last year and a half, on average 6-8 developers, more that 1000 classes, about 100 domain objects with up to 83% unit test coverage (at times :-)) is taking just a little more that 4 min and about 1 min of that is xdoclet generation. The real time is 3 min!!! It is not even a pure unit test build. Our build includes testing the persistence for all domain objects with the database that would be in production as well as the instantiation of Spring IoC container inside the unit tests.
In the beginning we didn’t use stubs/mocks and everything was “freely” accessing the database. After the second month of the project, the build (probably about 20-25% of the current size of the project) was taking already more than 4 min! I have seen/heard about many projects where the unit test build is taking from 30 -1.30 min. I strongly believe that built times like that are unacceptable for an XP team.
I haven’t had the chance to use RoR on something more than a personal learning projects and I wonder how much time is a build taking on an average enterprise project using RoR or how do you overcome this potential problem in RoR projects?