A Framework for Checking Programmer-Defined Constraints on the Definition and Use of Program Elements in Java

Boris Bokowski · Refubium (Universitätsbibliothek der Freien Universität Berlin) · 2002

For functioning correctly, complex object-oriented software relies on application-specific constraints regarding the definition and use of program elements. This dissertation presents CoffeeStrainer, a system for checking programmer-defined constraints on Java source code. CoffeeStrainer constraints are unique in that they are modular, extensible and composable, and supports both constraints regarding the definition of program elements and constraints regarding the use of program elements. Additionally, CoffeeStrainer constraints can consist of static (compile-time) and dynamic (run-time) parts. Static constraints are checked using a program representation which consists of the complete abstract syntax tree together with information obtained by name and type analysis. The system checks compilation units separately; the time taken to check one compilation unit is comparable to the time of compiling the compilation unit. The system has been fully implemented. Unlike other approaches, CoffeeStrainer does not define a special-purpose language for specifying constraints - instead, it uses Java for constraints as well, making it easy for proficient Java programmers to specify constraints. Constraint code is embedded in Javadoc comments. Thus, constraint code and base-level code share the same structure, making it easy to find the rules that apply to a given part of the program, and allowing arbitrary compilers and tools to be applied to the source code that contains constraints.

Read the paper · More papers on PaperTik