Specification and verification of encapsulation in java programs

  • Authors:
  • Andreas Roth

  • Affiliations:
  • Institut für Logik, Komplexität und Deduktionssysteme, Universität Karlsruhe, Germany

  • Venue:
  • FMOODS'05 Proceedings of the 7th IFIP WG 6.1 international conference on Formal Methods for Open Object-Based Distributed Systems
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

Encapsulation is a major concept in object-oriented designs as design pattern catalogues, approaches for alias control, and the need for modular correctness of components demonstrate. The way encapsulation can be formally specified in existing approaches has several shortcomings. We show how encapsulation in sequential Java programs is specified by means of a new concept, called encapsulation predicates, in a clearly defined and comprehensible way, well fitting into the concept of design by contract. Encapsulation predicates extend existing functional specification languages. There are two kinds: basic predicates, which provide the actual extension, and convenience predicates, which are abbreviations for often used specification patterns. With encapsulation predicates, encapsulation properties in design patterns can be modelled and approaches to control aliasing can be simulated. Specifications containing encapsulation predicates are deductively checkable, but can also be tackled by static analysis methods which are similar to alias control approaches.