Exercise 1: The seven phases in order: booking the practice rooms of a music department
The music department of a school wants its students to book its four practice rooms online, in slots of 30 minutes. The table lists seven moments of the project, out of order.
| Moment | What happens |
|---|---|
| 1 | Students report that a booking of the last slot of the day, at 21:30, disappears. A programmer corrects the program, and version 1.1 is installed. |
| 2 | The program is installed on the department's server, and the music teacher is shown how to cancel a booking. |
| 3 | The music teacher explains the problem: two bands often arrive at the same room at the same time. |
| 4 | The inputs (student number, room, day, slot), the outputs (a confirmation, or the reason for a refusal) and the rules (at most 2 slots per student per day) are written in a specification, which the teacher signs on October 3. |
| 5 | A flow chart of the booking check and a structure chart of the modules are drawn. |
| 6 | The modules are written in Python, each with a comment under its header. |
| 7 | Each row of a test plan is run: input data, expected outcome, actual outcome, pass or fail. |
- a) The cycle has seven phases, listed here in alphabetical order: analysis, design, implementation, maintenance, problem definition, testing, writing code. Give the rank, from 1 to 7, of the phase of moments 3, 4 and 5 in the cycle.
- b) Give the rank of the phase of moments 6, 7, 2 and 1.
- c) A student writes in the project log: « Moment 7 is done and every test passes, so the project is finished. » How many phases of the cycle come after testing? Which of them lasts as long as students use the program?
- d) Which row of the test plan would have revealed the bug of moment 1 before installation? In which phase is the bug corrected, now that the program is in use?
- e) Say whether each item is a phase, a milestone or a product of the cycle: the signature of the specification on October 3; the flow chart of moment 5; the bug report sent by the students in moment 1.
Show the solution
Answers
- a) moment 3: rank 1, problem definition; moment 4: rank 2, analysis; moment 5: rank 3, design
- b) moment 6: rank 4, writing code; moment 7: rank 5, testing; moment 2: rank 6, implementation; moment 1: rank 7, maintenance
- c) 2 phases; maintenance
- d) a booking of the last slot, 21:30; maintenance
- e) a milestone; a product; a product
The life cycle orders the work on a program. Each phase answers one question and hands a product to the next: problem definition says what is wrong, analysis states what the program takes in, does and gives out, design says how, on paper, writing code turns the design into a program, testing compares the program with the specification, implementation puts it in the hands of its users, and maintenance corrects and changes it while it is used.
Moment 3 states the problem in the words of the user: problem definition, rank 1.
Moment 4 writes inputs, outputs and rules in a specification: analysis, rank 2.
Moment 5 draws how the program will work, before any code: design, rank 3.
Moment 6 is writing code, rank 4, and moment 7 runs the test plan, testing, rank 5.
Moment 2 puts the program on the server and shows its user how to work it: implementation, rank 6.
Moment 1 corrects a program already in use and installs a new version: maintenance, rank 7. The figure puts the seven moments back in order.
Two phases come after testing: implementation, then maintenance.
Maintenance lasts as long as the program is used: every correction and every change asked by its users belongs to it.
Pitfall: ending the cycle at testing. A program that passes its tests still has to be installed, and its users will try cases that the test plan did not.
The bug touches the last slot of the day, a boundary of the slots. A row with a booking at 21:30 would have shown it during testing; a booking at 16:00 tries an ordinary slot, which works.
The program is now in use, so the correction belongs to maintenance. The row at 21:30 joins the test plan, so that version 1.1 and the versions after it are tried on it.
A phase is a period of work, a milestone is a date that marks the end of a step, a product is a document or a program that a phase hands on.
The signature on October 3 is a milestone: it closes the analysis. The flow chart is a product of the design. The bug report is a product too, the one that starts the work of maintenance.