Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Anybody using JUnit  RSS feed

 
Pres Brawner
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this is the right forum, and I know enough not to double post...
Is anybody using junit? What do you think of it?
Thanks,
Pres
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use it a lot, and I love it. I am also involved with several open-source development efforts which also use JUnit extensively.
There are several extensions to JUnit available for specific types of application which can be otherwise hard to test: HTTPUnit, J2EEUnit etc.
Do you have any particular JUnit questions?
 
Pres Brawner
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just scratching the surface of this. My company is thinking of incorporating it into their white box testing group. I was wondering if it wouldn't be more suited for the development staff to write the testing code, then let the testers know what the appropriate output should be.
In your experience, is it a good tool to assist in development, or as a demonstration that you are meeting the requirements of the design specifications? When do you use, why do you use it?
Thanks,
Pres
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use it primarily to assist in development. I rarely write anything these days without writing an associated JUnit test suite, and I don't really trust anything I haven't tested.
I'm a great believer in test early, test often (see my Golden Rules of Stress Free Programming). I have also found that considering testability from the start at all levels has greatly improved the flexibility of my code. It tends to be much more loosely coupled, and thus much easier to customize when the requirements change.
As for acceptance tests, I tend to leave that to the customer, or to an external test team. I feel that white-box testing is only really good at checking that the implmentation meets the developers assumptions about the requirement. Only the customer can tell if the "big picture" is actually something they want.
 
John Bateman
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
We use it as part of the development process. We also write mosts of our tests first, then build the class around our tests. (See Extreme Programming for more info).
This allows you to build a class that fits a test and not just write a test that will use a class the way it's been built.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!