Specification and runtime monitoring of object -oriented systems
The object-oriented (OO) approach has fundamentally changed the way we look at software, and has had an enormous influence on the software engineering discipline. Through the use of powerful tools such as inheritance and polymorphism, developers can specialize and enhance software systems while reusing large portions of already existing code. However, the use of these features can result in complex interactions and dependencies among parts of the code, which may make it difficult when trying to understand and reason about the system's behavior. We will show how such difficulties can be addressed by the use of specifications which provide essential information about how the system can interact with external components. Although such specifications allow us to formally reason about systems in a modular way, to fully realize their benefits, we also need suitable software tools that can be used by general practitioners. Here, we present such a tool which allows for monitoring of systems at runtime to identify any violations of these specifications. The tool exploits the same mechanisms of inheritance and polymorphism, and does not require the availability of the system source code. We will also look at how a similar approach can be applied to track the execution flow through OO class hierarchies.
Design patterns, a progression from class-level to design-level OO reuse, have also had a large impact on the way we think about and design large software systems. Not only do patterns allow for the reuse of time-tested solutions, but they also enable others studying the system in question to get a deeper understanding of how the system is built and why it behaves in particular ways. Design patterns have traditionally been presented in an informal manner, however, and such descriptions often contain ambiguities that can lead to different interpretations and assumptions made about specific parts of the system. This can result in misunderstandings among developers working on the same project, and can eventually manifest themselves as incompatibilities among different parts of the system. Hence, we again need ways to precisely specify behaviors of patterns and systems built using them, as well as software tools to monitor the systems to identify any violations of the specifications. We present a pattern contract language that addresses the specificity of individual applications, while maintaining the flexibility inherent in the design patterns. We then present a tool which generates aspect-oriented monitors for checking pattern contract violations during runtime.