Automatic dimension inference and checking for object-oriented programs

This paper introduces UniFi, a tool that attempts to automatically detect dimension errors in Java programs. UniFi infers dimensional relationships across primitive type and string variables in a program, using an inter-procedural, context-sensitive analysis. It then monitors these dimensional relationships as the program evolves, flagging inconsistencies that may be errors. UniFi requires no programmer annotations, and supports arbitrary program-specific dimensions, thus providing fine-grained dimensional consistency checking. UniFi exploits features of object-oriented languages, but can be used for other languages as well. We have run UniFi on real-life Java code and found that it is useful in exposing dimension errors. We present a case study of using UniFi on nightly builds of a 19,000 line code base as it evolved over 10 months.

[1]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

[2]  M. Lam,et al.  Tracking down software bugs using automatic anomaly detection , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[3]  Zhendong Su,et al.  Osprey: a practical type system for validating dimensional unit correctness of C programs , 2006, ICSE.

[4]  Monica S. Lam,et al.  Automatic extraction of object-oriented component interfaces , 2002, ISSTA '02.

[5]  M. Wegman,et al.  Global value numbers and redundant computations , 1988, POPL '88.

[6]  Robert O'Callahan,et al.  Lackwit: A Program Understanding Tool Based on Type Inference , 1997, Proceedings of the (19th) International Conference on Software Engineering.

[7]  Jeffrey S. Foster,et al.  Type qualifier inference for java , 2007, OOPSLA.

[8]  Alexander Aiken,et al.  A theory of type qualifiers , 1999, PLDI '99.

[9]  Grant W. Petty,et al.  Automated computation and consistency checking of physical dimensions and units in scientific programs , 2001, Softw. Pract. Exp..

[10]  Victor Luchangco,et al.  Object-oriented units of measurement , 2004, OOPSLA.

[11]  Matthias Felleisen,et al.  Validating the unit correctness of spreadsheet programs , 2004, Proceedings. 26th International Conference on Software Engineering.

[12]  Dawson R. Engler,et al.  Bugs as deviant behavior: a general approach to inferring errors in systems code , 2001, SOSP.

[13]  Michael D. Ernst,et al.  Javari: adding reference immutability to Java , 2005, OOPSLA '05.

[14]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[15]  André van Delft A Java Extension with Support for Dimensions , 1999, Softw. Pract. Exp..

[16]  Dawson R. Engler,et al.  From uncertainty to belief: inferring the specification within , 2006, OSDI '06.

[17]  David A. Wagner,et al.  This copyright notice must be included in the reproduced paper. USENIX acknowledges all trademarks herein. Detecting Format String Vulnerabilities with Type Qualifiers , 2001 .

[18]  Stephen McCamant,et al.  Dynamic inference of abstract types , 2006, ISSTA '06.