Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-04-19 18:07:39


Integrating design by contract and testing sounds like a great idea to
me!!!

One way this can tie into generic programming is the following:
  - When creating a concept, write C++ code for checking the
    semantic invariants required by the concept.
  - Then the test code for a particular type should automatically
    pull in the checks from the concepts that the type models.

A month ago I started applying this kind of approach to the
BGL graph concepts and data-structures, and so far I think it
is working really well!

Cheers,
Jeremy

On Thu, 19 Apr 2001, Ullrich Koethe wrote:
u.koet> Hi!
u.koet>
u.koet> Jesse Jones wrote:
u.koet> >
u.koet> > I've uploaded a new version of the DbC files.
u.koet>
u.koet> I've followed the discussion with great interest. Since I've been
u.koet> working (with Beman) on an improved unit test facility, it occured to me
u.koet> that it might be a good idea to integrate unit testing and Design by
u.koet> Contract. This would have at least two advantages:
u.koet>
u.koet> 1. Avoidance of code duplication - many things in the unit test
u.koet> framework are similar to what you are trying to achieve.
u.koet>
u.koet> 2. Simplification of DbC: From the discussion so far I got the
u.koet> impression that especially invariant testing imposes some problems in
u.koet> C++. Thus, it might be a useful policy, to check invariants primarily in
u.koet> test programs, and not in production code. This would solve two
u.koet> problems:
u.koet>
u.koet> - costly invariant checks do no harm in test programs
u.koet> - it is easy to solve the accessibility issue by declaring the
u.koet> tester class a friend of the class being tested.
u.koet>
u.koet> Please take a look at the proposed unit test code at
u.koet>
u.koet> http://groups.yahoo.com/group/boost/files/unittest/
u.koet>
u.koet> Any opinions will be appreciated.
u.koet>
u.koet> -- Ulli
u.koet> ________________________________________________________________
u.koet> | |
u.koet> | Ullrich Koethe Universität Hamburg / University of Hamburg |
u.koet> | FB Informatik / Dept. of Computer Science |
u.koet> | AB Kognitive Systeme / Cognitive Systems Group |
u.koet> | |
u.koet> | Phone: +49 (0)40 42883-2573 Vogt-Koelln-Str. 30 |
u.koet> | Fax: +49 (0)40 42883-2572 D - 22527 Hamburg |
u.koet> | Email: u.koethe_at_[hidden] Germany |
u.koet> | koethe_at_[hidden] |
u.koet> | WWW: http://kogs-www.informatik.uni-hamburg.de/~koethe/ |
u.koet> |________________________________________________________________|
u.koet>
u.koet> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
u.koet>
u.koet>
u.koet> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
u.koet>
u.koet>
u.koet>

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk