Wed 13 Jun 2007
How to Design Software With Bad Requirements
Posted by Scott Hackett under Programming
[17] Comments
“I’m trying to write a DOS bat file that runs an Access macro to import a CSV output file from my COBOL program. Any help would be appreciated.” - Anonymous
A short while ago I hired a stained glass artist to create a window for my back door. I told him I wanted something simple but distinctive and let him sketch some designs that he felt would work well in the room. He smiled and had a look of happiness, then told me a story about a recent customer. He said, “This guy had a beautiful master bathroom and wanted me to create a large stained glass window of a hula dancer for it. I tried to suggest some other ideas, but he was very serious about having a hula dancer. So I made the best hula dancer I could for the guy.”
I immediately related to his story. I’ve had to design a lot of hula dancers in my software development career. One thing I’ve always found is that users and managers who aren’t familiar with (or don’t care about) the latest technology will often ask for features or user interfaces that cross the lines of absurdity. Sometimes businesses just can’t give up the archaic interfaces to their data because of cost or fear of change. As a developer it’s your responsibility to suggest alternative solutions that better fit the business and technical model. But users and managers are often a stubborn group of people who really believe that they know what’s best in all cases, and will stick to those beliefs.
There are many articles about developing good software up front. There are many more articles on refactoring bad code to make it better. However, there are very few resources about the common necessity of having to fully implement bad requirements. It goes against the very nature of a good developer, yet is a necessity that most run into at some point. This article discusses some of the strategies that can be used when you are asked to create a hula dancing piece of software.
Write Good Use Cases
When a user demands a particular feature or requirement that goes against common sense, the best first defense is to draw up a good set of use cases that show why you feel the requirement is a bad one. Use cases take a relatively short amount of time to do and you don’t need to touch a single line of source code to make them. Often, when a user can visualize specific scenarios in their mind, they will realize that a particular requirement is a bad one. It’s important to hear the users concerns, but good use cases can shed light on bad requirements with the least amount of effort.
Create a Prototype
If use cases have failed to convince your users that a requirement is flawed, a good second step is to create a prototype. Prototypes should not take more than a day or two and should be functionally thin. The idea is to create a skeleton implementation that just gives the user a sense of how the requirement will behave. It’s often useful to create a second prototype that shows your suggested design in action. This is much more powerful than use cases because it lets the user experience both cases and gives a better sense of real-world usability. Your users might not have even realized that life could be so good with your suggestions until they actually get to try them out first hand.
What if there’s no User Interface?
Use cases and prototypes work well for requirements that involve user interfaces. However, when bad requirements must be implemented that don’t involve a user interface, you must use defensive programming. In these cases, abstraction is the best option for protecting your design in the long run.
For example, let’s assume your company wants to rewrite the server software that processes the orders, and the software must get its data form the legacy terminal system that dumps the orders out to flat files in a directory that must be polled. The thought of such a lousy implementation is enough to make most developers cringe, but interfacing with such legacy systems and legacy data exchange workflows are sadly a common occurrence.
Quarantine the Implementation
quarantine [kwawr-uhn-teen]: Enforced isolation or restriction of free movement imposed to prevent the spread of contagious disease.
If you’ve been committed to implementing functionality that goes against your better judgment, your best strategy is to quarantine the implementation of it. This is where your design skills can really shine and save you from a sure path to maintenance hell. Completely separate your implementation from the rest of the application, anticipating that it has a high probability of change. From our previous example, this means completely isolating the code that monitors and reads the legacy data files from the code that processes them.
The best approach in this case is to design an interface that defines the functionality you will need to load data into your system, regardless of the implementation. Another class may then implement that interface and provide the functionality to monitor for new data files. For example, when the order entry terminals are eventually replaced with a system that stores the entries in a database, the legacy data file implementation can be replaced without affecting the rest of the code base. Data may even be retrieved from a web service someday. This design is shown in the following diagram:
This type of design is typically seen when a set of different objects must implement the same interface so they may be used polymorphically. Although this is a very simple example, the approach is an extremely effective way to protect yourself against certain change. It is good practice, even if you only create one concrete object that implements the common interface so that it’s isolated from the rest of the application.
Keep Development Spirits Up
Having to implement bad requirements can be one of the biggest motivational killers to a team of developers. It’s easy to talk badly about it and wind up doing a poor development job when you just don’t believe in the vision. Don’t let this happen, because it quickly snowballs into a situation that’s bound to fail. Instead, be positive and look at it as a challenge to your design and coding skills. When you feel like you’re applying your creativity, even bad requirements can be made interesting.
Conclusion
All software developers have customers; the end users. Even if they are just the people in the department next door, they are the people who drive our work. Ultimately, it’s our job to deliver what they want, not we believe to be what they want. Sometimes that’s a tough fact to face. The next time your manager says that he needs the company software to hula dance, design the best hula dancing software you can. Just remember to make the grass skirt easily detachable.
17 Responses to “ How to Design Software With Bad Requirements ”
Comments:
Leave a Reply
Trackbacks & Pingbacks:
-
Trackback from Web Affiliate
December 18th, 2011 at 2:08 pmWeb Affiliate…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
-
Trackback from Software Download ดาวน์โหลดโปรแกรมฟรี - DownloandTT.com
December 19th, 2011 at 11:33 amSoftware Download ดาวน์โหลดโปรแกรมฟรี – DownloandTT.com…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
-
Trackback from online scripts
December 22nd, 2011 at 1:54 amonline scripts…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
-
Trackback from web design
January 3rd, 2012 at 3:37 pmweb design…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
-
Trackback from programs for android
January 10th, 2012 at 11:48 amprograms for android…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
-
Trackback from Scriptmafia.me - Download Full Nulled Free & Legal Scripts
April 20th, 2012 at 2:42 pmScriptmafia.me – Download Full Nulled Free & Legal Scripts…
[...]How to Design Software With Bad Requirements » "Hello World" – The SlickEdit Developer Blog[...]…
June 13th, 2007 at 4:15 pm
I wonder what world are you living in…
I’ve just written an application within the latest release of the Navision ERP system that monitors a directory and imports flat files, which weren’t created by some sort of legacy terminal app but a brand-new web-based product configurator written in .NET…
Why should it make me cringe? An XML format would make the parsing code 5 times longer and more complicated than a simple TAB-separated file, and reading the files from a directory is a lot more simple than reading a web service… this took no more than a day, where the actual interface took no more than an hour, while an XML-based web service interface would have meant extra hours, maybe even extra days meaning extra $1000′s of consulting because our rate is around $1500 a day. And all this for nothing. I don’t think being a good developer means falling in to every trend like SOA… these ideas like SOA do have their uses, especially in large organizations and large distributed systems with loads and loads of data, but when we it’s a small client, like, 200 records in 10 files a day, how would you rationalize the extra cost? Don’t be so quick in labelling it as bad.
June 13th, 2007 at 4:52 pm
I’d guess the cringeworthiness of that is that the orders are better off being pushed to your application somehow (have the application act as a server, have the application integrate into the other as a library, whatever), rather than being dumped and relying on polling.
June 13th, 2007 at 5:13 pm
@ Shenpen: Point well taken. My example was just that, an example. Personally, I think that flat file polling is a crude method of inter-process communication. However, this article wasn’t written to call one thing crude and another thing elegant. There are lots of areas where “bad” (and again, that’s my own opinion) requirements can be set. For instance, I worked on one project where the client preferred a console interface over a windowed interface because “that’s what their employees were used to.” And I saw his point, it would take a lot of time to train the employees to use the new interface, and they probably wouldn’t be happy using it. So it was a bad requirement in my mind, but a justifiable one. So we wrote the application so that someday it could be plugged into a windowed front end. That’s what this article is about… not what’s good and what’s bad, but what to do when you sense a requirement with a high probability of change.
Thanks for the comments, I love talking about this stuff!
June 14th, 2007 at 11:16 am
Good read – linked.
June 14th, 2007 at 6:42 pm
Hi Scott, I like this advice. But, don’t you think most of it can (and is) how we should work on projects anyway?
You might not do detailed use case analysis, but certainly you’d walk through how features should work. You’d often build some sort of prototype to see you got the requirement right, and quarantine sounds like the result of keeping coupling low and cohesion high.
In any case, I think it is sound advice not just for silly requirements (or what we think are silly requirements), but also apply fairly well to the general case as well.
June 15th, 2007 at 8:19 am
Thanks for the comments!
I completely agree, these are steps that should always be followed. However, in my experience, it’s rare that use case + design + prototype work happens up front, or even at all. I think it happens even less when a developer or team thinks a requirement is a poor one. Hopefully the article shows how to use those design tasks to your benefit when those types of requirements are set.
June 18th, 2007 at 4:43 am
Scott, this is an extremely interesting topic. Not only for small, but also huge organisations. I believe we all sit with the situations where the requirements that we get from our customers are very vaque. It is then the responsibility of the architects, business analysts, designers and developers (sometimes the same person in smaller organisations) to make something happen from this. I love your idea of isolating solutions, but it becomes very complex when you work in an integrated environment where “stand-alones” doesn’t really exist. Maybe we can also considers some other alternatives like:
a. Breaking the unclear requirements into small bits (chunks). These chunks must make some sense or form an independant unit. Then each of these chunks must be designed seperately and prototyped and .. We must keep in mind that all the chunks together must contribute towards the orginal unclear requirements.
b. The reason for unclear requirements is sometimes a way to get alternatives. It implies that the customers wants to explore alternatives without saying it clearly, or the customers does not really knows what he/she wants, but they know they muts do something. In these cases it is essential that only this is addressed and that alternatives are provided without fully functional sofware. You will end up rework in any event.
c. Using archirectural tools to map your designs. This proves to be a very effective way to change and to indicate change.
d. Get agreement on the areas of the requirements that are no so unclear and complete that design and development. Then move on to the unclear bits by making lots of assumptions.
Any more ideas?
June 24th, 2007 at 1:41 am
Hi Scott!
This is a great blog entry! I work extensively with business analysts and systems analysts and I find that too often they do not question a bad requirement when they see one.
Questioning suspect requirements is a must. Your tips to developers also apply business systems analysts.
I added a link on my blog.
- Adrian
December 30th, 2008 at 5:04 am
i want disine software
January 8th, 2009 at 5:06 am
Hi,
I have been part of a software engineering project once but in my internship, I have been given the complete responsibility of coming up with a software. I tried to draw some use-cases but they are too general. Can someone tell me exactly what all goes through your mind when you are making your use cases?
What all information makes you feel prepared to start making them?
August 13th, 2011 at 7:10 am
hi,im elison i want to design software,so can you pleze tell me,what the basics and other things must i have to be known right from the start to design software,and which are the books available in market with author name
and also pleaze also guide me in different computer languages books
thanking you
pleaze write to me at elison.monty@gmail.com