Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

junit

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do we do unit testing for java
 
Saloon Keeper
Posts: 10420
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Have you tried googling for guides or tutorials? Have you tried writing a test already? Did you get stuck on something?

It's easier for us to help you if you have more specific questions.
 
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Archana,

If you are new to the JUNIT, refer the below tutorials for learning.

https://www.javatpoint.com/junit-tutorial

https://www.tutorialspoint.com/junit/

Hope these sites will help to write unit testcase for Java program.
 
Marshal
Posts: 65057
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unit testing in its most basic form means testing every method with normal and abnormal inputs You may need to catch exceptions because some methods should throw an exception if you pass a negative number, or similar.

Moving to our testing forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!