Tuesday, July 10, 2012

Much more than a prototype: a tracer code

I've been working on a code that has been called prototype. This time we decided to do it right. First, to code it "properly", not taking major shortcuts, and write unit tests. Also, we took the time to see if the system would hang together and that it would perform to the expectations. What is nice is that you don't really need to throw it away and, as typical, you can extend it and use it in production.

Then I came across this text from the "Pragmatic Programmer" book (bold mine):
You might think that this tracer code concept is nothing more than prototyping under an aggresive name. There is a difference. With a prototype, you're aiming to explore specific aspects of the final system. With a true prototype, you will throw away whatever you lashed together when trying out the concept, and recode is properly using the lessons you've learned. [...] The tracer code approach addresses a different problem. You need to know how the application as a whole hangs together. You want to show your users how the interactions will work in practice, and you want to give your developers an architectural skeleton on which to hang code. In this case, you might construct a tracer consisting of a trivial implementation of the container packing algorithm (maybe something like first-come, firs-served) and a simple but working user interface. Once you have all the components in the application plumbed together, you have a framework to show your users and your developers. Over time, you add to this framework with new functionality, completing stubbed routines. But the framework stays intact, and you know the system will continue to behave the way it did when your first tracer code was completed.
So in the end, I learned that the proper term is "tracer code".

And what is interesting is what the book says about prototypes (to my first point in this post):
If you feel there is a strong possibility in your environment or culture that the purpose of prototype code may be misinterpreted, you may be better off with the tracer bullet approach. You'll end up with a solid framework on which to base future development.
Post a Comment