Design Pattern-Based Extension of Class Hierarchies to Support Runtime Invariant Checks
John Lasseter, John Cipriano

TL;DR
This paper introduces a method to automatically insert runtime invariant checks into existing Java class hierarchies using design patterns, without modifying original source code, enhancing software reliability.
Contribution
The approach enables invariant checks insertion through a concise specification, requiring no source code modifications and supporting diverse class structures.
Findings
Works with various class hierarchies including interfaces and abstract classes
Requires only single inheritance and no access to private attributes
Implemented as an Eclipse plugin for Java development
Abstract
We present a technique for automatically weaving structural invariant checks into an existing collection of classes. Using variations on existing design patterns, we use a concise specification to generate from this collection a new set of classes that implement the interfaces of the originals, but with the addition of user-specified class invariant checks. Our work is notable in the scarcity of assumptions made. Unlike previous design pattern approaches to this problem, our technique requires no modification of the original source code, relies only on single inheritance, and does not require that the attributes used in the checks be publicly visible. We are able to instrument a wide variety of class hierarchies, including those with pure interfaces, abstract classes and classes with type parameters. We have implemented the construction as an Eclipse plug-in for Java development.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Logic, programming, and type systems · Advanced Software Engineering Methodologies
