Re: JUNIT questions
- From: "Taria" <mchew02@xxxxxxxxxxx>
- Date: 28 Feb 2007 10:01:08 -0800
JUnit's not a debugger; it runs tests suites, and reports
on whether they pass or fail.
I thought it wasn't...thank you for confirming my suspicion.
I'm happy to use a debugger because a debugger has always been my
If they fail, JUnit can report which test failed, along with
the difference between the expected value and the actual value
or the exception that was thrown. (I run JUnit from Ant, so
I don't know how you'd get that information in your IDE.)
If you'd like to use a debugger to fix the failure, you're
welcome to do it, but you need to go find a debugger. After
you've made your changes, use JUnit to re-run your tests.
friend. But I asked my professor about this and he said I didn't need
too. (Confusion sets in again.)
Andrew wrote:
The latest Eclipse and IntelliJ IDEs can also run your JUnit tests
themselves. Because of this integration, you can simply double click
on the Junit failure/exception message and they open the necessary
file with the focus on the appropriate method.
Yes, I use eclipse..it's intimidating but once I got something to
work, it is handy I will admit that. :p
For the benefit of the OP, on the debugging issue, I've long stopped
using a debugger by creating one single junit test and writing just
enough to make it pass, rinse & repeat.
it tends to be faster than debugging.
All tests pass at this point and it took no time at all...
This is a small example, but it should show you how you can write unitOk, this part needs lots of digesting, I'm 20 minutes from a class and
tests, without having the implementation there to make them work. And
it shows how you can make them work quickly, but not fully, so that
later tests force your design to become better.
can't concentrate fully but I need to get this part down...thank you
Andrew for that hint how to use JUNIT without using a debugger. This
method is so diverse from my past experiences of fixing flawed code
that I can tell you right now, I'm incredulous about the very idea.
My professor said the very same thing in different words, I appreciate
the example, he didn't supply that part, however.
Again, I thank everyone that has responded to my question, I must rush
to class..I hate the "you're late" dirty professor looks.
.
- References:
- JUNIT questions
- From: Taria
- Re: JUNIT questions
- From: Mark Jeffcoat
- Re: JUNIT questions
- From: andrewmcdonagh
- JUNIT questions
- Prev by Date: Some help wanted in class design -- Immutability
- Next by Date: Struts Validator - Validwhen and Map backed forms
- Previous by thread: Re: JUNIT questions
- Next by thread: Re: JUNIT questions
- Index(es):