7.1 The program development life cycle

← Topic 6.3 Artificial intelligence (AI)Computer Science contentsTopic 7.2 Computer systems, sub-systems and decomposition →
Chapter 7 · Algorithm design and problem solving

7.1 The program development life cycle

Programs should not be written by jumping straight into code. A problem first has to be understood, then a solution is designed, coded and tested. Topic 7.1 introduces these stages and the problem-solving ideas of abstraction and decomposition.

Requirements specificationAbstractionDecompositionDesignCodingIterative testingFinal testing

The life cycle at a glance

The textbook states that the program development life cycle has five stages: analysis, design, coding, testing and maintenance. Topic 7.1, together with the later programming material, concentrates on the first four stages. Maintenance is named as part of the overall life cycle, but the supplied 7.1 section does not develop it further.

StageMain purpose in Topic 7.1
AnalysisDefine exactly what the program must do and produce a requirements specification.
DesignPlan the tasks, how each task will be carried out and how the tasks fit together.
CodingWrite the program modules in a suitable programming language.
TestingRun the completed program with different sets of test data to check that the whole solution works as specified.
MaintenanceNamed by the textbook as the fifth life-cycle stage; not expanded in this 7.1 section.
7.1.1

Analysis

Before a problem can be solved, it must be clearly defined. Everyone working on the solution needs to understand what the program is expected to do. The documented statement of what is required is called the requirements specification.

The analysis stage uses two important problem-solving tools: abstraction and decomposition.

Abstraction

Abstraction means keeping the important information needed to solve the problem and leaving out details that are not relevant. The aim is to make the problem easier to understand without losing information that matters to the solution.

Textbook Figure 7.1 showing a road map and rail map as an example of abstraction

Figure 7.1 shows the idea well. A road map and a rail map can represent the same geographical area, but each keeps different information because each serves a different purpose. A road traveller needs road routes, while a rail traveller needs stations and railway lines. Unnecessary detail is discarded.

Decomposition

Decomposition means breaking a complex problem into smaller parts. Each part can be divided again until the pieces are small enough to understand and solve more easily.

Textbook example: getting dressed

The task can first be decomposed into:

  1. Select the items to wear.
  2. Remove any clothes already being worn.
  3. Put the selected items on in the correct order.

Each of these could be decomposed further if more detail were required.

Do not confuse the two: abstraction removes irrelevant detail; decomposition breaks the problem into smaller manageable parts. They are often used together during analysis.
Check requirements, abstraction and decomposition.
7.1.2

Design

The program specification produced during analysis is used as the starting point for the design stage. By the end of design, the programmer should know:

The source states that a design can be formally documented using structure charts, flowcharts and pseudocode. These are developed further in the following parts of Chapter 7.

Exam idea: analysis answers “What does the solution need to achieve?”; design answers “How will the solution be organised and carried out?”
Check what happens during design.
7.1.3

Coding and iterative testing

During coding, the program or set of programs is developed. Each module is written in a suitable programming language and then tested to see whether it works correctly.

What iterative testing means

Iterative testing is a repeated cycle:

  1. Test a module.
  2. Identify what needs to be changed.
  3. Amend the code.
  4. Test the module again.
  5. Repeat the process until the module performs as required.

This is different from waiting until the entire program is finished before looking for faults. Testing is carried out while the modules are being developed, so problems can be corrected as the solution is built.

Key word: iterative means the process is repeated. Test → amend → retest continues until the module meets its requirements.
Check coding and iterative testing.
7.1.4

Testing

After the program or set of programs has been completed, it is run many times with different sets of test data. The purpose is to make sure that all the separate tasks and modules work together as required by the program design.

Iterative testing during codingTesting of the completed program
Focuses on individual modules while they are being developed.Checks the completed program or set of programs.
Code is tested, amended and retested repeatedly.The complete solution is run many times using different test data.
Goal: make each module perform as required.Goal: confirm that all tasks work together as specified in the design.
Important distinction: Topic 7.1 introduces testing in general. Later sections of Chapter 7 go into more detail about validation, verification, test data, trace tables and identifying errors.
Check final testing and the whole life cycle.

Topic 7.1 revision checklist

State the five stages named in the program development life cycle.
Explain the purpose of the analysis stage.
Define a requirements specification.
Define abstraction and explain why irrelevant details are removed.
Use the road-map/rail-map example to explain abstraction.
Define decomposition and explain why complex problems are broken into smaller parts.
Explain what should be known by the end of the design stage.
Name structure charts, flowcharts and pseudocode as ways of documenting a design.
Explain what happens during coding.
Define iterative testing as repeated testing, amendment and retesting of modules.
Explain why the completed program is tested with different sets of test data.
Distinguish iterative module testing from testing the completed solution.
Ready for a mixed Topic 7.1 check?
← Topic 6.3 Artificial intelligence (AI)Computer Science contentsTopic 7.2 Computer systems, sub-systems and decomposition →