|
< Free
|
3.1. Importance of Prerequisites
A common denominator of programmers who build high-quality software is their use of
Cross-Reference Paying attention to quality is also the best way to improve productivity. For details, see Section 20.5, "The General Principle of Software Quality." If you emphasize quality at the end of a project, you emphasize system testing. Testing is what many people think of when they think of software quality assurance. Testing, however, is only one part of a complete quality-assurance strategy, and it's not the most influential part. Testing can't detect a flaw such as building the wrong product or building the right product in the wrong way. Such flaws must be worked out earlier than in testing—before construction begins.
If you emphasize quality at the beginning of the project, you plan for, require, and design a high-quality product. If you start the process with designs for a Pontiac Aztek, you can test it all you want to, and it will never
Since construction is in the middle of a software project, by the time you get to construction, the earlier
Do Prerequisites Apply to Modern Software Projects?Some people have asserted that upstream activities such as architecture, design, and project planning aren't useful on modern software projects. In the main, such assertions are not well supported by research, past or present, or by current data. (See the rest of this chapter for details.) Opponents of prerequisites typically show examples of prerequisites that have been done poorly and then point out that such work isn't effective. Upstream activities can be done well, however, and industry data from the 1970s to the present day indicates that projects will run best if appropriate preparation activities are done before construction begins in earnest.
Preparation for construction is not an exact science, and the specific approach to risk reduction must be decided project by project. Details can vary greatly among projects. For more on this, see Section 3.2. Causes of Incomplete Preparation
You might think that all professional programmers know about the importance of preparation and check that the prerequisites have been satisfied before jumping into construction.
A common cause of incomplete preparation is that the developers who are assigned to work on the upstream activities do not have the expertise to carry out their assignments. The skills needed to plan a project, create a compelling business case, develop comprehensive and accurate requirements, and create high-quality architectures are far from trivial, but most developers have not received training in how to perform these activities. When developers don't know how to do upstream work, the recommendation to "do more upstream work" sounds like
Further Reading For a description of a professional development program that cultivates these skills, see Chapter 16 of Professional Software Development (McConnell 2004). cc2e.com/0316
Some programmers do know how to perform upstream activities, but they don't prepare because they can't resist the urge to begin coding as soon as possible. If you feed your horse at this trough, I have two suggestions. Suggestion 1: Read the argument in the
A final reason that programmers don't prepare is that managers are notoriously unsympathetic to programmers who
A few years ago, however, I was working on a Department of Defense project that was focusing on requirements development when the Army general in charge of the project came for a visit. We told him that we were developing requirements and that we were
Further Reading For many entertaining variations on this theme, read Gerald Weinberg's classic, The Psychology of Computer Programming (Weinberg 1998).
This
If the manager of your project pretends to be a brigadier general and orders you to start coding right away, it's easy to say, "Yes, Sir!" (What's the harm? The old guy must know what he's talking about.) This is a bad response, and you have several better alternatives. First, you can flatly
A second questionable alternative is pretending to be coding when you're not. Put an old program listing on the corner of your desk. Then go right ahead and develop your requirements and architecture, with or without your boss's approval. You'll do the project faster and with
Third, you can educate your boss in the
Finally, you can find another job. Despite economic ups and
Utterly Compelling and Foolproof Argument for Doing Prerequisites Before ConstructionSuppose you've already been to the mountain of problem definition, walked a mile with the man of requirements, shed your soiled garments at the fountain of architecture, and bathed in the pure waters of preparedness. Then you know that before you implement a system, you need to understand what the system is supposed to do and how it's supposed to do it.
Appeal to LogicOne of the key ideas in effective programming is that preparation is important. It makes sense that before you start working on a big project, you should plan the project. Big projects require more planning; small projects require less. From a management point of view, planning means determining the amount of time, number of people, and number of computers the project will need. From a technical point of view, planning means understanding what you want to build so that you don't waste money building the wrong thing. Sometimes users aren't entirely sure what they want at first, so it might take more effort than seems ideal to find out what they really want. But that's cheaper than building the wrong thing, throwing it away, and starting over.
It's also important to think about how to build the system before you begin to build it. You don't want to spend a lot of time and money going down blind alleys when there's no need to,
Appeal to Analogy
Building a software system is like any other project that takes people and money. If you're building a house, you make architectural drawings and blueprints before you begin pounding
You don't start decorating the Christmas tree until you've put it in the stand. You don't start a fire until you've opened the flue. You don't go on a long trip with an empty tank of gas. You don't get dressed before you take a shower, and you don't put your shoes on before your socks. You have to do things in the right order in software, too.
Programmers are at the end of the software food chain. The architect consumes the requirements; the designer consumes the architecture; and the
Compare the software food chain to a real food chain. In an ecologically sound environment, seagulls eat fresh salmon. That's nourishing to them because the salmon ate fresh herring, and they in turn ate fresh water
In a polluted environment, the water bugs have been swimming in nuclear waste, the herring are contaminated by PCBs, and the salmon that eat the herring swam through oil spills. The seagulls are, unfortunately, at the end of the food chain, so they don't eat just the oil in the bad salmon. They also eat the PCBs and the
If you are planning a highly iterative project, you will need to identify the critical requirements and architectural elements that apply to each piece you're constructing before you begin construction. A builder who is building a housing development doesn't need to know every detail of every house in the development before beginning construction on the first house. But the builder will survey the site, map out sewer and electrical lines, and so on. If the builder doesn't prepare well, construction may be delayed when a sewer line needs to be dug under a house that's already been
Appeal to DataStudies over the last 25 years have proven conclusively that it pays to do things right the first time. Unnecessary changes are expensive.
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %} In general, the principle is to find an error as close as possible to the time at which it was introduced. The longer the defect stays in the software food chain, the more damage it causes further down the chain. Since requirements are done first, requirements defects have the potential to be in the system longer and to be more expensive. Defects inserted into the software upstream also tend to have broader effects than those inserted further downstream. That also makes early defects more expensive.
Table 3-1. Average Cost of Fixing Defects Based on When They're Introduced and
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Time Detected |
|||||
|---|---|---|---|---|---|
|
Time Introduced |
Requirements |
Architecture |
Construction |
System Test |
Post-Release |
|
Requirements |
1 |
3 |
5-10 |
10 |
10-100 |
|
Architecture |
— |
1 |
10 |
15 |
25-100 |
|
Construction |
— |
— |
1 |
10 |
10-25 |
|
Source: Adapted from "Design and Code Inspections to Reduce Errors in Program Development" (Fagan 1976), Software Defect Removal (Dunn 1984), "Software Process Improvement at Hughes Aircraft" (Humphrey, Snyder, and Willis 1991), "Calculating the Return on Investment from More Effective Requirements Management" (Leffingwell 1997), "Hughes Aircraft's Widespread Deployment of a Continuously Improving Software Process" (Willis et al. 1998), "An Economic Release Decision Model: Insights into Software Project Management" (Grady 1999), "What We Have Learned About Fighting Defects" (Shull et al. 2002), and Balancing Agility and Discipline: A Guide for the Perplexed (Boehm and Turner 2004). |
|||||
The data in Table 3-1 shows that, for example, an architecture defect that costs $1000 to fix when the architecture is being created can cost $15,000 to fix during system test. Figure 3-1 illustrates the same phenomenon.
|
The average project still exerts most of its defect-correction effort on the right side of Figure 3-1, which means that debugging and associated rework takes about 50 percent of the time spent in a typical software development cycle (Mills 1983; Boehm 1987a; Cooper and Mullen 1993; Fishman 1996; Haley 1996; Wheeler, Brykczynski, and Meeson 1996; Jones 1998; Shull et al. 2002; Wiegers 2002). Dozens of companies have found that simply focusing on correcting defects earlier rather than later in a project can cut development costs and schedules by factors of two or more (McConnell 2004). This is a healthy incentive to find and fix your problems as early as you can. |
When you think your boss understands the importance of working on prerequisites before moving into construction, try the test below to be sure.
Which of these statements are self-fulfilling prophecies?
We'd better start coding right away because we're going to have a lot of debugging to do.
We haven't planned much time for testing because we're not going to find many defects.
We've investigated requirements and design so much that I can't think of any major problems we'll run into during coding or debugging.
All of these statements are self-fulfilling prophecies. Aim for the last one.
If you're still not convinced that prerequisites apply to your project, the next section will help you decide.
| < Free Open Study > |