Difference between revisions of "Assertion Settings"

m
 
m (Motivation)
Line 1: Line 1:
 
Author: Matthias Konrad
 
Author: Matthias Konrad
  
==Motivation==
+
==Introduction==
  
 
The Eiffel Language specifies several assertion types:
 
The Eiffel Language specifies several assertion types:
Line 10: Line 10:
 
* Checks
 
* Checks
  
In theory these assertions should be checked all the time. In practice, especially when working with huge systems, this is not possible. In some cases it is not even possible during the testing phase of the system. It is thus nessecary to decide which assertions should be tested. This decicion can be done by either the user or the compiler.</p>
+
In theory these assertions should be checked all the time. In practice, especially when working with huge systems, this is not possible. In some cases it is not even possible during the testing phase of the system. It is thus nessecary to decide which assertions should be tested. This decicion can be done by either the user or the compiler.
  
It is not enough to just enable or disable a certain assertion kind for the hole system. Large systems are composed of smaller parts and reused components. These are typically tested independently (unit level testing). It is thus important that assertions are checked on the untested part of the system and for performance reasons not tested on the allready tested parts.
+
It is not enough to just enable or disable a certain assertion kind for the whole system. Large systems are composed of smaller parts and reused components (like the base library). These are typically tested independently (unit level testing). It should thus be possible to disable assertion testing on the tested part and enable it on the other parts.
  
In EiffelStudio the user has to make this desicion.
+
In EiffelStudio the user has to decide which assertions need to be checked. He can do this on various levels (for each assertion kind):
let the user define whether assertions are checked on various levels:
+
 
* Class
 
* Class
 
* Cluster
 
* Cluster
 
* Library
 
* Library
 
* System
 
* System
 +
 +
==Critics==

Revision as of 15:40, 16 October 2006

Author: Matthias Konrad

Introduction

The Eiffel Language specifies several assertion types:

  • Preconditions
  • Postconditions
  • Invariants
  • Loop variants
  • Checks

In theory these assertions should be checked all the time. In practice, especially when working with huge systems, this is not possible. In some cases it is not even possible during the testing phase of the system. It is thus nessecary to decide which assertions should be tested. This decicion can be done by either the user or the compiler.

It is not enough to just enable or disable a certain assertion kind for the whole system. Large systems are composed of smaller parts and reused components (like the base library). These are typically tested independently (unit level testing). It should thus be possible to disable assertion testing on the tested part and enable it on the other parts.

In EiffelStudio the user has to decide which assertions need to be checked. He can do this on various levels (for each assertion kind):

  • Class
  • Cluster
  • Library
  • System

Critics