Software Testing

Exercise Question, (7) Testing Object-Oriented Software

Describe five fault types that should be checked when testing OO software with deep

inheritance hierarchies.

  • Incorrect initialization
  • Inadvertent (dt.: unbeabsichtigte) bindings
    • Multiple inheritances
    • Missing override declaration
  • Naked access
    • Inherited instance variable is set directly in subclass instead of using getter/setter methods
  • Incorrect location of subclass
    • SquareWindow vs. RectangularWindow example
  • Naughty children
    • Subclass leaves object in a state that is illegal in the superclass
  • Wormholes
    • Subclass objects compute values that are not consistent with superclass state invariants
    • Don't conform to the state of the class but rather to its postconditions
  • Spaghetti inheritance
    • Deep hierarchies are error-prone

Diskussion