Re: Re: comments to JUnit spec

Jaroslav Tulach <[email protected]>
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Dne pondělí 16 květen 2005 18:03 Jesse Glick napsal(a):
> Some comments from me too.
>
> I think focussing too much attention on a 1-1 correspondence between
> source methods and test methods may be a mistake. Sometimes it happens
> that way, but usually it doesn't (I am guessing). Similarly, trying to
> have the IDE "help" you make a test for more than one source at a time
> is just a waste of time.

I've seen some people use 1-1 mapping, but that is really minority of guys I 
know. Just search through NetBeans test cases and you will see that most of 
them do not use such convention.

> No mention here of running individual test methods. This may be possible
> with Ant 1.7 - follow the RFE in the Ant bug database and think about
> how we could use it.

Imho this is P1. I often have test case with a lot of methods and I want to 
debug the 13th one. I have breakpoints in code and the problem is that before 
the execution gets to 13th test method, it uselessly stops on them. Of course 
better usability of debugger would be solution, but the simplest one is to 
just allow direct execution of individual test method.

> Generally, I think most of the existing JUnit GUI is of limited value
> and we should be looking for things that really improve productivity and
> add value to the text editor. For example, what do I need to do to make
> a mock version of some class in my sources to simplify testing - will
> the IDE help me? Not now. Could it? Probably yes.

Yes, there is a lot of ways to do to improve productivity and I do not see 
much of them addressed. 

Very needed thing is integration with test coverage tool. Be able to run it, 
present the results in browser or (better) in editor. We have emma 
integration for NetBeans projects, we should have it for standard j2se ones 
as well.

Second direction is making the support really helpful for people who write 
tests. Jesse mentioned creation of mock objects, I have to second that and 
I'd like to add that we should come up with direct support writing some of 
the test patterns[1] we know about: inversion of control, testing AWT like 
code, randomized tests, layered tests, writing TCKs, logging tests. Those all 
can be supported with standard junit. We should however also offer advanced 
features of nbjunit - memory allocation tests, garbage collection tests, 
algorithm complexity ones. 

Implementing at least parts of these suggestions would turn the junit support 
from a nice toy to really useful tool.
-jst

[1] http://openide.netbeans.org/tutorial/test-patterns.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.