Re: comments to JUnit spec

Jesse Glick <[email protected]>
Newsgroups gmane.comp.java.netbeans.user-interface
Organization Sun Microsystems / NetBeans
Message-ID <[email protected]>
Jaroslav Tulach wrote:
> 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.

Ideally we would have some broader data on this question.

>> No mention here of running individual test methods. [...]
> 
> 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. [...]

Yeah, I've noticed this often too. Sometimes I will set a breakpoint in 
the test method, then when the debugger stops there, set (or enable) 
other breakpoints in tested code, or just use F4. Clumsy though.

The problem is that JUnit does not seem to support this directly, at 
least as far as I understand it. I'm not sure how the proposed Ant patch 
works but it is worth following and contributing to.

> 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.

This would be lovely. Coverage is a basic ability applicable to all 
kinds of programming domains and a natural opportunity for IDE integration.

> [...] 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.

Could get interesting.

> We should however also offer advanced 
> features of nbjunit - memory allocation tests, garbage collection tests, 
> algorithm complexity ones. 

Also attractive, though we need to be conservative about shipping extra 
libraries (a la AbsoluteLayout), since we need to really support them. 
Would be worth looking around for existing, stable, open-source 
JUnit-based test frameworks that provide these kinds of abilities.

There's a lot of interesting progress being made in the programming 
world around testing - we should be aggressively supporting best 
practices as they arise.

-J.

-- 
[email protected]   x22801   netbeans.org   ant.apache.org
if I had known it was harmless I would have killed it myself
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.