Design by Contract Using Meta-Assertions

Contract writing for methods in classes that are clients of other classes can bring undesirable effects, like the increasing in class coupling and encapsulation decreasing. We propose a pattern to the design of class contracts that helps producing contracts that preserve low class coupling and data encapsulation. The expressive power of existing assertion languages is insufficient, however, to write these contracts. In order to fill this lack we propose meta-assertions, and we define rules for a grammatically and semantically sound expansion of meta-assertions in order to be able to monitor contracts at run-time using already existing tools.