Lightweight Analysis of Object Interactions

The state of the practice in object-oriented software development has moved beyond reuse of code to reuse of conceptual structures such as design patterns. This paper draws attention to some difficulties that need to be solved if this style of development is to be supported by formal methods. In particular, the centrality of object interactions in many designs makes traditional reasoning less useful, since classes cannot be treated fruitfully in isolation from one another. We propose some ideas towards dealing with these issues: a relational model of heap structure capable of expressing sharing and mutual influence between objects; a declarative specification style that works in the presence of collaboration; and a tool-supported constraint analysis to expose problems in a diagram that captures, at a design level, a pattern of interaction. We illustrate these ideas with an example taken from a program used in the formatting of this paper.

[1]  K RajamaniSriram,et al.  The SLAM project , 2002 .

[2]  K. R Leino,et al.  Towards Reliable Modular Programs , 1995 .

[3]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[4]  Daniel Jackson,et al.  Finding bugs with a constraint solver , 2000, ISSTA '00.

[5]  Robert O'Callahan,et al.  Generalized aliasing as a basis for program analysis tools , 2001 .

[6]  Reinhard Wilhelm,et al.  Parametric shape analysis via 3-valued logic , 1999, POPL '99.

[7]  Daniel Jackson,et al.  Alcoa: the Alloy constraint analyzer , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[8]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[9]  K. Rustan M. Leino,et al.  ESC/Java User's Manual , 2000 .

[10]  Bertrand Meyer,et al.  Object-oriented software construction (2nd ed.) , 1997 .

[11]  Douglas C. Schmidt,et al.  Object-oriented application frameworks , 1997, CACM.

[12]  Ian M. Holland,et al.  Contracts: specifying behavioral compositions in object-oriented systems , 1990, OOPSLA/ECOOP '90.

[13]  Daniel Jackson,et al.  Lightweight Extraction of Object Models from Bytecode , 2001, IEEE Trans. Software Eng..

[14]  Daniel Jackson,et al.  Lightweight Formal Methods , 2001, FME.

[15]  Ivar Jacobson,et al.  Unified Modeling Language , 2020, Definitions.

[16]  Daniel Jackson,et al.  Alloy: a lightweight object modelling notation , 2002, TSEM.

[17]  Manu Sridharan,et al.  A micromodularity mechanism , 2001, ESEC/FSE-9.

[18]  Gary T. Leavens An Overview of Larch/C++: Behavioral Specifications for C++ Modules , 1996 .

[19]  D. Jackson,et al.  Object models as heap invariants , 2003 .

[20]  Martin C. Rinard,et al.  Compositional pointer and escape analysis for Java programs , 1999, OOPSLA '99.

[21]  David Lorge Parnas,et al.  An Invitation to Formal Methods , 1996, Computer.

[22]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[23]  Albert L. Baker,et al.  JML: A Notation for Detailed Design , 1999, Behavioral Specifications of Businesses and Systems.

[24]  Daniel Jackson Automating first-order relational logic , 2000, SIGSOFT '00/FSE-8.

[25]  Barbara Liskov,et al.  Program Development in Java - Abstraction, Specification, and Object-Oriented Design , 1986 .