Designing For Testability

March 15th, 2007 § 0

Right now, I’m finding it quite ironic that I’d been thinking about this all day yesterday, after trying to retroactively write some tests for a project that I came into rather late in the lifecycle.

Cedric just posted an entry with the exact same title, almost as if to taunt me with his infinite testing wisdom.

At about 200 times during the day yesterday, I came across a piece of code and thought to myself:

“How in the &$^%#@! am I going to write a test for this?!?”

So with any luck, Cedric will be able to get Hani to stop biling and whining about XML – and finish their testing book so I can go buy a copy.

In the meantime, it seems like the new question I am going to ask myself when designing a piece of code is something along the lines of:

“Sure, this design is elegant, but is it testable?”.

And as Cedric mentions, writing testable code is not necessarily writing code that is better designed.

Like it? Share it:
  • Print
  • Facebook
  • Twitter
  • Digg
  • LinkedIn
  • StumbleUpon
  • Reddit
  • Technorati
  • del.icio.us
  • Google Bookmarks

§ Leave a Reply

What's this?

You are currently reading Designing For Testability at humandoing software.

meta