There is a legend surrounding the profession of architects that tells of an architect who designed a marvelous library in which he forgot to take into consideration the weight of the books. This over sight on his part later caused the library to be condemned as the library gradually sank over time. Although no more than a legend, it brings to light an interesting topic… When we make a decision and influence all of those around me, what if we miss something?
Well, our profession actually has certain check points that have been instituted to prevent such disasters from happening.
1. Code Reviews: This one is the most obvious, but code reviews are highly beneficial for both this check, and many others provided they should serve as more than a Hey, you spelled that name wrong purpose. Code reviews can act as a final check to ensure that the developers are in fact sane in their design, and not off in la la land.
2. Unit Tests: This serves more to prevent someone from going in and changing something, and introducing these types of insights. With a good set of unit tests covering 100% of the testable code, it is very easy to catch these modifications over sights provided the initial design was sound, and tested accordingly.
3. Test Driven Development: Simply put, starting with what the users (internal or external to IT) want, and moving backwards to provide the code can help to eliminate this issue as well. When we code off in our own little worlds, we tend to add tons of edge cases and this could happen scenarios that no users would ever consider. This is a mixed blessing because as developers we tend to be very detail oriented, and can often conceive of situations that could never happen in real life.
4. Peer Programming: Well, two sets of eyes are, and always will be better at catching bugs than one set… it’s that simple.
At the end of the day, this list is just a small portion of the hundreds of ways we’ve attempted to perfect our profession. Realistically though, there are by far more failed attempts than successful ones at bullet proofing the art of software creation and it always comes down to one thing, the people developing the code.
Let us consider for a few seconds the scenario about the weight of the books again; lets apply this to software development and analyze just what could have been done differently in this situation.
1. Code Reviews: Well, sure if the design was reviewed it may have stopped this, but a good architect can sell any design even to other architects no matter how wrong it may or may not be.
2. Unit tests: Well simply put the initial design was flawed. A good set of tests would have actually tested to ensure that the library would sink with the weight of the books, possibly exposing the issue. Realistically it was never something which was taken out of the design, so no one would have thought to test it either.
3. Test Driven Development: I highly doubt the users would have ever thought to question the architect and ask if he had accommodated for the extra weight. In fact, most architects would be offended if a user had questioned something like that because it is after all, their purpose to find those issues no one else thinks of.
4. Peer Programming/Design: Yes, this would have at least doubled the chance of finding this issue in the initial plans, but it could have slipped through to the end still. Even peer teams are by no means perfect.
So I guess this kind of exposes a bit of an issue… maybe we aren’t as bullet proof as we think we are? The only real suggestion I can think of is that we need to take that step back and look at the big picture some times, get our heads out of the code and look at the larger impact of the lines we write. Maybe one line of code at a time, module by module is not really going to solve our problems? I guess what I’m saying is when you look at the big picture, sometimes the code really is just a small piece of the puzzle…