March 15, 2007

Designing for Testability

Today, Alexandru and I made our presentation at QCon. We split the talk in two parts: Alexandru covered a section we called "Three TestNG features that you will like" and I followed with a brand new presentation entitled "Designing for Testability", which I made purposely non-TestNG specific.

As you probably guessed, a lot of the ideas discussed in this presentation are covered in greater lengths in our upcoming book.

Here are some of the topics I covered:

  • Designing for Testability can sometimes be at odds with well-established software engineering practices, such as certain design patterns and extreme encapsulation. You need to be ready to question your beliefs.
  • You should avoid using statics, and there are some very valuable frameworks that make this very easy (Guice and Spring, to name two).
  • Test-Driven Development does not necessarily lead to code that is better designed, and is best used to expose junior programmers to testing.
As for the conference, I'm enjoying it quite a bit: the location is absolutely terrific and it's nice to be able to attend non-Java tracks, for a change. Hats off to Floyd, Alexandru and the rest of the crew for a top-notch conference!

Posted by cedric at March 15, 2007 12:24 PM


Cedric - were the presentations recorded for podcasting at all? Would be great to here them...

Posted by: Mark Derricutt at March 15, 2007 01:18 PM

CÚdric, about avoiding statics - if you were using tools (or a language) that let you temporarily override what a static method does, would you still say that you should avoid statics?

If so, why?

The reason for my question is that I think you don't need to write testable code in a way that is any harder to read than untestable code; especially if your tools are good. In Java, that probably means AOP; in Lisp, it probably means, well, normal Lisp.

Posted by: Ricky Clarkson at March 15, 2007 07:02 PM


Yes, most sessions at QCon were recorded for podcasting. They should appear on InfoQ over the next couple of months (although I know nothing about the schedule).

CÚdric, glad to hear that you enjoyed the conference! Hope to see you next year.

Posted by: Jacob Tjornholm at March 19, 2007 02:24 AM

Thanks for blogging about QCon! I just wanted to let you know that we quoted and linked from this entry on the over all QCon 2007 blogger's key takeaway points and lessons learned article:

Feel free to link to it and of course blogging about this articles existence would help even more people learn from your and other bloggers takeaways.

Thanks again!


Posted by: diana plesa at March 22, 2007 03:09 AM

I hope everything went off swimmingly!

Posted by: narik at April 9, 2007 10:55 PM
Post a comment

Remember personal info?