Can TPTP be used to generate JUnit stubs for interfaces and abstract classes? [message #20378] |
Tue, 28 June 2005 11:42  |
Eclipse User |
|
|
|
Hi,
I have questions regarding TPTP and JUnit testing support.
1. Can TPTP be used to generate JUnit tests stubs for each API method in
my project?
2. Does TPTP provide some support to test Java interfaces and abstract
classes?
3. Can TPTP update the test stubs whenever the API methods in my project
are renamed/added/removed?
Thanks a lot,
Chris
|
|
|
|
Re: Can TPTP be used to generate JUnit stubs for interfaces and abstract classes? [message #21100 is a reply to message #20431] |
Thu, 30 June 2005 16:05  |
Eclipse User |
|
|
|
Thanks for your response, Ali.
> I'm not clear about how you intend to test a Java interface/abstract class.
At the moment, each project seems to implement their own little framework
to go around this. JUnitDoclet 2.0 might provide a more standard solution
in the future:
http://www.junitdoclet.org/2005/04/000166.html
The new release will be able to generate abstract TestCases for interfaces
and abstract classes. Those tests will be applied to all instanciable
classes implementing the interfaces / deriving from these abstract
classes.
How about reusing test cases? Liskov Substitution Principle says, a class
B derived from class A should behave as class A, too. Applying the tests
from ATest on B would verify that. Because these additional test cases can
be generated without manual interference, one will get even more out of
exisiting test cases.
The problem is also described in this article.
http://www.ddj.com/documents/s=1679/ddj0302b/
Cheers,
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.07774 seconds