- Forward


Debugging Classes
Common Mistakes made by Beginning Programmers


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Desk Checking Attributes
Back SMYC Forward
  • Look for attributes that are inappropriately declared static
  • Look for attributes and local variables with the same name
  • Look for confusing aliases, shallow copies, and deep copies
Desk Checking Methods/Functions
Back SMYC Forward
  • Make sure you are returning the right value/variable
  • Avoid multiple return statements; if you use them make sure they are correct
  • Look for missing constructors
  • Look for the misuse of overloaded methods
Desk Checking Derived Classes
Back SMYC Forward
  • Look for the accidental inclusion of a shadow attribute
  • Look for a dailure to call the parent's constructor
  • Look for the misuse of overridden methods
There's Always More to Learn
Back -