Computer Science › Section H · Software engineering › Topic H.2

The software life cycle

A program is not finished when it first runs. Most successful software is used, corrected and extended for years, and the software life cycle describes that whole journey, from the first conversation with users to the day the system is retired.

Development, use, maintenance

Software engineering starts from one picture, the software life cycle. After a system is developed it goes into use, and from then on it moves round a loop of use and maintenance for the rest of its working life. Physical products have a similar pattern, but their maintenance mostly means repairing parts that have worn. Software maintenance means correcting and changing it: fixing faults that users discover, adapting the program when the world around it changes, and adding features. A school timetabling system may be developed in one year and then maintained for fifteen, through new courses, new rules and new operating systems.

Four kinds of maintenance

Maintenance work is usually sorted into four kinds. Corrective maintenance fixes faults found after release, such as a report that adds up a column wrongly. Adaptive maintenance keeps the software working when its environment changes: a new operating system version, a new tax law, a new payment provider. Perfective maintenance improves or extends the software in response to users, by adding features or making it faster. Preventive maintenance heads off future trouble without changing what users see, for example by fixing a latent fault before anyone meets it or restructuring a tangled module; some standards file restructuring under perfective instead. In every case the maintainer, often not the original author, must first understand the relevant code, or the change may cause new problems.

Worked example: classifying maintenance requests

A library system receives four requests. Classify each. 1. "Overdue fines are calculated one day too high when a book is returned on a Sunday." The program is wrong, so this is corrective. 2. "The national postal service is changing its address format next year." The software is fine but its environment is changing: adaptive. 3. "Members would like reminder emails two days before a due date." A new feature users asked for: perfective. 4. "The fines module repeats the same date logic in six places; combine it into one function." Nothing changes for users, but later changes become easier and safer: preventive. Note that request 4 would also have made request 1 easier to fix.

Worked example: where the money goes

Maintenance commonly costs more than development over a system's life, so effort spent early can pay off later. Take a hypothetical system. 1. Development costs $400,000, and maintenance $90,000 a year for 8 years: \(8 \times 90{,}000 = 720{,}000\) dollars. 2. Lifetime cost: $1,120,000, of which maintenance is \(\frac{720{,}000}{1{,}120{,}000} \approx 64\%\). 3. Suppose spending an extra $60,000 on clearer design and documentation cuts maintenance to $60,000 a year. 4. New total: \(460{,}000 + 8 \times 60{,}000 = 940{,}000\) dollars, a saving of $180,000. The numbers are invented, but the lesson is general. Small habits, such as the named constants described in "Traditional concepts: variables, types, and control", are cheap during development and save time at every later change.

The traditional development phase

The traditional view splits development into requirements analysis, then design, then implementation, then testing. Requirements analysis decides what services the system must provide, what conditions apply to them, such as speed, security or legal rules, and how the outside world will interact with it. It starts with the stakeholders: the future users and everyone else with an interest, such as managers, regulators and those paying for the system. A client organisation may begin with a feasibility study of whether the project is worth doing at all. A company building commercial off-the-shelf software for many buyers has no single client, so it often begins with market research instead.

The requirements specification

Analysts gather needs, negotiate trade-offs between what stakeholders want, what they need, what it will cost and what is technically possible, and record the agreed result in a software requirements specification. The specification acts like a contract: it guides development and settles later disputes about what was promised. Requirements come in two kinds. Functional requirements say what the system does: "a member can reserve a book". Non-functional requirements say how well it must do it: response time, reliability, security, accessibility. Standards bodies such as the IEEE and ISO publish guidance on writing specifications. Even so, practitioners widely regard poor communication and changing requirements as leading causes of late, over-budget projects.

Worked example: making requirements testable

A draft specification for a library app says: "Search must be fast, the app must be easy to use, and accounts must be secure." Each phrase is a wish, not a requirement, because no test could prove it met or failed. Rewrite them. 1. Fast: "For a catalogue of up to 100,000 titles, 95% of title searches return results within 2 seconds." 2. Easy to use: "After a five-minute introduction, 9 of 10 new members can reserve a book within 3 minutes." 3. Secure: "An account is locked for 15 minutes after 5 failed sign-in attempts in a row." 4. Check each: it names a measurable quantity and a pass mark, so a tester can decide pass or fail.

Design and implementation

Requirements analysis identifies the problem; design plans the solution. A popular summary is that requirements decide what the system will do and design decides how, though in practice each stage involves some of both. Design fixes the internal structure: the overall architecture, the modules and how they connect, the data each one keeps. Its output is a description detailed enough to be turned into programs, often using diagrams like those in "Tools of the trade: UML and design patterns". Implementation then writes the programs, creates data files and builds databases. Traditionally a software analyst, also called a systems analyst, worked across the whole process, while a programmer mainly implemented; today the job titles overlap heavily.

Testing throughout

In the traditional picture, testing came last: debug the programs, then confirm that the product matches the specification. That view is now considered too narrow. Every intermediate product, including the specification and the design, should be checked, because an error caught in a document is far cheaper to fix than one found in finished code. Two questions guide this. Verification asks: are we building the product right, does each stage match the one before? Validation asks: are we building the right product, does it meet the users' real needs? Some engineers would merge testing into every stage, giving steps such as "design and validation". The topic "Quality assurance and testing" goes further.

Common mistakes to avoid

First, thinking of maintenance as only bug fixing; adapting and improving software is usually the larger share. Second, writing requirements as wishes, such as "fast" or "user-friendly", that no test can check. Third, confusing functional requirements, what the system does, with non-functional ones, how well it does it. Fourth, treating testing as a final stage instead of checking every stage's output. Fifth, mixing up verification, building it right, with validation, building the right thing.

Key takeaways

Software cycles through development, use and maintenance. Maintenance is corrective, adaptive, perfective or preventive, and it often costs more than development, so care taken early pays off. Traditional development runs from requirements analysis through design and implementation to testing. Requirements analysis involves all stakeholders and produces a software requirements specification of functional and non-functional requirements, each of which should be testable. Design decides how the system will meet them; implementation writes the code. Every stage's output should be checked, for verification (built right) and validation (right product).

Flashcards

Flashcard

Software life cycle

Development, then a continuing loop of use and maintenance

Lasts the whole working life.

Test your understanding

Question 1 of 5

A tax app must be updated because the government has changed the rules for next year. Which kind of maintenance is this?

Question 2 of 5

Which requirement is written so that a tester can check it?

Question 3 of 5

A system costs $300,000 to develop and $50,000 a year to maintain for 10 years. What share of the lifetime cost is maintenance?

Question 4 of 5

A team checks that the design document covers every item in the requirements specification. What is this?

Question 5 of 5

Which is a non-functional requirement for an online banking app?

← Previous topicNext topic →