What is the difference between testing and debugging?
Testing checks whether selected inputs produce the expected behavior; debugging investigates why actual behavior differs and removes the underlying defect.
Study 11 Testing and Debugging with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is the difference between testing and debugging?
Testing checks whether selected inputs produce the expected behavior; debugging investigates why actual behavior differs and removes the underlying defect.
What is a syntax error?
A syntax error violates the programming language’s grammar, so the program usually cannot start until the error is fixed.
What is a runtime error?
A runtime error occurs while a program is executing, such as when it divides by zero, accesses an invalid array index, or opens a missing file.
What is a logic error?
A logic error lets a program run but makes it produce an incorrect result because its implementation does not match the intended rule.
What should you do first when debugging?
Reproduce the failure with a small, reliable input and record the input, expected result, actual result, error information, and reproduction steps.
Why is an error’s detected location not always its cause?
The error location is where the program noticed the problem; the defect may have been introduced earlier, such as in a caller that constructed an incorrect value.
Why form one specific debugging hypothesis?
A specific hypothesis states what is wrong and why, allowing a focused test or inspection instead of unrelated edits.
What can a debugger help you inspect?
A debugger can pause at breakpoints, execute one statement at a time, inspect variables and expressions, evaluate stack frames, and use conditional or post-mortem debugging.
What is the purpose of a program trace?
A trace records important program state during execution, helping reveal incorrect updates, conditions, indexes, loop counts, or premature returns.
What is a unit test?
A unit test checks a small unit, such as a function, method, or class operation, in isolation; it normally includes setup, an action, and an assertion.
Why are boundary cases important?
Boundary tests examine values at or near valid limits, where incorrect comparison operators or loop bounds commonly cause defects.
What does it mean to test the specification?
Tests should verify the required result described by the specification rather than depend on implementation details such as sorting or a particular loop.