JUnit
JUnit Annotations Tutorial with Example
What is JUnit Annotations? JUNIT ANNOTATIONS is a special form of syntactic meta-data that can be...
JUnit is an open source Unit Testing Framework for JAVA. It is useful for Java Developers to write and run repeatable tests. Erich Gamma and Kent Beck initially develop it. It is an instance of xUnit architecture. As the name implies, it is used for Unit Testing of a small chunk of code.
Developers who are following test-driven methodology must write and execute unit test first before any code.
Once you are done with code, you should execute all tests, and it should pass. Every time any code is added, you need to re-execute all test cases and makes sure nothing is broken.
Tutorial | How to Download and Installation JUnit |
Tutorial | JUnit Test framework |
Tutorial | JUnit Annotations & API |
Tutorial | Junit Assert |
Tutorial | Create JUnit Test Suite |
Tutorial | JUnit Ignore Test |
Tutorial | JUnit Exception Test |
Tutorial | JUnit ErrorCollector |
Tutorial | JUnit Parameterized Test |
Tutorial | JUnit Vs TestNG |
Before discussing Junit testing in detail, it is imperative to understand what is Unit Testing?
Unit Testing is used to verify a small chunk of code by creating a path, function or a method. The term "unit" exist earlier than the object-oriented era. It is basically a natural abstraction of an object oriented system i.e. a Java class or object (its instantiated form).
Unit Testing and its importance can be understood by below-mentioned points:
Learn more about unit testing here
JUnit has added many new features in JUnit4. You can understand it easily by comparing JUnit 3.x and JUnit 4.x.
Below is quick comparison between JUnit4.x and JUnit 3.x -
What is JUnit Annotations? JUNIT ANNOTATIONS is a special form of syntactic meta-data that can be...
In Junit, test suite allows us to aggregate all test cases from multiple classes in one place and...
Sometimes you may require not to execute a method/code or Test Case because coding is not done...
In a normal scenario, whenever you identify any error during test execution, you would stop the...
What is Junit Assert? Assert is a method useful in determining Pass or Fail status of a test case,...
JUnit provides the facility to trace the exception and also to check whether the code is throwing...