Skip to main content

Posts

Showing posts from May, 2009

Really Dumb Tests

When I mention the idea of automated unit testing (or developer testing as J.B. Rainsberger referred to it in his book JUnit Recipies) people either love it, or more likely are put off because all the tests that they want to write are too hard, and the tests that they can write seem too simple to be of much value. With the exception of tests that "test the framework" that you are using, I don't think that one should worry prematurely about tests that are too simple to be useful, as I've seem people (myself included) spin their wheels when there was a coding error that could have been caught by one of these "simple" tests.

A common example is the Java programmer who accidentally overrides hashcode() and equal() in such a way that 2 items which are equal do not have the same hashcode. This causes mysterious behavior when you add items to a collection and try to find them later (and you don't get a HashCodeNotImplementedCorrectly" exception.) True, y…

IDEs in March

In March I wrote an article in CM Crossroads that argues that as long as a team and it's individuals are productive, there isn't a lot of sense in imposing a standard IDE on a team. Organizations go overboard with standards sometimes. As long as a developer is productive, and doesn't cause problems for others, why should anyone care what tools she uses? I end the article:
There is a difference between consistency in important things, which is valuable, and conformity, which is often mistaken for consistency. Focus on delivering consistent results, and respect that a team will know how to get there.

I've been thinking a fair amount about how to balance IDEs and the build configurations, since this seems to be a problems teams struggle with often, though it is getting better as IDEs can model their project settings off of the information in Maven POM files and the like.

Read Beware the IDEs.

Accidental Simplicity

Agile software developers favor simple designs that solve immediate problems, over feature rich frameworks that provide functionality that you may not use. The reason we agile people believe this is the right approach is that building extensibility adds costs, and spending resources (time and money) on something that may not be used is wasteful.

The approach of focusing on simplicity and shorter time horizons works well on agile teams because agile engineering practices such as unit testing and refactoring make it easier to evolve code when it needs change. Without this agile infrastructure teams can fall into the trap of code not changing because change is risky, and what was done first needs to be preserved. Working with the values of doing The Simplest Thing that Could Possibly Work, YAGNI (You Aren't Gonna Need It), and avoiding BDUF (Big Design Up Front) can help you build the right thing more quickly. The challenge is how to find a simple solution, as simplicity doesn…