COM 113 Lecture 3

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 12

FEDERAL COLLEGE OF AGRICULTURAL PRODUCE

TECHNOLOGY, KANO
DEPARTMENT OF COMPUTER SCIENCE

COURSE TITLE:
INTRODUCTION TO PROGRAMMING
COURSE CODE: COM113 LECTURE 3

UNIT :- 4 CREDIT UNIT


CONTACT: myclassatfcapt2020@gmail.com

1 1
INTRODUCTION TO PROGRAMMING

• PROGRAMMING PROCESS
• Before computer program is successfully written,
documented and installed, it must have passed through
the following stages. Each stage has something to
contribute to the accomplishment of the whole task.
• The programming process consists of several steps, which
include design, creation, testing, and debugging activities.

1 2
INTRODUCTION TO PROGRAMMING

• PROGRAMMING PROCESS
• 1. Define what the program is to do.
• 2. Visualize the program running on the computer.
• 3. Use design tools to create a model of the
program.
• 4. Check the model for logical errors.
• 5. Write the program source code.
• 6. Compile the source code.
1 3
INTRODUCTION TO PROGRAMMING
• PROGRAMMING PROCESS
• 7. Correct any errors found during compilation.
• 8. Link the program to create an executable file.
• 9. Run the program using test data for input.
• 10. Correct any errors found while running the
program.
• Repeat steps 4 through 10 as many times as
necessary.
• 11. Validate the results of the program.
1 4
INTRODUCTION TO PROGRAMMING
• What Is Software Engineering?
• The field of software engineering encompasses the complete process of
crafting computer software. It includes designing, writing, testing,
debugging, documenting, modifying, and maintaining complex software
development projects. Like traditional engineers, software engineers use
a number of tools in their craft. Here are a few examples:
• • Program specifications
• • Charts and diagrams of screen output
• • Hierarchy charts
• • Pseudo code
• • Examples of expected input and desired output
• • Special software designed for testing programs

1 5
INTRODUCTION TO PROGRAMMING
• LEVELS OF COMPUTER PROGRAMMING LANGUAGES
• 1. Low level language
• 1.1 Machine Language
• 1.2 Assembly Language
• 2. High Level Language
• high Level Language Translators
• 1. Compiler
• 2. Interpreter

1 6
INTRODUCTION TO PROGRAMMING
• DEBUGGING AND MAINTAINING PROGRAM
• Debugging is the art of diagnosing errors in programs and
determining how to correct them. "Bugs" come in a variety of
forms, including:
• coding errors
• design errors
• complex interactions
• poor user interface designs
• system failures.

1 7
INTRODUCTION TO PROGRAMMING
• DEBUGGING AND MAINTAINING PROGRAM
• SOURCES OF BUGS IN A PROGRAM
• With coding errors, the source of the problem lies with the person who
implements the code. Examples of coding errors include:
• Calling the wrong function ("moveUp", instead of "moveDown")
• Using the wrong variable names in the wrong places ( "moveTo(y, x)" instead of
"moveTo(x, y)")
• Failing to initialize a variable ( "y = x + 1", where x has not been set)
• Skipping a check for an error return
• · Failure to hide complexity
• · Incomplete or ambiguous "contracts"
• · Undocumented side effects

1 8
INTRODUCTION TO PROGRAMMING
• DEBUGGING AND MAINTAINING PROGRAM
• SOURCES OF BUGS IN A PROGRAM
• With coding errors, the source of the problem lies with the person who
implements the code. Examples of coding errors include:
• Calling the wrong function ("moveUp", instead of "moveDown")
• Using the wrong variable names in the wrong places ( "moveTo(y, x)" instead of
"moveTo(x, y)")
• Failing to initialize a variable ( "y = x + 1", where x has not been set)
• Skipping a check for an error return
• · Failure to hide complexity
• · Incomplete or ambiguous "contracts"
• · Undocumented side effects

1 9
INTRODUCTION TO PROGRAMMING
• DEBUGGING AND MAINTAINING PROGRAM
• BASIC DEBUGGING TECHNIQUES/STEPS
• Although each debugging experience is unique, certain general principles can be
applied in debugging.
• This section particularly addresses debugging software, although many of these
principles can also be applied to debugging hardware.
• The basic steps in debugging are:
• · Recognize that a bug exists
• · Isolate the source of the bug
• · Identify the cause of the bug
• · Determine a fix for the bug
• · Apply the fix and test it

1 10
INTRODUCTION TO PROGRAMMING
• Define what the program is to do.
• 2. Visualize the program running on the computer.
• 3. Use design tools to create a model of the program.
• 4. Check the model for logical errors.
• 5. Write the program source code.
• 6. Compile the source code.
• 7. Correct any errors found during compilation.
• 8. Link the program to create an executable file.
• 9. Run the program using test data for input.
• 10. Correct any errors found while running the program.
• Repeat steps 4 through 10 as many times as necessary.
• 11. Validate the results of the program.
1 11
INTRODUCTION TO PROGRAMMING
• DEBUGGING AND MAINTAINING PROGRAM

1 12

You might also like