Lesson Notes — The Program Development Life Cycle (Plan → Design → Code → Test → Debug → Document)
Course 3: Introduction to Programming / Unit 1: What Is Programming & Program Development Life Cycle (PDLC) / Lesson 2: The Program Development Life Cycle (Plan → Design → Code → Test → Debug → Document)
Lesson overview
Professional programmers do not just sit down and start typing. They follow the Program Development Life Cycle (PDLC), a set of phases that helps teams build software that works and that other people can understand. Skipping the early phases usually costs more time later, when mistakes are harder to fix.
The phases
- Plan. Decide what problem the program solves, who will use it, and what it must do. Write down the inputs (what goes in) and the outputs (what comes out).
- Design. Map out the solution before you code. Programmers use pseudocode, which is plain-language steps that look like code, and flowcharts, which are diagrams of the steps and decisions.
- Code. Write the program in a programming language, following your design.
- Test. Run the program with many different inputs to see whether it does what the plan says. Try normal cases and unusual ones.
- Debug. When a test fails, find the cause of the bug and fix it. Then test again.
- Document. Explain how the program works and how to use it. Add comments in the code and write instructions for users.
After a program is released, maintenance continues. Programmers fix new bugs, update features, and keep the program working as devices change. The PDLC is a cycle, not a straight line, and testing often sends you back to design or code.
Example: a tip calculator
Plan: A customer enters a bill and a tip percentage, and the program shows the total.
Design (pseudocode):
ASK for the bill amount
ASK for the tip percent
tip = bill x (percent / 100)
total = bill + tip
SHOW total
Test: Check results that you can work out by hand.
| Bill | Tip percent | Expected total |
|---|---|---|
| $50 | 20 | $60 |
| $100 | 15 | $115 |
| $0 | 20 | $0 |
Debug: If the program shows anything other than $60 for the first row, you have found a bug. Trace each step of your design until you find where the numbers go wrong.
Check your understanding
- Why is it usually faster to plan before you code?
- What is the difference between testing and debugging?
- Write pseudocode for a program that asks for a temperature in Celsius and shows it in Fahrenheit. Hint: multiply by 9/5, then add 32.
Use the Key Terms page for this lesson to build your glossary, and write each definition in your own words.