Please enable JavaScript.
Coggle requires JavaScript to display documents.
Anticipating & Dealing with Errors, method to locating hidden bugs -…
Anticipating & Dealing with Errors
Objectives
explain techniques for preventing errors
how to mitigate the effects of errors that are introduced
Introduce a systematic aproach to testing
top-down strategies
bottom-up strategies
The way to test individual parts of a solution in isolation
Debugging strategies
explain how to manage the bugs found in own solution
coming to terms with bugs & error
BUG
a fault in a solution that can cause erroneous behaviour
ERROR
any behavior observed when executing a solution that does not match expected behaviour
Types of bugs that can cause erroneous behaviour
Typos
~spelling errors
~incorrect capitalisations
~missing words
~wrong words
Example:
'phase' instead of 'phrase'
text
~numbered lists with incorrect numbering
Poor grammar & ambiguities
grammatical error
cause problem is when the (apparently) same concept is referred to using different terms
Inconsistencies
Eliminatingambiguities helps to counter another source of bugs
Arises when parts of a solution separately make statements that make no sense when considered together
These bugs are harder to locate
Each part of the inconsistency might appear in very different contexts
Logical & mathematical errors
simple bugs might be found in logical expressions
Being exhaustive
the computer's behavior becomes unpredictable
it might take an unwanted action
General tips
make pre-assumption
too wrapped up in the details of how it
should
work
Mitigating Errors
preventative actions
Getting defensive
reacting to problems
checking user input
Testing
Goal
to use the actual system that had produced to verify whether it perform well & identify specific areas where it fails
Approach
top-down
bottom-up
Testing individual parts
By testing only small parts of the solution at once, to localizing the problem easier
Debugging
systematic in finding & fixing
approach in general
Be ruthless with hunches
discard it immediately
Respect Occam's Razor
problem-solving that tell us the simpler explanation
Change one thing at time
apply it & fix it till done
Divide & conquer
reducing the number of places you need to search
Tracing
Logging
Explain the problem aloud
method to locating hidden bugs