SlideShare a Scribd company logo
Mr. Danzel Umapas - November 16, 2023
Identifying and Correcting
Errors
Creative Development
Learning objective:
A. Identify the error
B. Correct the error
Debugging
Debugging
Identifying and Correcting Errors
• Debugging is the process of
fi
nding and correcting existing and
potential errors (also called bugs) in software code.
• Bugs can cause software code to behave unexpectedly or crash.
Grace Hopper
(1.4) Identifying and Correcting Errors - PDF.pdf
Syntax error
Syntax errors
Identifying and Correcting Errors
• These are errors that occur when you have not followed the rules of the language, and they
will be
fl
agged by the translator.
• A program with syntax errors will not run.
• Common causes of syntax errors:
• Spelling or typing errors
• Missing parentheses, ( ) or { }, ; in statements in which they are required by the
language.
• Missing or unexpected indentation in Python
• Printing a value without declaring it.
Logic error
Logic errors
Identifying and Correcting Errors
• Errors that cause a program to work incorrectly or unexpectedly.
• With a logic error, the program can be run without failing, but it does not return the
expected result.
• Common causes of logic errors
• Not correctly understanding what the program needed to do.
• Using the incorrect logical operator in a selection statement.
• Missing or incorrect positioning of brackets in mathematical calculations, which means
that the incorrect result is returned.
• Loops that execute more or fewer times than intended.
Runtime errors
Runtime errors
Identifying and Correcting Errors
• Errors occur when the program is run. They are sometimes also referred to as execution errors.
• When the code is valid according to rules of syntax and semantics, and is also logically correct,
but the environment that the program is being run in or the input provided causes an error to
occur.
• Coming causes of runtime errors:
• Trying to access a list item that does not exist.
• A mathematical calculation that results in the program trying to divide by 0.
• Trying to perform numerical operations on strings.
• Linking to a
fi
le or resource that has been moved or longer exists.
Semantic errors
Semantic errors
Identifying and Correcting Errors
•Errors occur where there is improper use
of a program code statement, and they
are
fl
agged by the translator.
Identifying and Correcting Errors
Creative Development
• A logic error is a mistake in the algorithm or program that causes it to behave
incorrectly or unexpectedly.
• A syntax error is a mistake in the program when the rules of the
programming language are not followed.
• A run-time error is a mistake in the program that occurs during the execution
of a program. Programming languages de
fi
ne their own run-time errors.
• An over
fl
ow error is an error that occurs when a computer attempts to
handle a number that is outside of the de
fi
ned range of values.
Learning Objective:
Identify inputs and corresponding expected
outputs or behaviors that can be used to check
the correctness of an algorithm or program.
Identifying and Correcting Errors
Creative Development
• In the development processes, testing uses de
fi
ned inputs to ensure that an
algorithm or program is producing the expected outcomes.
• Programmers use the results from testing to revise their algorithms or
programs.
• De
fi
ned inputs used to test a program should demonstrates the di
ff
erent
expected outcomes that are at or just beyond the extremes (minimum and
maximum) of input data.
• Program requirements are needed to identify appropriate de
fi
ned inputs
for testing.
Identifying and Correcting Errors
Creative Development
• The following are e
ff
ective ways to
fi
nd and correct errors:
• Test cases
• Hand tracing
• Visualization
• Debuggers
• Adding extra output statement(s)
We should know…
Identifying and Correcting Errors
• Before a piece of software can be used, it needs to be tested.
• Other testing is more structured and involves a test plan.
• When a problem with the software is identi
fi
ed, the cause will need
to be identi
fi
ed. This is called debugging.
Things to ponder…
Things to ponder…
Identifying and Correcting Errors
•Give at least three (3) examples of
errors might occurs during creating a
code blocks.
Identifying and Correcting Errors
Creative Development
• A logic error is a mistake in the algorithm or program that causes it to behave
incorrectly or unexpectedly.
• A syntax error is a mistake in the program when the rules of the
programming language are not followed.
• A run-time error is a mistake in the program that occurs during the execution
of a program. Programming languages de
fi
ne their own run-time errors.
• An over
fl
ow error is an error that occurs when a computer attempts to
handle a number that is outside of the de
fi
ned range of values.
Things to ponder…
Identifying and Correcting Errors
•What are the e
ff
ective ways to
fi
nd and
correct errors?
Identifying and Correcting Errors
Creative Development
• The following are e
ff
ective ways to
fi
nd and correct errors:
• Test cases
• Hand tracing
• Visualization
• Debuggers
• Adding extra output statement(s)
Topic Questions…
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
(1.4) Identifying and Correcting Errors - PDF.pdf
Next Lesson: Data
Topics
Data
• Binary numbers
• Data Compression
• Extracting Information from Data
• Using Programs with Data

More Related Content

PPTX
Debugging
PPTX
Error detection recovery
PPT
CPP10 - Debugging
PPTX
Computational thinking
PPT
S D D Program Development Tools
PPTX
Cp 111 lecture 2
PPTX
Computer programing 111 lecture 2
PPTX
Programming Error or Bug.pptx
Debugging
Error detection recovery
CPP10 - Debugging
Computational thinking
S D D Program Development Tools
Cp 111 lecture 2
Computer programing 111 lecture 2
Programming Error or Bug.pptx

Similar to (1.4) Identifying and Correcting Errors - PDF.pdf (20)

