The program development life cycle, PDLC, is an organised plan of how to create a computer program.
The PDLC follows the following stages:
For example, when you are ready to prepare your snack to take to school, you think about what you feel like eating today and then you start preparing it.
You could use the PDLC to prepare your snack:
Analysis: thinking, am I in the mood of eating something deliciously sweet? How about some savoury snack? Or just juice?
Design: planning and putting together all the necessary ingredients to prepare your snack (e.g. bread, jam, peanut butter...)
Coding: preparing the snack
Testing: take a bite to see if it is tasty (if it is not, you start all over again!)
From the snack example, we could define the steps as follows:
Analysis: identify the problem and its requirements.
Design: the process of thinking about the technical and visual aspects of the product.
Coding: this step is to actually start programming and implementing the design.
Testing: when the product is finished, we test it to find and fix the errors in the program.
The analysis stage requires:
Abstraction
Imagine that your dog got lost. In order to find him you publish the following ad on your social media networks:
Now, imagine Bob, your dog, is ill and you take him to the veterinary. You tell the veterinary:
Bob was born on the 9/9/2015. He eats twice a day, mostly dog food but we give him some of our food and drinks very little water.
Observe that in both situations you are talking about Bob but you are giving different information according to your audience.
Abstraction is the process of including only the specific details of a problem and leaving out the bits of the problem that are not necessary for the situation.
Decomposition
When you bake a cake, think of the steps involved. For example:
Prepping the required ingredients
Measuring the ingredients
Mixing ingredients
Pouring
Preheating the oven
Baking
Decomposition is the process of splitting a bigger problem (baking a cake) into smaller manageable chunks (prepping, pre-heating, mixing and baking).
The process of decomposing a problem is applied to all features of programming. Let’s now apply this analogy to a calculator program. A basic calculator has to perform the following functions:
Add number
Multiply numbers
Divide numbers
Subtract numbers
Given two numbers x and y, we would have
Add numbers : x + y
Multiply numbers : x * y
Divide numbers: x / y
Subtract numbers : x - y
We decomposed the big problem, the calculator, into smaller problems: add, subtract, multiply, divide.
Identification of the problem
Do we understand what the problem is?
Requirements
Now that we know what the problem is about, what do we need in order to find a solution?
Decomposition
Like in the analysis stage, the design stage also begins with the decomposition process.
A problem can be decomposed into its component parts: inputs, processes, outputs, storage.
Inputs
A good way to start decomposing the input subsystem is to ask yourself the following questions :
● How does it take this input? Are there any input devices the machine uses such as a keyboard, scanner, sensors?
● What kind of input does the machine need in order to work well?
● Is there more than one source of input? (For example, a computer has a keyboard and a mouse)
● Does the input depend on the output of another device?
Process
A process refers to something that requires calculations, decisions, or retrieving data.
To identify a process in the system, we should be asking questions like these :
● What exactly does the system do to get the required output? (A bread machine converts flour, eggs and water to bread - in essence it ‘mixes’ the ingredients and bakes them, making mixing and baking, its core processes)
● How does it turn its input to the intended output?
● How many tasks does it accomplish before getting the output ready?
Output
Just like what you did with the input, we got to start asking similar questions to get a deeper understanding of the output subsystems :
● What kind of output does this machine produce? Is it a document? A notification light using an LED? An alarm?
● What kind of devices does this machine use, to give its output? (If it's a document it must need a printer, if it's an alarm it must need a speaker and so on)
● Is there more than one form of output? (For example, a computer has a monitor and a speaker)
Storage
For our final storage stage, as the name implies, we are only interested in the answers to the following questions :
● Where does the data go after the output?
● Is it stored? If yes, where? On a local computer? Cloud server? Database?
● What kind of data is this machine going to store?
Structure diagrams
They represent systems made up of subsystems.
Example 1
This structure diagram represents the Animal Kingdom system which is made up of the Vertebrate and Invertebrate subsystems. At the same time, the Vertebrate subsystem is made up of the Amphibians, Reptiles and Mammals subsystems.
Example 2
Flowcharts
A visual representation of an algorithm. It indicates the inputs, processes and outputs.
The components of a flowchart are:
Input/Output
Process
Terminators
Connectors
Conditional
Example
The following flowchart enters scores of the subjects that a student took. There is a counter that controls that the program does not allow to enter more scores than the number of subjects taken. After all the scores have been entered the average is calculated.
Pseudocode
Pseudocode is a close representation of a program code but it cannot be understood by a computer. However, it is easily understood by any human being even if they are not programmers.
Example
The following pseudocode asks for two numbers and tells which one is the biggest one.
OUTPUT "Enter a number: "
INPUT number1
OUTPUT "Enter a second number: "
INPUT number2
IF number1 > number2
THEN
OUTPUT "The biggest is ", number1
ELSE
IF number1 < number2
THEN
OUTPUT "The biggest is ", number2
ELSE
OUTPUT "The numbers are equal."
ENDIF
ENDIF
This phase implements the design. It is the phase where we actually create the program.
Example
The following Python code asks for two numbers and tells which one is the biggest one.
In this phase we test our program and correct errors. If the program doesn't throw the outputs expected then we go back to the analysis or design phase.
Example
In a primary school, children are allowed to register only if they are 5 to 10 years old.
Create a test plan for this school with its likely contents:
The following are the types of test data that are usually used :
Normal data - data that is within our accepted range, for example: age is from 1 to 120
Boundary data - is the largest/smallest acceptable value and the corresponding smallest/largest rejected value
Extreme data - this is the data at the upper and lower bounds of our accepted range
Abnormal data - anything that is not accepted. For example, when the required data is numeric but we get a text response.