Errors - Control Flow

PROGRAM RUNS AMOK
  • GOTO somewhere
  • Come-from logic errors
  • Problems in table-driven programs
  • Executing data
  • Jumping to a routine that isn't resident
  • Re-entrance
  • Variables contain embedded command names
  • Wrong returning state assumed
  • Exception-handling based exits
  • Return to wrong place
    • Corrupted stack
    • Stack under/overflow
    • GOTO rather than RETURN from a subroutine
  • Interrupts
    • Wrong interrupt vector
    • Failure to restore or update interrupt vector
    • Failure to block or unblock interrupts
    • Invalid restart after an interrupt
PROGRAM STOPS
  • Dead crash
  • Syntax errors reported at run-time
  • Waits for impossible condition, or combination of conditions
  • Wrong user or process priority
LOOPS
  • Infinite loop
  • Wrong starting value for the loop control variable
  • Accidental change of the loop control variable
  • Wrong criterion for ending the loop
  • Commands that do or don't belong inside the loop
  • Improper loop nesting
IF, THEN, ELSE, OR MAYBE NOT
  • Wrong inequalities (e.g., > instead of >=)
  • Comparison sometimes yields wrong result
  • Not equal versus equal when there are three cases
  • Testing floating point values for equality
  • Confusing inclusive and exclusive OR
  • Incorrectly negating a logical expression
  • Assignment-equal instead of test-equal
  • Commands belong inside the THEN or ELSE clause
  • Commands that don't belong inside either clause
  • Failure to test a flag
  • Failure to clear a flag
MULTIPLE CASES
  • Missing default
  • Wrong default
  • Missing cases
  • Case should be subdivided
  • Overlapping cases
  • Invalid or impossible cases