Identifying and Correcting Errors (College Board AP® Computer Science Principles): Flashcards

1/25

0Still learning

Know0

Cards in this collection (25)

  • Define debugging.

    Debugging is the process of finding and fixing errors in a program.

  • Define syntax error.

    A syntax error is when the code violates the language rules and cannot be executed.

  • Define logic error.

    A logic error is when the program runs without crashing but produces incorrect behavior or wrong output.

  • Which type of error is the hardest to find?

    A logic error is the hardest type of error to find.

  • Define runtime error.

    A runtime error is when the program crashes during execution because of an operation the computer cannot complete.

  • Define overflow error.

    An overflow error is when a value exceeds the range of numbers that can be stored in the allocated memory.

  • A program crashes when it divides a number by zero. What type of error is this?

    Dividing by zero during execution causes a runtime error.

  • Define test case.

    A test case is a specific set of inputs paired with the expected output for a program.

  • Define hand tracing.

    Hand tracing is manually stepping through the code line by line, tracking the value of each variable at every step.

  • True or False?

    Hand tracing is particularly useful for finding syntax errors.

    False.

    Hand tracing is particularly useful for finding logic errors, where the program runs but produces the wrong result.

  • Developers can temporarily insert extra ______ statements into the code to show the value of a variable at a specific point during execution.

    Developers can temporarily insert extra output statements into the code to show the value of a variable at a specific point during execution.

  • Define debugger.

    A debugger is a software tool that allows developers to step through a program's execution one statement at a time.

  • Define breakpoint.

    A breakpoint is a specific line where execution pauses so developers can inspect the program's state.

  • Name one type of visualization that helps developers detect errors.

    Visualizations that help detect errors include flowcharts and variable state diagrams.

  • Define testing.

    Testing is running a program with specific inputs to check whether it produces the expected outcome.

  • Name the three types of defined inputs used in testing.

    The three types are inputs at the extremes, inputs just beyond the extremes, and typical values.

  • A program accepts scores from 0 to 100. Which two inputs test the minimum and maximum of the range?

    The inputs at the extremes are 0 and 100.

  • A program accepts scores from 0 to 100. Which two inputs fall immediately outside the valid range?

    The inputs just beyond the extremes are −1 and 101.

  • Values within the expected range that exercise normal logic paths are called _______ values.

    Values within the expected range that exercise normal logic paths are called typical values.

  • What should test inputs be selected based on?

    Test inputs should be selected based on the requirements of the program.

  • True or False?

    Effective test input selection only needs to cover one possible path through the program.

    False.

    Effective test input selection covers all branches and conditions in the program's logic.

  • When should developers plan test inputs?

    Developers should plan test inputs before writing code, using the specification.

  • Include at least one test input for each expected _______.

    Include at least one test input for each expected outcome.

  • A test produces a different result from the one the program's requirements specify. Where is the error?

    The error is in the program's logic or processing, not in the test.

  • A program displays "Adult" for ages 18 or above and "Child" otherwise. Which two inputs best test where its behavior changes?

    The best inputs are 18 (at the boundary) and 17 (just beyond it), because the program's behavior changes at 18.

Sign up to unlock flashcards

or