PPTX
SDD error types and detection
PPT
debugging (1).ppt
PPT
An important characteristic of a test suite that is computed by a dynamic ana...
PPT
Code Analysis-run time error prediction
PPTX
The Art of Debugging.pptx
PPTX
Algorithmic thinking with python Module 1.2
PDF
Gray white simple modern Thesis Defense Presentation .pdf
PPTX
An Introduction To Software Development - Implementation
PDF
Debugging.pdf
PPTX
Introduction to Python_Debugging_Errors.pptx
PPTX
Debugging (Part 2)
DOCX
Adsa u1 ver 1.0
PPSX
CC-112-Lec.1.ppsx
PPTX
Debugging Approaches.pptx
PPTX
Abhik-Satish-dagstuhl
PPS
CS101- Introduction to Computing- Lecture 44
PPTX
3 Program Development Life Cycle.aaaaapptx
PPT
Exception handling.41
DOCX
Lesson Plan
PPT
Error Correction Techniques
SDD error types and detection
debugging (1).ppt
An important characteristic of a test suite that is computed by a dynamic ana...
Code Analysis-run time error prediction
The Art of Debugging.pptx
Algorithmic thinking with python Module 1.2
Gray white simple modern Thesis Defense Presentation .pdf
An Introduction To Software Development - Implementation
Debugging.pdf
Introduction to Python_Debugging_Errors.pptx
Debugging (Part 2)
Adsa u1 ver 1.0
CC-112-Lec.1.ppsx
Debugging Approaches.pptx
Abhik-Satish-dagstuhl
CS101- Introduction to Computing- Lecture 44
3 Program Development Life Cycle.aaaaapptx
Exception handling.41
Lesson Plan
Error Correction Techniques
Ad

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Pre independence Education in Inndia.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Types and Its function , kingdom of life
PPTX
Cell Structure & Organelles in detailed.
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pre independence Education in Inndia.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O7-L3 Supply Chain Operations - ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial disease of the cardiovascular and lymphatic systems
Cell Types and Its function , kingdom of life
Cell Structure & Organelles in detailed.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
GDM (1) (1).pptx small presentation for students
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
01-Introduction-to-Information-Management.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Ad

(1.4) Identifying and Correcting Errors - PDF.pdf

  • 1. Mr. Danzel Umapas - November 16, 2023 Identifying and Correcting Errors Creative Development
  • 2. Learning objective: A. Identify the error B. Correct the error
  • 4. Debugging Identifying and Correcting Errors • Debugging is the process of fi nding and correcting existing and potential errors (also called bugs) in software code. • Bugs can cause software code to behave unexpectedly or crash. Grace Hopper
  • 7. Syntax errors Identifying and Correcting Errors • These are errors that occur when you have not followed the rules of the language, and they will be fl agged by the translator. • A program with syntax errors will not run. • Common causes of syntax errors: • Spelling or typing errors • Missing parentheses, ( ) or { }, ; in statements in which they are required by the language. • Missing or unexpected indentation in Python • Printing a value without declaring it.
  • 9. Logic errors Identifying and Correcting Errors • Errors that cause a program to work incorrectly or unexpectedly. • With a logic error, the program can be run without failing, but it does not return the expected result. • Common causes of logic errors • Not correctly understanding what the program needed to do. • Using the incorrect logical operator in a selection statement. • Missing or incorrect positioning of brackets in mathematical calculations, which means that the incorrect result is returned. • Loops that execute more or fewer times than intended.
  • 11. Runtime errors Identifying and Correcting Errors • Errors occur when the program is run. They are sometimes also referred to as execution errors. • When the code is valid according to rules of syntax and semantics, and is also logically correct, but the environment that the program is being run in or the input provided causes an error to occur. • Coming causes of runtime errors: • Trying to access a list item that does not exist. • A mathematical calculation that results in the program trying to divide by 0. • Trying to perform numerical operations on strings. • Linking to a fi le or resource that has been moved or longer exists.
  • 13. Semantic errors Identifying and Correcting Errors •Errors occur where there is improper use of a program code statement, and they are fl agged by the translator.
  • 14. Identifying and Correcting Errors Creative Development • A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly. • A syntax error is a mistake in the program when the rules of the programming language are not followed. • A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages de fi ne their own run-time errors. • An over fl ow error is an error that occurs when a computer attempts to handle a number that is outside of the de fi ned range of values.
  • 15. Learning Objective: Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program.
  • 16. Identifying and Correcting Errors Creative Development • In the development processes, testing uses de fi ned inputs to ensure that an algorithm or program is producing the expected outcomes. • Programmers use the results from testing to revise their algorithms or programs. • De fi ned inputs used to test a program should demonstrates the di ff erent expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data. • Program requirements are needed to identify appropriate de fi ned inputs for testing.
  • 17. Identifying and Correcting Errors Creative Development • The following are e ff ective ways to fi nd and correct errors: • Test cases • Hand tracing • Visualization • Debuggers • Adding extra output statement(s)
  • 18. We should know… Identifying and Correcting Errors • Before a piece of software can be used, it needs to be tested. • Other testing is more structured and involves a test plan. • When a problem with the software is identi fi ed, the cause will need to be identi fi ed. This is called debugging.
  • 20. Things to ponder… Identifying and Correcting Errors •Give at least three (3) examples of errors might occurs during creating a code blocks.
  • 21. Identifying and Correcting Errors Creative Development • A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly. • A syntax error is a mistake in the program when the rules of the programming language are not followed. • A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages de fi ne their own run-time errors. • An over fl ow error is an error that occurs when a computer attempts to handle a number that is outside of the de fi ned range of values.
  • 22. Things to ponder… Identifying and Correcting Errors •What are the e ff ective ways to fi nd and correct errors?
  • 23. Identifying and Correcting Errors Creative Development • The following are e ff ective ways to fi nd and correct errors: • Test cases • Hand tracing • Visualization • Debuggers • Adding extra output statement(s)
  • 33. Topics Data • Binary numbers • Data Compression • Extracting Information from Data • Using Programs with Data