1) Explain what is JUnit?
JUnit is a testing framework for unit testing. It uses Java as a programming platform, and it is an Open Source Software managed by the JUnit.org community.
2) Explain what is Unit Test Case?
Unit Test Case is a part of the code that ensures that the another part of code (method) behaves as expected. For each requirement, there must be at least two test cases one negative test and one positive test.
3) Explain how you can write a simple JUnit test case?
Determine one or more public test XYZ() methods that exercise the objects under test and assert expected results.
4) Mention what are parameterized tests?
Parameterized tests enable developer to perform the same test over and again using different values.
5) Mention what is the difference between JUnit and TestNG?
| || |
6) Mention different methods of exception handling in JUnit?
There are different methods of exception handling in JUnit
7) Explain what is ignore test in JUnit?
When your code is not ready, and it would fail if executed then you can use @Ignore annotation.
8) List out some useful JUnit extensions?
JUnit extensions include
9) Explain who should use JUnit – a developer or tester? Why you use JUnit to test your code?
JUnit is more often used by developers to implement unit tests in JAVA. It is designed for unit testing that is more a coding process and not a testing process. However, many testers and QA engineers use JUnit for unit testing.
JUnit is used because
10) Explain what is JUnitCore Class?
JUnitCore class is an inbuilt class in JUnit package; it is based on Façade design pattern, this class is used to run only definite test classes only.
11) Explain how you can run JUnit from the command window?
To run JUnit from the command window, you have to follow the steps
Refer our JUnit Tutorials for an extra edge in your interview.