0% found this document useful (0 votes)
8 views12 pages

Implementing a Program

The document outlines the steps for implementing a program, including creating source code, interpreting and compiling, linking, executing, and maintaining the program. It discusses the importance of testing and debugging to identify and fix errors, as well as the need for validation and verification to ensure data accuracy. Additionally, it highlights the significance of documenting programs for both internal understanding and external user guidance.

Uploaded by

Tequan Green
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views12 pages

Implementing a Program

The document outlines the steps for implementing a program, including creating source code, interpreting and compiling, linking, executing, and maintaining the program. It discusses the importance of testing and debugging to identify and fix errors, as well as the need for validation and verification to ensure data accuracy. Additionally, it highlights the significance of documenting programs for both internal understanding and external user guidance.

Uploaded by

Tequan Green
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Programming Implementation

Implementing a program
Objectives
• Steps to implementing a program
1. Create the source code
2. Interpret and compile
3. Link
4. Test and execute
5. Maintain the program
• Testing and debugging
• Documenting programs
1. Internal documentation
2. External documentation
Implementing a program
• N.B: Remember that the 5th and 6th step in problem solving was to test and debug the algorithm and
implement the algorithm using a programming language. This can be achieved in five steps to ensure smooth
progress:

 Create the source code: Source code is created when you write the program using a programming language.
For example, pascal & C++. The algorithm developed during the program design phase is used to guide the
source code creation activity.
Implementing a program
 Interpret and compile: Computers cannot understand a source code written in assemble or high-level programming
languages. Therefore, a translator (an assembler, complier or interpreter) is needed to convert the source code into
object code(Machine language program produced by a translator ) before it is executed by the CPU.
o Interpreters convert the source code to machine code one line at a time as the program is executing.
Interpreters need to run on the same machine that runs the source code because the program is converted
each time it runs.
o Compliers convert the entire source code into machine code in one go and creates a stand-alone program
which can run on many different computers. This make compliers more efficient than interpreters.
o If there are errors in the program it will not translate properly. If it is a syntax error, the translator will
stop and return an error message.
Implementing a program
 Link – combining various pieces of code and data together to form a single executable object code that can
be loaded in memory. Linking can be done at compile time, at load time and also at run time.
 Execute – the program is loaded into main memory and run by the processor which causes the computer to
carry out the instructions of the program.
 Maintain the program – Once you have a working program that fulfils its purpose, you should strive to
maintain it. Corrective maintenance involves fixing bugs and other flaws that may arise in the program.
Adaptive maintenance involves adding new features to the program or reconstructing the program to where it
simpler to use
o Programmers often keep versions of the programs they write. Each version is given a specific number
and is accompanied by a release note which states what is new or different about this version of the
program.
Implementing a program
Interpret and
Source Code Link Execute maintain
compile
Testing and Debugging
Programs are tested to detect errors. Errors can prevent a program from working. These includes Syntax errors, runtime
errors, logic errors.
Errors are detected when the program is being translated, when executed and when tested on paper.
Debugging is the process of fixing the errors after it has been detected.
 Syntax errors - occur when you fail to follow the rules of the programming language. Each programming language
has specific rules governing how statements are written in the language. For example, writing “begin” but no “end”.
Syntax errors within the source code will prevent the program from translating properly.
 Logic errors - occur when there is a mistake in the flow or sequence of the program. Programs with logic errors may
run but the output may be incorrect. These errors are detected by testing the program on paper and by doing a flow
chart to follow the logical flow of the program.
Example of a logic error will be using a variable in a calculation before entering the value for that variable.
 Run – time errors – occur when the program is running. It can result from not enough computer memory, program
stuck in a loop, or dividing values by 0.
Testing and Debugging
A program is tested using two methods: testing on paper and testing on the computer.

Testing on paper uses the dry run test and trace tables to detect logic errors with the program.

Testing the program on the computer by running the program using various types and combinations of data
possible to observe the program behaviour and to ensure the program works in all circumstances and conditions.

For example, if the program requires the user to enter numerical data, the program is tested to ensure any and all
numeric data is accepted. Such as negative and positive numbers, identical numbers, real numbers etc. This is
important to prevent run time errors when the program is officially used with in an organization.
Validation and Verification
Additionally, when a program is used with in an organization, it may be working fine; however, the users of the
program can enter incorrect data that may result in the program running incorrectly. To avoid this error,
programmers use validation and verification checks.
Validation is when the program checks that the data entered is valid and meets the requirements of the program.
It does not check whether the data is accurate or not.
Validation is also used to:
o Ensure data has been entered in the correct format. E.g. Date / time.
o Check that the correct data type has been used such as numeric values and not symbols.
o Check that a data field is not left blank.
Verification checks whether the data entered is accurate and correct. This is time consuming and only used when
data accuracy is crucial.
For example, a user is required to enter a 8 digit password. Validation will check that only 8 digits are entered,
not more or less. Verification will check to determine whether the password entered is accurate and correct.
Documenting Programs
• Most programs are written and used by multiple programmers. However, a program is no use to a person if
they cannot understand what the program is and what it is used for.
• Documentation is used to tell a person what a program does and how it is used.
• Internal documentation or technical documentation helps a person understand how the program works. There
are several forms of internal documentation:
o Comments is a set of notes included within the source code that are used for explaining pieces of codes,
program name etc.
o Indentations are used to group sets of statements to show the flow and structure of a program.
o White – spaces are spaces created in a program by indentation and by writing statements on multiple
lines instead of one line. White- spaces makes the program easy to read and understand.
• N.B: programmers may write their own technical guide that may contain the meaning of the mnemonics
codes used in the program, details of how the program was written, flowcharts, algorithms etc. to explain the
program to other.
Documenting Programs
• External documentation is often call user documentation or user manual. User manuals provide installation
instructions, operation instructions and any other technical specification the user needs to install and run the
program.

• Most general – purpose application have a built it help function, which is the digital copy of the user manual.
They also have wizards that guides the user through the steps when installing the program.

• NB: With each new version of the program, the user manual should be modified to incorporate the new
changes to the program.
End of Chapter

You might also like