Re: Liskov principle and unittest

2011-09-26 Thread Philippe Sigaud
On Mon, Sep 26, 2011 at 14:05, deadalnix wrote: >> The limitation is I'm not sure that would work for class templates >> hierarchies. > > Sounds nice ! I'm pretty sure this has some limitations, but that > definitively a step forward. > > I'll do some tests about that. > > If the getDerived isn't

Re: Liskov principle and unittest

2011-09-26 Thread deadalnix
Le 25/09/2011 21:30, Philippe Sigaud a écrit : On Sun, Sep 25, 2011 at 20:02, deadalnix wrote: I think what he wants is to have automatically generated unittests for derived classes that check if the unittests of the parent still pass for them. I don't know of a nice way to do that without requ

Re: Liskov principle and unittest

2011-09-25 Thread Philippe Sigaud
On Sun, Sep 25, 2011 at 20:02, deadalnix wrote: >> I think what he wants is to have automatically generated unittests for >> derived classes that check if the unittests of the parent still pass for >> them. I don't know of a nice way to do that without requiring some >> minimal effort by the imple

Re: Liskov principle and unittest

2011-09-25 Thread deadalnix
I think what he wants is to have automatically generated unittests for derived classes that check if the unittests of the parent still pass for them. I don't know of a nice way to do that without requiring some minimal effort by the implementor of the derived class. Contracts quickly detect and r

Re: Liskov principle and unittest

2011-09-23 Thread Timon Gehr
On 09/23/2011 10:17 PM, Max Klyga wrote: On 2011-09-23 12:55:25 +0300, deadalnix said: I recently faced a problem in java. I have lots of classes inheriting from the same superclass. Thoses classes has to conform to some behaviour expected when manipulation the superclass as Liskov subs

Re: Liskov principle and unittest

2011-09-23 Thread Max Klyga
On 2011-09-23 12:55:25 +0300, deadalnix said: I recently faced a problem in java. I have lots of classes inheriting from the same superclass. Thoses classes has to conform to some behaviour expected when manipulation the superclass as Liskov substitution principle says. This is defin

Re: Liskov principle and unittest

2011-09-23 Thread mta`chrono
class Superclass { abstract int do_some_stuff(); abstract int do_some_other_stuff(); } class Foo1 : Superclass class Foo2 : Superclass class Foo3 : Superclass unittest { // get an instance of all classes Superclass[] instances = [new Foo1(), new Foo2(), new Foo3

Re: Liskov principle and unittest

2011-09-23 Thread Tobias Pankrath
The only thing that D unittest do, is executing code if you pass -unittest to the compiler. What you do in this code is entirely up to you. So, I think the answer is no. No you can't do this with the current language and standard library. When I started learning D, I thought the way D handles u

Liskov principle and unittest

2011-09-23 Thread deadalnix
I recently faced a problem in java. I have lots of classes inheriting from the same superclass. Thoses classes has to conform to some behaviour expected when manipulation the superclass as Liskov substitution principle says. This is definitvelly hard to achieve. Solution promoted on th