>Quote of the Day


Nothing makes a system more flexible than a suite of tests. Nothing. Good architecture and design are important; but the affect of a robust suite of tests is an order of magnitude greater. It’s so much greater because those tests enable you to improve the design.

Robert “Uncle Bob” Martin, Jun 24 2008
“So…You want your code to be maintainable”

As Eric Rizzo has said, Uncle Bob is full of wisdom. A maintainable system in my opinion is one where somebody can look at something quickly and know what it means. It isn’t necessarily a system that has a very few methods that do a lot, it actually may have many small methods that do a specific function and are reused. Having tests is a key part of this process. More importantly having the tests consistently pass is even more critical.

A comment from Uncle Bob in a response to his blog entry is very telling:

Reader:If tests need to be edited every time a simple “business as usual” change is made, there can be a strong temptation to ignore the broken tests. And soon, the test suite rots … and design calcifies.

Uncle Bob:Ignoring broken tests is like ignoring high blood pressure, or severe chest pains, or the “maintenance needed” light on your car’s dashboard. It’s pretty damned foolish. A professional team does not tolerate broken tests.

Fragile tests are a symptom of a poor design. If your tests break a lot because of small changes, it’s time to change the design of the tests.

I hear this from time to time with various development projects that I contribute too. Tests that are brittle to change are a sign that either the tests are designed wrong or the system has too much coupling and needs a round of refactoring. Something is doing too much work somewhere in the system.

This entry was posted in eclipse, refactoring, xml. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s