Code and fix
Last updated
The first programs were written the simplest way: write some code, run it, fix what's wrong, repeat. That still works for a small program and one person. In this lesson you'll see why it stops working as programs and teams grow, and how a conference in 1968 gave the answer its name: software engineering.
By the end of this lesson you can
- Describe the code-and-fix way of working, and when it’s enough
- Explain what breaks as programs and teams grow
- Say what the 1968 NATO conference was and why it matters
Write it, run it, fix it
The oldest way to make software has no plan at all: write some code, run it, fix whatever's wrong, and go round again until it seems to work. Barry Boehm, describing the history of life-cycle models in 1988, called it the code-and-fix model, and said it was the basic model of the earliest days of programming.
It isn't foolish. For a program one person writes in an afternoon, for themselves, code and fix is exactly right: the requirements are in the programmer's head, the test is "did it work?", and there's nothing to maintain. Lesson 1.7's weekend script works this way.
This course draws each model as a UML activity diagram, the flowchart of the Unified Modeling Language, the standard notation for drawing software: a filled dot where the work starts, rounded boxes for actions, diamonds for decisions with the condition for each way out in [brackets], empty diamonds where a loop comes back in, and a ringed dot where it ends. Drawn that way, the whole method is two questions and two loops:
Press Walk through it to follow the work round the chart, one stop at a time.
- Start: an idea.
- Write some code, then run it.
- Does it work? If not, fix what broke and run it again (a loop back).
- If it works: want more? If yes, back to writing code (a loop back).
- If not: hand it over. There’s no step for requirements, design or planned testing.
What breaks as it grows
Watch what happens as the same habit meets a growing program:
Boehm named three problems with code and fix as programs grow:
- The code gets harder to change. After a few rounds of fixes, nobody planned how the parts fit, so each change costs more than the last.
- It may not be what anyone needed. With no requirements, the program can be well made and still rejected by its users (lesson 1.3).
- It's hard to test and fix. Nobody prepared for testing or changes, so both are slow and expensive.
Add a second programmer, and a third, and the problems multiply: there's no shared picture of the program except the code itself.
1968: a crisis gets a name
By the late 1960s, computers were powerful enough for very large programs, and projects to build them were late, over budget and unreliable. People called it the software crisis.
In October 1968, the NATO Science Committee brought about fifty experts from universities and industry together in Garmisch, Germany, to talk about it. The conference's name was chosen to provoke: software engineering. The idea was that making software should be done with the discipline of an engineering field: planned, designed, checked and managed, not just written.
The report, edited by Peter Naur and Brian Randell and published in 1969, is still free to read. It describes problems every team in this course will recognise: estimates that are always wrong, specifications that change, testing that comes too late, and the difficulty of large teams. Every method in this stage is an answer to the questions it raised.
Spot the trap: "process slows you down"
Marco says: “I wrote the first version of the queue in a weekend, no process at all. All this planning would just slow Pila down.”
What happens if…
Check what you learned
Sources
Every claim on this page comes from these sources: the standard, the founding text of a method, a study, or the official record of a project, from the body that publishes it. Industry reports are labelled as such.
- Peter Naur and Brian Randell (eds.), Software Engineering: Report on a conference sponsored by the NATO Science Committee, Garmisch, 1968 (1969): the conference reports, made available by one of their editors
- Barry Boehm, “A Spiral Model of Software Development and Enhancement”, IEEE Computer (1988): opens with the code-and-fix model and its problems
- Object Management Group: Unified Modeling Language (UML) 2.5.1: activity diagrams: initial and final nodes, actions, decisions, merges and guards