Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • 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: 10682
229
  • 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: 65840
250
  • 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.
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!