Computer Science › Section H · Software engineering › Topic H.1
The software engineering discipline
Writing a 50-line program alone over a weekend and building a banking system with 200 people over five years are different jobs. Software engineering is the part of computer science that studies the second job: how to plan, build and keep large software systems working.
Programming in the large
A small program can live in one person's head. A large system cannot. An airline booking system or a hospital records system may contain millions of lines of code, written by dozens or hundreds of people over many years. During that time the requirements change, staff leave and join, and parts written by different teams must still fit together. Software engineering is the part of computer science that looks for principles and methods for building such systems reliably and on budget. It overlaps with project management and business, but this section concentrates on the ideas closest to computer science: life cycles, methods, design, testing and documentation.
Where the name came from
By the 1960s, computers had become powerful enough to run very large programs, and many big projects were arriving late, over budget and full of errors. People spoke of a "software crisis". In 1968 a NATO-sponsored conference in Garmisch, Germany, used the title Software Engineering on purpose, to argue that building software should become a disciplined engineering activity rather than a craft. Margaret Hamilton, who led software development for the Apollo guidance computer, is often credited with promoting the term in the same decade. Many problems named at that conference, such as poor estimates and changing requirements, are still discussed today.
How software differs from other engineering
Engineering offers lessons, but software breaks some of its assumptions. First, software does not wear out. A bridge weakens with age; a program fails only because of a fault that was present from the start, waiting for the input that triggers it. Second, software is invisible and easy to change, so customers keep asking for changes that would be unthinkable once a building's foundations were poured. Third, for a long time there were few off-the-shelf parts: car designers reuse engines, while early programmers wrote most systems from scratch. Libraries and package collections have improved this greatly. Fourth, there is no physics of software to calculate from.
The search for metrics
Engineers rely on metrics, quantities that can be measured. For machines, a classic quality measure is the mean time between failures, which tracks wear. Because software does not wear, that measure means something different for it. Measuring complexity or effort is just as hard. Counting lines of code is easy but misleading: the same task may take 20 lines in Python and 80 in an assembly language, and a careless programmer can inflate the count. Other measures include defects found per thousand lines, the number of decision points in the code, and the effort spent per feature. Each captures only part of the picture, which is one reason estimates of cost and time are so often wrong.
Why teams are hard
One person needs no meetings. As a team grows, the number of pairs of people who may need to talk grows much faster than the team itself. With n people there are
possible communication channels. Four people have 6 channels; twelve have 66. Frederick Brooks, who managed IBM's System/360 operating system project, drew on this in his 1975 book The Mythical Man-Month. His famous observation, now called Brooks's law, is that adding people to a late software project tends to make it later, because newcomers must be trained and every extra person adds channels. Large projects therefore divide both the software and the people into parts.
Worked example: adding people to a late project
A 10-person team is behind schedule, and a manager proposes adding 5 programmers. 1. Channels now: \(\frac{10 \times 9}{2} = 45\). 2. Channels with 15 people: \(\frac{15 \times 14}{2} = 105\). 3. The increase is 60 channels, more than double, for a 50% increase in staff. 4. The newcomers also need weeks to learn the system, and the existing members must teach them, so in the short run output falls. 5. Conclusion: extra staff help only if the remaining work can be split into separate pieces that need little communication, and if there is enough time left for the newcomers to become productive.
Worked example: splitting a large team
A company has 50 developers on one product. 1. If everyone may need to talk to everyone, there are \(\frac{50 \times 49}{2} = 1{,}225\) channels. 2. Instead, divide the product into 5 parts with a team of 10 for each, and let only the 5 team leads coordinate across teams. 3. Inside each team: 45 channels, so \(5 \times 45 = 225\). 4. Between the leads: \(\frac{5 \times 4}{2} = 10\). 5. Total: 235 channels, under a fifth of 1,225. The catch is that the split only works if the software divides cleanly too, so that each team can change its part without constantly consulting the others. The topic "Modularity: coupling and cohesion" studies how to make that happen.
When software fails
Society now depends on software in banking, medicine, transport and power grids, so its faults can be costly or deadly. In the mid-1980s the Therac-25 radiation therapy machine gave several patients massive overdoses, some fatal; unlike earlier models it had no hardware safety interlocks, and it trusted software that contained a timing fault. In 1996 the first Ariane 5 rocket veered off course and was destroyed about 40 seconds after launch. Code reused from the smaller Ariane 4 converted a 64-bit floating-point value into a 16-bit signed integer, and the value no longer fitted. In 1999 NASA lost the Mars Climate Orbiter because one team's software used pound-force seconds while another expected newton-seconds.
Researchers, tools and professional bodies
Progress comes from two directions. Practitioners develop techniques for immediate use, and theoreticians look for principles that will last; many popular practical methods have later been replaced. Computer-aided software engineering (CASE) tools support the work: planning and scheduling software, issue trackers, modelling tools and, above all, integrated development environments (IDEs), which combine an editor, compiler or interpreter, debugger and testing tools in one program. Professional organisations raise standards too. The ACM, founded in 1947, and the IEEE and its Computer Society publish codes of ethics and standards, and the international standards body ISO publishes standards for software processes and quality.
Common mistakes to avoid
First, treating a large system as a small program written faster: the hard parts are communication, change and coordination, not typing. Second, assuming software ages like hardware; it fails through faults that were always there. Third, judging productivity by lines of code. Fourth, assuming more people always means faster delivery; channels grow as n(n − 1)/2. Fifth, assuming reused code is automatically safe: Ariane 5 reused tested code whose assumptions no longer held.
Key takeaways
Software engineering studies how to develop large, complex systems built by many people over long periods with changing requirements. The term was promoted around 1968 in response to a software crisis. Software differs from physical products: it does not wear out, it changes easily, it historically lacked standard parts, and it is hard to measure. A team of n people has n(n − 1)/2 possible channels, which is why Brooks's law warns against adding people to late projects. Failures such as Therac-25, Ariane 5 and the Mars Climate Orbiter show what is at stake. CASE tools, IDEs and professional bodies support the discipline.
Flashcards
Flashcard
The study of principles and methods for building large, complex software systems
Test your understanding
Question 1 of 5
A project team grows from 6 to 9 people. By how much does the number of possible communication channels increase?
Question 2 of 5
Why is mean time between failures a poor fit as a quality measure for software?
Question 3 of 5
Which is the best lesson from the Ariane 5 failure in 1996?
Question 4 of 5
A manager judges two programmers by how many lines of code each wrote this month. What is the main problem?
Question 5 of 5
What does Brooks's law say?
