Faculty of computing and information management
Programming methodology
Lecturer: Mr. HAGGAI
Lesson 3: Program development life cycle
3.1. Introduction
In our previous lesson, we discussed various programming paradigms. In our
today’s lesson we will be discussing program development life cycle and then
summarize this into three phases often referred to problem solving phases.
3.2. Lesson objectives
By the end of this lesson the learner will be able to:
Identify and describe activities of program development life cycle
Group the activities of program development cycle into problem solving
phases
3.3. Lesson outline
This lesson is organized as follows:
3.1. Introduction
3.2. Lesson objectives
3.3. Lesson outline
3.4. Program development life cycle
3.5. Problem solving phases
3.6. Structured programming concepts
3.7. Program design
3.8. Revision questions
3.9. Summary
3.10. Suggested reading
3.4. Program development life cycle
A program is a set of instructions that a computer can read and execute.
The programs are written to solve problems or perform a task on a
computer. Often a program is known as a project, application or a solution.
The programmers plan their programs using a sequence of steps called
program development life cycle. This cycle provides a set of phases and steps
that are followed by developers to define, design, develop and maintain a
computer program.
[i]. Analysis and specification
[ii]. Design the program
[iii]. Design the interface
[iv]. Code the program
[v]. Test the program
[vi]. Document the program
[vii]. Maintain the program
Description of steps involved in program development life cycle
[i]. Analyze and specification: Define the problem. Understand the inputs, the
required processing and expected output.
1
[ii]. Design the program: Plan the solution to the problem. Then, define the
logical sequence of precise steps to solve the problem (Algorithm). The
logic plan can be developed using the three methods: flowcharts, pseudo
codes etc.
[iii]. Design the interface: Determine how the inputs will be obtained and how
the output will be displayed.
[iv]. Code: Translate the algorithm into programming language. In this stage
the programmer will use the algorithm in step [ii] and a given
programming language.
[v]. Test and debug: Locate and remove any errors in the program. Testing is
the process of finding errors in the programs. Debugging is the process of
correcting errors that are found. An error in a program is called a bug.
[vi]. Documentation: Organize all the material that describes the program i.e.
allow another person at a later date to understand the program. Can be
internal documentation (e.g. comments) or user manuals.
[vii]. Maintain the program: This involves training and supporting users as
well as correcting any errors that may arise in future. When the cost of
maintenance exceeds the benefits of the system, the cycle begins again.
3.5. Programming process
There are three phases in programming process
[a]. Problem solving phase
[b]. Implementation phase
[c]. Maintenance phase
The following is the description of the programming process or problem
solving stages. [a]. Problem solving phase This phase has three stages
[i]. Analysis and specification stage: In this stage programmers must understand
(define) the problem and what the solution must do.
[ii]. General solution (algorithm): Programmers must specify the required data
types and the logical sequence of steps that solve the problem.
[iii]. Verify: Programmers must follow the steps exactly to see if the solution
really does solve the problem.
[b]. Implementation phase
There are three stages in this
phase:
[i]. Concrete solution (program): Translate the algorithm (general solution) into a
program using a programming language.
[ii]. Test: Allow the computer follow the instructions, then manually check the
results. If errors are found analyze the program and the algorithm to
determine the source of the error and make corrections.
[iii]. Documentation: Add comments in the code and also create documentation
of the whole system.
[c]. Maintenance phase
There are two activities involved in this phase:
[i]. Use: Use the program to solve the problem.
[ii]. Maintain: Modify the program to meet changing requirements or correct any
errors that show up while using the program.
2
3.6. Structured programming concepts
Structured programming can be defined as follows:
Programming without the use of GOTO.
A method of designing computer system components and their relationships
to minimize complexity.
Structured programming minimizes complexity in three ways:
[i]. Using top down analysis for solving the problem.
[ii]. Modularization of program structure and organization.
[iii]. Uses structured code for the individual modules.
The above strategies for minimizing complexity can be described as follows:
[i]. Top down analysis for problem solving
A program is written to tell the computer what to do. The job you want the
computer to do is referred to as a problem. Before you tell the computer what to
do, you must solve the problem yourself, this is called problem analysis. For big
problems, developing a solution can be very complicated. As a result, using top
down approach helps the programmer in the entire process. The problem is
subdivided into smaller tasks or parts. This simplifies the complexity of the
problem. [ii]. Modular programming for program structure
Programs require many instructions for the computer. Modular programming is a
method used to organize these instructions. Large programs are broken down into
separate, smaller sections called modules, subroutines or subprograms. Each
module has a specific job to do and is relatively easy to write. Thus modular
programming simplifies the task of programming by making use of highly structured
organizational plan.
[iii]. Structured coding for each module.
Programs are divided into modules and the modules can be subdivided further.
Each module will consist of instructions and these instructions are organized for
execution in some pattern using various control structures. The control structure
will represent a unique pattern of execution for a specific set of instructions. It
determines the order in which that set of instructions is executed. The component
statements within a specific control structure are executed sequentially, selectively
or repetitively. Using structured code reduces program complexity because the
program instructions are organized into distinct patterns.
3.7. Program design
[a]. Analysis and specification stage:
Programmers must understand (define) the problem and what the solution must
do. Computer programming involves solving problems. Decompose the problem
description. This is done using syntactic analysis.
i). Identify all the nouns in the sentence(s). Nouns identify descriptions of
information that you will either identify or keep track of(inputs and outputs).
ii). Identify all the verbs –these identify the actions that the program will perform
(processing).
iii). Link the inputs, processes and outputs.
iv). Use external knowledge to complete the solution e.g. formulating an equation.
[b]. General solution (algorithm):
Programmers must specify the required data types and the logical sequence of
steps that solve the problem. An algorithm is a finite sequence of steps for
accomplishing some computational task.
Characteristics of algorithms
3
A good algorithm must satisfy the following characteristics
[i]. Ordered: The steps must be properly ordered and logical
[ii]. Concise: The steps must be unambiguous
[iii]. Finiteness: The steps must be finite: start and end at
some point.
[iv]. Input: The inputs must be clearly specified
[v]. Output: The expected results must be
specified.
[vi]. Effectiveness: The steps specified must
be doable.
How develop an algorithm
To develop an algorithm, the following steps must be necessary:
[i]. Define the problem to solve.
[ii]. Specify the inputs
clearly.
[iii]. Specify the expected
outputs.
[iv]. Describe the steps needed to convert or manipulate inputs to produce
outputs (Processing).
[v]. Test the algorithm: Choose data sets and verify the algorithm works.
Tools for designing algorithms
To develop an algorithm a number of tools can be used:
[i]. Flowchart
[ii]. Pseudo code
[iii]. Top down chart/Hierarchy charts
[iv]. Decision tables
Flowchart
This is a graphical representation of the logical steps needed to carry out a task.
Makes use of symbols to represent the steps.
SYMBOL NAME USES
Flow line To show progress to the
next step
Terminal To show start or of task
Input/output To show input or output
operation e.g. reading or
displaying
Processing Used for arithmetic and
data manipulation
operations
Decision Used for logic or
comparison operations.
4
Connector Used to join different flow
Advantages of flowchart
Flowcharts are a better way of communicating the logic of the system.
With the help of a flowchart, problem can be analyzed easily.
They serve as a good program documentation.
They help in program debugging.
Disadvantages of flowchart
For a complex problem, the flowchart becomes complex and clumsy.
If alterations are required, the flowchart may require redrawing completely.
The flow chart symbols cannot be typed and so reproduction of a flowchart
becomes difficulty.
Guidelines for drawing a flowchart
List all necessary requirements in a logical order.
The flowchart must be neat, clear and easy to follow.
The flowchart is read from left to right and top to bottom.
A process symbol can have only one flow line coming out of it.
For a decision symbol, only one flow line can enter it but multiple lines can
leave it to denote possible answers.
Terminal symbols can only have one flow line in conjunction with them.
Example: Using a flowchart design an algorithm to test if temperature is greater
than 32 degree Celsius. If it exceeds 32 then print “cover tomatoes” otherwise
“uncover tomatoes”.
Pseudo code
It is a representation of an algorithm using natural language statements e.g.
structured English. It describes the entire logic of the algorithm.
It is not an executable code.
Guidelines for developing algorithm using
pseudo code: Identify the inputs,
processes and outputs
Use natural language e.g. English.
Present the statements in clear details.
5
The variables must be descriptive.
Each activity appears in a single line
The steps must be numbered.
Advantages of pseudo code
Reduced complexity
Easy to understand
Easy to translate to code
No special symbols required
Saves time spent during coding, testing and debugging.
Disadvantages of pseudo code
Can be ambiguous because it uses natural language.
Pseudo code has few rules and it is hard to standardize.
The pseudo code focuses on details than the bigger picture of the algorithm.
3.8. Revision questions
a) Compare and contrast flowchart and pseudo code as algorithm
development tools.
b) Describe the THREE phases of program development typical in
structured programming.
c) Identify the flow chart symbols in each case.
i). Compare x and y integer values
ii). Enter value of x and y
iii). Multiply value of x with 5 and subtract 4 from the product
iv). Display the result of 5x-4
3.9. Summary
In this lesson you have learnt that program development life cycle is a framework
that describes the activities performed during program development process. You
have also learnt that these activities can be placed into three categories referred to
as programming process: Problem solving phase; Implementation phase and
maintenance phase. You have also learnt about problem solving approaches used in
structured programming. Finally you have learnt how to design a program using
flowchart and pseudo code.
3.10. Suggested reading
[1]. An introduction to programming by Wu Thomas, Norman and Theodore: McGrill
(1997).
[2]. C programming language by Brian W. Kernighan, Dennis Ritchie, 2 nd ed:
prentice hall(2003). [3]. C how to program by H.M. Deitel and [Link], 3 rd ed:
Prentice hall(2001).