Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

PROGRAMMING METHODOLOGIES

Program: series of instructions organized in a logical manner.

Problem Solving Process


To solve a problem by computer, one goes through the basic steps indicated below
a) Defining the problem
b) Designing the solution
c) Writing the program
d) Compiling, debugging and testing the program
e) Documenting the program

a) Defining the problem


Here, one starts by collecting information about the problem from the problem owner. One
then analyzes the problem very well in order to understand what is required to solve it, e.g.,
software, hardware etc. He then goes ahead to define what output is required, e.g., reports
to be generated. One would thereafter, define the input required to provide the required
output, e.g., user-interface, and then go into establish the processing requirements, e.g.,
algorithms and data structures required to solve the problem.

 Recognize the need for information – collect info from the problem owner.
 Analyze the problem very well in order to understand what is required of its solution –
s/w, h/w, etc.
 Define what output is required – reports to be generated.
 Define the input required to provide the required output - user-interface.
 Establish the processing requirements – algorithms and data structures.

b) Designing a solution
Programming involves three basic logic patterns as indicated below.

Simple sequence
Here, events follow one after the other as indicate by the sketch below.

1
Selection
As indicated in the sketch below, selection involves branching or choosing an alternative

No Yes

Looping
As indicated in the diagram below, looping involves repeating statements visited earlier.

No Yes

Before writing the program, one may be required to develop the algorithm or Pseudo code
for the problem. By Pseudo code, we refer to English-like statements or narrative
descriptions of processing steps to be performed in the program.

2
If the problem is complex, a flowchart, i.e., block diagram of the logic to be captured in the
program may be required. A flowchart provides a visual frame of reference to the
processing steps in the program. Some of the symbols used in flowcharting are given below.

Start/stop

Process

Input/output

Decision

Data flow

Writing the program


The program is written in a specific programming language such as C. The statements in a
program can be grouped into various types as indicated below

a) Comments
These are statements that improve the readability of the program. The computer is
required to ignore them since they are not executable.

b) Declarations
Declaration are statements that give the data types of the items to be used in the program
e.g., variables.

c) Input/output
d) Computation
e) Transfers of control, e.g., GO TO
f) Comparisons, e.g., if … then …

Desirable program qualities


a) Easy to read and understand
b) Efficient
c) Reliable
d) Robust
e) Maintainable
f) Integrity
3
g) Clarity
h) Modularity

Compiling, debugging and testing


Programs written in high level languages should be compiled/translated. Compiling checks for
syntax errors and create an object code. The latter is a machine readable form. Debugging
is the process of checking, isolating and removing errors in a program. Form of testing
entails: unit testing, integration testing, system testing, acceptance testing etc

Documenting the program


Consists of written descriptions and explanation of programs and other materials associated
with an organization’s data processing systems. It simplifies modification and updating of
existing programs and system procedures. Used as a reference material for updating and
future work. Can be used for training end users.

Structured design methodology


Top-down design

Modular approach to problem solving


A problem solution is defined in terms of the functions it must perform
Each step or module in the solution process consists of one or more logically related
function. Thus top-down design is a method organizing a solution by defining it in terms of
major functions to be performed and further breaking these major function into sub-
functions. When top-down design is used, first, each module should be independent of other
modules; each module should be relatively small to facilitate the translation of modules into
program statements; each module should have one entrance and one exit point.

Objectives of structured programming


 To reduce testing time
 To increase programmer productivity
 To increase clarity by reducing complexity
 To decrease maintenance time and effort

You might also like