A crowded unit testing BoF
This mornings BoF lead by James Newkirk was truly crowded and goes to prove that .NET developers are taking testing seriously. Considering the level of participation in the discussions there might actually have been too many participants as there were no real discussions, more statements regarding to experience summed up and commented by James Newkirk.
Topics included handling testing of legacy code, reasonable test times, mock objects, testing database code and more. Check out Benjaminm's blog for upcoming details. Moetivating developers to write tests were discussed in a TDD/test-first context. Later on in the session several delegates were talking about CruiseControl and I left feeling that Continous Integration should have been addressed more thouroughly, maybe even in a separate session.
For me, Continous Integration is the primary motivator for testing because it gives tests a purpose and visualizes the results. The challenge for automated builds in CI is usually build times. This was also dicussed in this mornings BoF. Several delegates had build times of 6 hours and more. I completely agree with James Newkirk in that build should never be more than an hour. To accomplish this the solution has to be separated into subsystems. How easy this is to implement depends on the overall solution architecture.
An interesting paralell can be made to principles applied to service orientation. I like to use the micro and macro view of the application as presented a while back by Clemens and Steve Schwartz on the Architects Tour. I you think about components as services in a micro view and define a contract for this component you'll have exactly the interface to test for which you may, or may not use test-first. This relates to Christian Weyer and Beat Schwegler chalk'n'talk last night on contract-first service development/design.
Both test-first and contract-first is based on the same principle: definition of the recuirements for a piece of software. I feel components should be treated as lightweight local services and have the same demands for quality and design as services.