Computer Science I / Debugging Structural Invariants
Practice question · Select all that apply

Select every benefit the lesson attributes to writing an invariant checker.

Hints
  1. An invariant is a statement about correctness of state, not about time or about every other behaviour.
  2. Two options claim something a property check cannot possibly establish.
Show the answer
  • A. It localises a bug to the operation that broke the structure
  • C. It catches mis-linked pointers, unbalanced subtrees and mis-hashed keys
  • E. It documents what the structure guarantees, in executable form
Why

Localisation, broad coverage of structural faults and executable documentation are all claimed. A checker says nothing about speed, and it verifies the structure's state rather than the results the program produces, so it complements other tests instead of replacing them.

Read the lesson: Debugging Structural Invariants →

Practise Debugging Structural Invariants

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Debugging Structural Invariants