From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-04-19 15:59:31
Jesse Jones wrote:
> I've uploaded a new version of the DbC files.
I've followed the discussion with great interest. Since I've been
working (with Beman) on an improved unit test facility, it occured to me
that it might be a good idea to integrate unit testing and Design by
Contract. This would have at least two advantages:
1. Avoidance of code duplication - many things in the unit test
framework are similar to what you are trying to achieve.
2. Simplification of DbC: From the discussion so far I got the
impression that especially invariant testing imposes some problems in
C++. Thus, it might be a useful policy, to check invariants primarily in
test programs, and not in production code. This would solve two
- costly invariant checks do no harm in test programs
- it is easy to solve the accessibility issue by declaring the
tester class a friend of the class being tested.
Please take a look at the proposed unit test code at
Any opinions will be appreciated.
| Ullrich Koethe Universität Hamburg / University of Hamburg |
| FB Informatik / Dept. of Computer Science |
| AB Kognitive Systeme / Cognitive Systems Group |
| Phone: +49 (0)40 42883-2573 Vogt-Koelln-Str. 30 |
| Fax: +49 (0)40 42883-2572 D - 22527 Hamburg |
| Email: u.koethe_at_[hidden] Germany |
| koethe_at_[hidden] |
| WWW: http://kogs-www.informatik.uni-hamburg.de/~koethe/ |
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk