logo
Published on developer.* Blogs (http://www.developerdotstar.com/community)

Software Infrastructure - Do you know what you have? Do you have what you need?

By Daniel Read
Created 2005-04-27 12:54

I've been thinking this week about software plumbing (though infrastructure might be better word than plumbing). I'm referring to those parts of our systems that don't directly fulfill business requirements (though sometimes they do), but that we still can't do without.

When someone (particularly someone who is not a fellow programmer) asks us to describe a system, we seldom begin by describing the really cool logging system, or the elegant base classes and interfaces that we designed for collections, or the centralized exception handler. However, this infrastructure is as necessary for a system as the things we might normally talk about: business objects, user interfaces, reports, and database tables. No one talks about the system's plumbing during requirements meetings, but if the plumbing were missing it would stand out like a new house without a flush toilet.

Often, designing and developing the infrastructure takes more time than the it does for the "first class" parts of the system. Where this really gets us into trouble is in planning and estimation. We forget, when telling our project manager, "That should take about two weeks." (the default estimate for all tasks), that we don't yet have the infrastructure for logging, caching, or exception handling. Often it's not until we're in front of the keyboard that we realize (or remember) that we lack certain key infrastructure elements. This can happen, especially, after joining/forming a new team and when using new tools or languages.

The evil in this is not so much that we gave a faulty estimate to the project manager (which is bad enough), but rather that we're saddled with the temptation to hack our way out of the situation. When struck with the realization that we're missing critical plumbing, we have at least three options: revise the estimate (often not an option), hack in some shortcuts, or work extra hours to properly code the parts of the infrastructure we need. In practice, the solution is probably some combination of these.

Personally, hacking in shortcuts is so distasteful to me that when caught in this dilemma I'll work the extra hours or revise the estimate (the latter might especially be a good option if I was pressured to pull the estimate out of thin air without being allowed time for proper analysis--which is so often the case). In those situations where a shortcut is necessary (the quest for the ideal must always be balanced by the business realities), I at least want to take a little extra time to think about how I would design it given the time, then hide my shortcut behind an interface or other indirection layer to allow for easier refactoring later.

It is worthwhile, I think, to train ourselves to consider the state of our infrastructure (and our programming tool box) when estimating the duration and effort for a given task. It's definitely something I'm working on for myself, as estimating continues to be the single most challenging part of my job.

Good managers are aware of the estimation risks stemming from unknown requirements. However, as programmers we may have some work to do in educating managers on the infrastructure issues that can have significant effect on the quality of an estimate. This is especially true when combining the risk of unknown requirements with the risk of unknown infrastructure-related tasks, for often the former leads directly to the latter.

Some questions we can ask before giving an estimate:

So what are these infrastructure elements that so often bite us this way? Here are some off the top of my head:

If we're lucky, our out-of-the-box toolset (for example, libraries, runtimes, frameworks, IDEs, operating systems, etc.) will provide some of the tools we need. Even in those cases, however, we need to be wary of excessive optimism, for at least a few reasons:

The problem of unexpected limitations bit me when I started my first Microsoft .NET DLL project. I started the task assuming that my need for data-driven settings would be served by the CLR's built-in "AppSettings" capability, which I had read about and used in other .NET projects. However, I soon found out that those *.config files are only supported for executable assemblies (not DLL libraries). So I was left to roll my own solution, which of course took time.

My original version of this essay failed to include any mention of configuration management-related issues. It's easy to forget this because it is not "writing code." It's also easy to forget because often there is such good tool support. Nonetheless, configuration management definitely adds overhead to the coding process and must be taken into account. Some items to consider (not all apply to all situations):

I think there are also other kinds of tasks that we forget when estimating:

Can you think of additions to these lists? Please post your suggestions using the Comments form.

Dan


Source URL:
http://www.developerdotstar.com/community/community/software_infrastructure