"From Types to Contracts: Supporting by Light-Weight Specifications the Liskov Substitution Principle"
, Serie RISC Report Series, Nummer 10-22, JKU Linz, Altenberger Str. 69, 4040 Linz, Austria, 2-2010
From Types to Contracts: Supporting by Light-Weight Specifications the Liskov Substitution Principle
Sprache des Titels:
In this paper we review the main theoretical elements of behavioral subtyping in object-oriented programming languages in a semi-formal style that should allow software developers to understand better in which situations the Liskov substitution principle (objects of subclasses may stand for objects of superclasses) is violated. We then shortly discuss the specification of class contracts in behavioral specification languages that allow to ensure that the substitution principle is preserved. Since many software developers may shy away form these languages because the learning curve is esteemed as too steep, we propose a language of light-weight specifications that provides by a hierarchy of gradually more expressive specification forms a more lenient path towards the use of behavioral specification languages. The specifications do not demand the use of predicate logic; by automatic checking certain violations of the substitution principle may be detected.