Ways of working · lesson 1 of 10
Ideas in this lesson
ACode and fixwrite, run, fix, repeat, with no other plan
BSoftware crisisthe 1960s name for projects late, over budget and unreliable
CSoftware engineeringthe name chosen in 1968 for doing it with discipline

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:

[no]try again[yes][yes][no]Have an ideaWrite some codeRun itDoes itwork?Fix whatbrokeWantmore?Hand it over

Press Walk through it to follow the work round the chart, one stop at a time.

  1. Start: an idea.
  2. Write some code, then run it.
  3. Does it work? If not, fix what broke and run it again (a loop back).
  4. If it works: want more? If yes, back to writing code (a loop back).
  5. If not: hand it over. There’s no step for requirements, design or planned testing.
Code and fix as a UML activity diagram. In UML’s notation: the filled dot is where it starts and the ringed dot where it ends; rounded boxes are actions; a diamond with a question is a decision, with the condition for each way out in [brackets], and an empty diamond is a merge, where a way back joins the flow; Pink arrows go back to an earlier action.

What breaks as it grows

Watch what happens as the same habit meets a growing program:

The program1 block of codeHours for one small change1 hourIllustrative: real numbers vary, the shape doesn’t.
1 of 6 Round 1. One person writes a small program, runs it and fixes what’s wrong. A change takes an hour. Nothing else breaks: there’s nothing else.

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"

Spot the trapMarco

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

When is code and fix a sensible way to work?
Why does each change cost more in a code-and-fix project as it grows?
What happened at Garmisch in 1968?

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.

All sources for Simple Software Development