Program Development
Program Development
Program Development
atikaschool.org/kcse-computer-studies-questions-and-answers-836310/program-development
1. Program development
1. Problem recognition
2. Problem definition
3. Program design
4. Program coding
5. Program testing
6. Implementation
PROGRAM DEVELOPMENT.
The process of program development can be broken down into the following stages:
Problem recognition.
The programmer must know what problem he/she is trying to solve. He/she must also
understand clearly the nature of the problem & the function of the program.
In order to understand a problem, look for the keywords such as compute, evaluate,
compare, etc.
Usually, a programmer identifies problems in the environment and tries to solve them
by writing a computer program.
There are 3 situations that cause the programmer to identify a problem that is worth
solving:
1/12
Sample problem: Develop a program that can be used to calculate/find the area of a
circle. Use the equation A = π * r2.
The programmer should write a narrative on what the program will do, and how it is
meant to achieve the intended purpose. Within this narrative, he/she is required to
determine what data is to be input & what information is to be output.
For example:
In calculating the area of any circle, the parameters needed to determine the area of
any circle are:
1. Input:
1. Pie (π) which is a constant.
2. The radius of the circle.
2. Process: The formula for calculating area of a circle, which is π * radius *
radius.
3. Output: The area of the circle (A).
At the end of the problem definition, the programmer is required to write a requirements
report/document for the new program. This document will enable the programmer to
come up with a program design that meets the needs at hand. Note. Problem
definition should be done thoroughly to ensure user satisfaction, and to facilitate the
subsequent stages in the program development cycle. A failure at this stage usually
results in a system that will not work as intended, or that may not work at all.
Program design
Program design is the actual development of the program’s process or problem solving
logic called the Algorithm.
It involves identifying the processing tasks required to be carried out in order to solve
the problem.
The design stage enables the programmer to come up with a model of the expected
program (or a general framework (outline) of how to solve the problem, and where
possible, break it into a sequence of small & simple steps.
The models show the flow of events throughout the entire program from the time data
is input to the time the program gives out the expected information.
The processing tasks must be in order & systematic. Therefore, the programmer
identifies the processing tasks required, and the exact order in which they are to
be carried out.
2/12
The design process does not take account of the programming language to be
used in the final product, since it only defines program logic.
Program design provides for easy maintenance.
Note. It is important to design programs before entering them into the computer. The
programmer should only attempt to covert a design into a program code after ensuring
that it is logically correct. If possible, check the logical order on the desk.
Some programmers produce rough & ready solutions at a Keyboard, and continue to
amend the programs until eventually the program appears to do what was expected.
This is not recommended in programming because of the following reasons:
1. The final code may not be easy to follow, since it was just cobbled together.
2. Variable names & specific items of code may not be documented.
3. Programs produced by continuous amendments & changing of codes mostly lead
to unforeseen side effects.
E.g., there may not have been plan for testing the program or procedures, hence,
the program may easily fail.
4. A programmer may be asked to modify the code at a later date. Without sufficient
documentation, the programmer will be forced to trace through the program in
order to gain an insight into how the program functions.
Modular programming
Many programs are non-monolithic (i.e., they are not usually made up of one large
block of code). Instead, they are made up of several units called modules, that work
together to form the whole program with each module performing a specific task.
This approach makes a program flexible, easier to read, and carry out error correction.
Program coding
Program coding is the actual process of converting a design model into its equivalent
program.
Coding requires the programmer to convert the design specification (algorithm) into
actual computer instructions using a particular programming language.
For example;
The programmer may be required to write the program code either in Pascal, C++,
Visual Basic or Java, and develop (invent) suitable identifiers, variable names, & their
data types. However, remember that, at this stage the coding is still a Pencil & paper
exercise.
The end result of this stage is a source program that can be translated into machine
readable form for the computer to execute and solve the target problem.
3/12
6. Avoid tricks – write the program using straightforward codes that people can
readily understand.
7. Modularize your program.
Example 1:
Develop a program code that would be used to solve the equation of a straight line
given by the expression: Y = mx + c
BEGIN
Writeln (‘Input the value of M’);
Readln (M);
Y: = (m * x) +c;
Writeln (‘The value of y is:’, Y);
END.
4/12
When the program is running, a Read/Readln statement in the code will displays
blinking cursor that indicates to the user where to type the input.
Y: = (m * x) +c; Calculates the value of y. in Pascal, the symbol ‘: =’ is called the
Assignment statement.
The values on the right are calculated then the answer stored in the variable y which is
on the left of the assignment symbol.
Writeln (‘The value of y is:’, Y); The Writeln displays the value held in the variable y
on the screen.
Note. Y is not within the inverted commas.
END. The ‘END.’ statement shows the end of a program.
Example 2:
VAR
Radius, Area: REAL;
BEGIN
Writeln (‘Enter the radius’);
Readln (Radius);
END.
After designing & coding, the program has to be tested to verify that it is correct, and
any errors detected removed (debugged).
5/12
TESTING:
Testing is the process of running computer software to detect/find any errors (or bugs)
in the program that might have gone unnoticed.
Note. The testing process is a continuous process, and it ends only when the
Programmer & the other personnel involved are satisfied that when operational, the
program will meet the objectives and the growing demands of the organization.
1. Syntax errors.
2. Run-time (Execution) errors.
3. Logical (arithmetic) errors.
4. Semantic errors.
5. Lexicon errors.
Syntax errors
Every programming language has a well-defined set of rules concerning formal
spellings, punctuations, naming of variables, etc. The instructions are accepted only in
a specified form & and must be obeyed by the programmer.
Syntax errors are therefore, programming errors/mistakes that occur if the grammatical
rules of a particular language are not used correctly.
Examples:
1. Punctuation mistakes, i.e., if the programmer does not use the right punctuations
& spaces needed by the translator program, e.g., omitting a comma or a
semicolon.
2. Improper naming of variables.
3. Wrong spellings of user defined and reserved words.
Reserved words are those words that have a special meaning to the programming
language, and should not be used by the programmer for anything else.
Syntax errors are committed by the programmer when developing, or transcribing the
program, and can be detected by the language translators, such as the Compiler as it
attempts to translate a program. Such errors must be corrected by the programmer
before the program runs.
6/12
Logical errors relate to the logic of processing followed in the program to get the
desired results. E.g., they may occur as a result of misuse of logical operators.
Logical errors cannot be detected by the translator. The programmer will detect them
when the program results are produced.
The program will run, but give the wrong output or stop during execution.
Run-time (execution) errors occur when the programmer introduces new features in the
program, which are not part of the translator’s standards.
Execution errors are not detected by the translator programs, but are detected by the
computer during execution. Sometimes, execution errors may lead to premature end of
a program.
To detect and eliminate Execution errors, a test run should be performed on the
program after it has been translated.
Semantic errors.
These are meaning errors. They occur when the programmer develops statements,
which are not projecting towards the desired goal. Such statements will create
deviations from the desired objectives.
Semantic errors are not detected by the computer. The programmer detects them
when the program results are produced.
Example;
In the 1st statement, if the selection is between 1500 & 2200, the computer will pick
only 1500 & 2200, and the other values will not be touched.
In the 2nd statement, the computer will be able to pick all the values between 1500 &
2200 because of the ‘AND’ operator.
Lexicon errors.
7/12
These are the errors, which occur as a result of misusing Reserved words (words
reserved for a particular language).
Revision Questions.
1. State the three types of errors that can be experienced in program testing, and
how each can be detected.
2. Syntax errors can be detected by the help of translators while logical errors are
detected differently. Explain FIVE methods which can be used to detect Logical
errors.
DEBUGGING:
The term Bug is used to refer to an error in a computer program.
Most programming errors often remain undetected until an attempt is made to translate
a program.
There are several methods of testing a program for errors. These include:
It involves going through the program while still on paper verifying & validating its
possible results. If the final results agree with the original test data used, the
programmer can then type the program into the computer and translate it.
Dry running helps the programmer to identify the program instructions, detect the
most obvious syntax and logical errors, & the possible output.
Dry running is much faster. This is because; it involves the use of human brain as
the processor, which has got a well inbuilt common sense.
8/12
Translator system checking:
This is a type of testing, which involves the computer & the translator programs.
After entering the program, it is checked using a translator to detect any syntax errors.
The translator can be a Compiler or an Interpreter, which goes through the set of
instructions & produces a list of errors, or a program/statement listing which is free from
errors.
The programmer invents simple test data, which he/she uses to carry out trial runs of
the new program. At each run, the programmer enters various data variations including
data with errors to test how the system will behave. For example, if the input required
is of numeric type, the programmer may enter alphabetic characters. The programmer
will then compare the output produced with the predicted (actual) output.
Notes.
Where possible, the program should be tested using the same test data that was
used for desk checking. More strict/rigid tests should be applied on the program
in order to test the program to its limits.
Only Logical errors & Semantic errors can be corrected by the programmer using
test data.
A good program should not crash due to incorrect data entry but should inform
the user about the irregularity and request for the correct data to be entered.
9/12
Implementation and Maintenance.
IMPLEMENTATION
Implementation refers to the actual delivery, installation and putting of the new program
into use.
The program is put into use after it is fully tested, well documented, and after training
the staff who will be involved in the running of the new program.
Once the program becomes operational, it should be maintained throughout its life, i.e.,
new routines should be added, obsolete routines removed, & the existing routines
adjusted so that the program may adapt to enhanced functional environments.
Correcting errors that may be encountered after the program has been
implemented or exposed to extensive use.
Changing procedures.
Hardware and software maintenance.
Changing parameters and algorithms used to develop the original programs.
Making any adjustments as new technology comes.
Program documentation.
After writing, testing, and debugging a program, it must be documented. In other
words, the programmer should describe all what he was doing during the program
development stages.
Note. All the program development activities (i.e., from the initial stage up to the
complete program) should be documented/recorded in order to assist in the
development of the program, future modification of the program, general maintenance,
machine & software conversion at a later date, and program changeover.
10/12
External documentation refers to reference materials such as user manuals printed as
booklets.
Review Questions.
1. What is program designing?
2. (a). Define program documentation.
(b). What does a program documentation contain?
11/12
3. Briefly explain how each of the following documents are useful in programming?
(a). User manual / guide.
(b). Reference guide.
(c). Quick reference guide.
4. Program documentation is different from Implementation. Explain.
5. Outline and briefly explain the stages involved in program development.
12/12