Saturday, June 21, 2008

Do Not Fool Yourself: Prototype != Production

As developers, we get attached to our work because we take pride in our accomplishments. The trouble is that we get a little too attached to progress and miss the bigger picture. We build prototypes to vet out our designs, test new technologies, and demonstrate concepts to our colleagues. But, we shouldn’t fool ourselves… prototypes are not production code.

It happens on every project. We begin building a solution to demonstrate our vision to our client / product manager / IT director / business user. But, we take a few shortcuts. Honestly, who hasn’t, right? We skip the unit tests. We may not wire it up to a production-ready data model. And, we sure don’t subject our code to the scrutiny of our peers. After all, it’s a prototype, right? We’re just trying to rally everyone around a vision! We give ourselves the standard line… “oh, I’ll refactor it and add the test cases ‘later’”.

But then “later” arrives. Now we’re invested in this prototype. After all, it is the solution that sold the business on the viability of a few new features, and… it works! Our perspective is skewed. We think… “Gee, why can’t I just start with this and build around it?” (…except that it’s not 1950 and none of us really think like Beaver Cleaver and the “gee” generation…). In any case, we become comfortable with our shortcuts, and we explain them away.

Resist the urge. Just say no. Prototype code should not be in Production.

First, if you treat your prototype as the starting point for your “real” solution, you’re starting on the wrong side of the statistics. You now have 0% code coverage on your unit tests (or maybe a meager 10-15%), which is hardly the mark of excellence on a production-ready product. Nobody wants to start work with a losing record. I encourage our teams to shoot for an ‘A’ average – 90% code coverage on all code. If 90% is good enough for our nation’s universities, then it’s good enough for me.

Next, if you use your prototype as your “real” solution, you inherit your own bad decisions. We’re geeks – educated, intellectual, creative application designers. All of us can find something we don’t like about the code we wrote last year/month/week. Why? We learned something new that improved our habits and made us better developers. Well, the same goes for an individual solution. For some reason, our ideas are always better the second time around. Most likely it’s because we subject our ideas to peer critique and we vet our code through peer reviews. Inspection begets improvement. But, it’s also (at least partially) because we felt some pain along the way as we implemented our solution – we remember the pain, and we work to overcome it the second time around.

So, do yourself a favor. Relegate your prototype code to a “Prototype” branch in Subversion and begin building production-ready code with a new folder from the trunk. Start fresh for your production application. You will thank yourself later.

Friday, June 6, 2008

TFS Project Extraction Tool - Anyone have a solution?

We are in need of a production-ready tool to extract Team Foundation Server project source code (including all history) from our TFS server so that we can turn it over to clients at the end of each engagement. We have played with the CodePlex projects, but they're still a bit too buggy to rely on.

Doug Seven mentioned this feature will be available in Rosario using a feature called Project Collections. Does anyone know if there are any plans to release a solution sooner? We would like to continue recommending TFS for our clients, but this is a critical requirement that TFS currently cannot meet.

We will likely recommend Subversion until a solution is released.

Agile: More Customer, More Better

This is it. I just got back from TechEd 2008 in Orlando, and I've got the itch to start blogging. I finally have something to say...

Customers, I want to hear from you. I want as much customer interaction as you can give me.

While at TechEd, I attended a Birds-of-a-Feather (BOF) discussion on Agile Development with .NET. The discussion was an open fishbowl style conversation with questions from the audience and a rotating group of people like me offering up answers from our project experiences with Agile.

Overall, it was an engaging discusssion among techies. Many came to learn about the Agile manifesto and the benefits of Agile so that they could try it with their teams. Some came to pontificate, which is fair game for BOF sessions. But a few, I dare say, were shopping for excuses. They were looking for justifications to avoid customer interaction so they could get back to their true passion - coding.

One attendee, let's call him Joe, personified the problem. During a short Q&A, Joe expressed concern that his customers were not engaged in his projects. They often skipped iteration review meetings, so his team had little opportunity to gather customer feedback. Ok, nothing strange there. We have all heard and felt that before.

The problem surfaced during a later discussion about Joe's project work habits. Joe was frustrated that his team couldn't hit its velocity because his customers continually "bothered" him with questions and ideas. He wished they would "leave him alone" so that he could... code. He felt that customers should save their comments for the iteration review meeting rather than "bother" him during his precious coding time. He didn't see the irony that he was complaining earlier that his customers were not engaged. The truth was that they were engaged when they had something to offer, but he wanted them to play by his rules.

Developers like Joe view Agile as an excuse to avoid customers rather than as a tool to engage them. Comments like Joe's give business executives pause when they hear about Agile. They fear that developers will interpret Agile as "ad hoc" and will isolate themselves from processes designed to encourage communication. In fact, Agile seeks to augment communication rather than isolate it. Joe is misguided.

Developers (and projects) cannot be successful without frequent customer interaction. Customers do not "get in the way" of progress. Instead, they are critical to project success because the feedback customers offer alters the shape and direction of each project. And, that's a great thing. Afterall... they are the customer. It's much more satisfying, personally and professionally, to have happy customers than disgruntled ones. Take time to listen when they come knocking. Make adjustments if you can, and prioritize the rest for later. We want to make our customers happy, right?

So, for any of my customers out there who are reading this... Please, keep "bothering" me. I want to hear from you.