Multiple meanings of test-driven development

This Roy Osherove post surprised me because I hadn’t been aware of so many different interpretations of the idea before. Because I’ve always believed in at least some design up front, my understanding of TDD was the first of four mentioned:

Test Driven Development: the idea of writing your code in a test first manner. You may already have an existing design in place.”

The fourth interpretation of TDD applies pretty well to what I do now whenever I inherit an application.  Writing unit tests of the middle tier(s) of the application (if none exist) has proven to be very helpful whenever I’ve done this.  Adding new features becomes easier, and regression testing becomes much easier.

Reactions to inherited code

This entertaining Phil Haack post on inherited code definitely tells the truth when it says:

“Here’s the dirty little secret about being a software developer. No matter how good the code you write is, it’s crap to another developer.”

Until I read this post, I hadn’t even thought about the thousands of lines of code I’ve left behind at various employers and how my successors regarded them.  I remember getting very positive feedback from a colleague who wrote the .NET replacement for my VB6/COM+/SQL Server 2000 implementation of our online recruitment tool, but that’s it.  My usual reaction to code I’ve inherited has rarely been empathetic.  Phil’s right in trying to be more understanding.
And to anyone who has inherited my code in the past, I hope I didn’t make your job too hard.

Theory D or Theory P?

Earlier today, I came across this excellent post by Reginald Braithwaite on the management of software development.  It does a great job of explaining many of the projects I’ve worked on in my career, whether they succeeded or not.  Theory D clearly drove how I and various teammates ended up working.  The post really helped me understand part of why the two years I spent managing projects was so difficult.  I’m a Theory P guy at heart, and couldn’t pretend to be Theory D (much less actually believe it).

Braithwaite also writes a good follow up.

I really hate SQLDataSource

What I said about hating ObjectDataSource doesn’t count. SQLDataSource is worse. At least ObjectDataSource gives you error messages when it isn’t working. SQLDataSource appears not to work at all with stored procedures that have parameters. I found this forum thread that seemed to describe my problem. Unfortunately, none of the tactics suggested worked for me. I don’t even get error messages, just a screen with no GridView control in it. One of my colleagues looked at it and was just as stumped as I am.

Using an XSD, a couple lines of code, and an ObjectDataSource got me the result I needed with far less hassle.

NCover goes corporate

I was on vacation when this happened, but NCover has become a product you pay for.  The rationale for the change is a fair one, and I’m impressed by how Gnoso (the vendor of NCover) is looking out for people who donated to the project when it was free.  NCover 1.58 remains free, but doesn’t have the same level of features as NCover 2.0 (or 2.0 Enterprise).

Gnoso has that product niche basically themselves since Cenqua, the vendor of Clover.NET, got bought by Atlassian in August.  Since Atlassian is end-of-lifing Clover.NET, the coverage tool bundled with Team Foundation Server is the only option for .NET code coverage functionality.
Given the choice between paying for functionality that used to be free and losing it altogether (as happened with NDoc), I’d fork over the dough in at least some cases.  Whatever they intend to charge, odds are they won’t be Microsoft prices.
It will be interesting to see how many other tools that are currently free make a similar transition.

Lessons from failure

It’s an older Reg Braithwaite post, but an excellent one.  His four most important causes of failure are all painfully familiar.  The paragraphs he writes on hiring practices and “development hygiene” are especially important.  In an environment where the cheapest vendor wins, those two areas are the source of many problems.

The post does a very good job of pointing out how weak stakeholders can doom a project.  There’s also a clear example of how office politics can play havoc with outcomes.

It’s a pretty long post, but very worthwhile reading.

I hate DTS

I’ve spent a good chunk of this week trying to revise some DTS packages to account for changes in how MapQuest provides access to data they’ve geocoded for us. Since I haven’t used it in years, I’d forgotten how much I dislike the user interface for it. It probably didn’t help that I was trying to edit this things with a plug-in you install for SQL Server 2005.

Trying to have separate development and test environments to avoid the horrors of doing development and testing in a production environment is quite a trial also. I think you can put settings in a configuration file, but it’s probably something like an INI file.

It’s probably just as well that DTS was replaced by SSIS. I did use that to do a bit of flat file validation for the same project and didn’t find it nearly as painful to use.

Improving developers

Scott Hanselman posts a number of great tips for  improving development teams.  The technical brown bag idea is one we’ve been following at work since the spring.  We call them “learning lunches”, and they’ve proven to be an excellent vehicle for knowledge transfer, as well as connecting different offices of the company.

At my current employer and the previous one, I’ve tried to promote conferences, off-site training, and .NET user groups.  Getting the staff to attend them has been more of a challenge here than at my last job.  They’re all excellent ways of keeping technical skills sharp as well as networking opportunities.

Now that we have a new CIO at work, it will be interesting to see to what degree he’d buy in to some of these ideas.

To rewrite, or not to rewrite?

This question comes up rather often in my job, and this post by Adam Turoff answers the question by including “when” as a variable.  In short, the sooner a project needs to succeed, the less likely it is that a rewrite will succeed.

Whenever I come across an application that isn’t designed or implemented as well as it should be, I’m biased in favor of rewriting the application.  That approach tends to meet resistance because the “when” is usually very short.  Refactoring is a good fallback option, but only if the application is relatively current.  My desire to refactor single-tier classic ASP is nil.