• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Guide to JUnit Testing

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is there a guide or something to writing a good test suite? I need to do some blackbox testing, how can I ensure that I reasonably test such that I can find all/most of the bugs that exist? This I guess is more of an exercise than a real need at the moment, but I'm just wondering if there are some tips to make sure that I don't miss cases when I test.

Also, I'll probably write this test suite in JUnit, are there any tips specific to JUnit?

Thanks.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Presumably you've had a look at junit.org and read some of the material there. As the name implies, JUnit is best suited to unit testing rather than black box testing. Having said that, there are many extensions to JUnit for different purposes.

What sort of application are you thinking of testing? If it is a web app then perhaps HttpUnit (which simulates HTTP requests) may be of interest.

Good luck if you want to ensure that you've removed all defects from any non-trivial application!
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tom,

Welcome to JavaRanch!

Writing really good tests is a skill that takes some practice. A good book can help you learn. Look at, for example, the excellent JUnit Recipes by J.B. Rainsberger.
 
author
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by zinc ster:
[QB]how can I ensure that I reasonably test such that I can find all/most of the bugs that exist? ... I'm just wondering if there are some tips to make sure that I don't miss cases when I test.
[QB]



My best tack on getting good test coverage is to use upper level tests that tries to copy how you expect your users to use you product. Here's a blog entry I wrote called Mock Client Testing. It talks about this topic directly.
 
reply
    Bookmark Topic Watch Topic
  • New Topic