Modular Verification of Static Class Invariants
Object invariants describe the consistency of object-oriented data structures and are central to reasoning about the correctness of object-oriented software. But object invariants are not the only consistency conditions on which a program may depend. The data in object-oriented programs consists not just of object fields, but also of static fields, which hold data that is shared among objects. The consistency of static fields is described by static class invariants, which are enforced at the class level. Static class invariants can also mention instance fields, describing the consistency of dynamic data structures rooted in static fields. Sometimes there are even consistency conditions that relate the instance fields of many or all objects of a class; static class invariants describe these relations, too, since they cannot be enforced by any one object in isolation.
This paper presents a systematic way (a methodology) for specifying and verifying static class invariants in object-oriented programs. The methodology supports the three major uses of static fields and invariants in the Java library. The methodology is amenable to static, modular verification and is sound.
KeywordsStatic class invariant verification object-oriented programming static field
Unable to display preview. Download preview PDF.
- 1.Barnett, M., DeLine, R., Fähndrich, M., Leino, K.R.M., Schulte, W.: Verification of object-oriented programs with invariants. Journal of Object Technology 3(6) (2004), www.jot.fm
- 4.Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. Software Tools for Technology Transfer, STTT (2004)Google Scholar
- 6.Detlefs, D.L., Leino, K.R.M., Nelson, G., Saxe, J.B.: Extended static checking. Research Report 159, Compaq SRC (December 1998)Google Scholar
- 8.Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: A behavioral interface specification language for Java. Technical Report 98-06-rev27, Iowa State University (2003)Google Scholar
- 9.Leino, K.R.M., Müller, P.: Modular verification of global module invariants in object-oriented programs. Technical Report 459, ETH Zürich (2004)Google Scholar
- 14.Meyer, B.: Eiffel: The Language. Prentice Hall, Englewood Cliffs (1995)Google Scholar