Presentation on theme: "Challenges in Object-Oriented Code Inspection Alastair Dunsmore, Marc Roper, Murray Wood University of Strathclyde UK."— Presentation transcript:
Challenges in Object-Oriented Code Inspection Alastair Dunsmore, Marc Roper, Murray Wood University of Strathclyde UK
Two key issues: Delocalisation - information necessary to understand the code under review being located outside that code Static view v. dynamic view
Experience derived from: Two student-based experiments (~50 subjects each, ~2 years experience, Java code, 200 lines in 90 minutes) Small industrial survey of OO inspectors (13 subjects). Details in papers at Strathclyde website.
Delocalisation Characterised and classified ‘difficult to detect’ defects - many characterised as ‘delocalised’. Information necessary to understand the code under review is located elsewhere. Inheritance, dynamic binding, polymorphism, small distributed methods, class libraries - all contribute. Industrial survey and literature confirm.
Static v. Dynamic View “In fact the two structures [compile-time and run-time] are largely independent. Trying to understand one from the other is like trying to understand the dynamism of living ecosystems from the static taxonomy of plants and animals, and vice-versa.” Gamma et al
Implications for OO Inspection: How to partition a large system into small chunks for inspection? “What to read” How to comprehend these chunks whilst dealing with the continual references to other chunks? “How to read” How to support understanding of what isn’t read? “Localising the delocalisation”.
A Systematic Reading Strategy: Inspect classes in order of interdependencies (least first). Follow interdependencies as necessary to fully comprehend (dynamic view). Write a minimal abstract specification for each method as inspected: –Encourages deeper understanding –Used by other inspectors to ‘localise’ delocalisation’.
Findings compared to ad hoc: No significant improvement in defects detected Abstract specifications created as by- product Subjects suggested that the strategy –encouraged them to think harder –imposed rigour Small differences in defects discovered
Discussion: Are these real and serious issues for object- oriented code inspection? Are new techniques and tools required? –refined systematic, abstraction driven –experience based checklists (or scenarios) –use-case driven Design of next round of experiments? Industrial confirmation? Implications for other OO artifacts?