Home / Interview / Junit :: General Questions

Interview :: Junit

1) What is Testing?

Testing is the process of checking the functionality of the application whether it fulfills the requirement or not.

2) What is JUnit?

JUnit is the testing framework, it is used for unit testing of Java code.

3) What is unit testing?

The process of testing individual functionality (known as a unit) of the application is called unit testing.

4) What is the difference between manual testing and automated testing?

Manual testing is performed by Human, so it is time-consuming and costly. Automated testing is performed by testing tools or programs, so it is fast and less costly.


Give some disadvantages of manual testing?

Following are some disadvantages of manual testing:

  • The testing is very time consuming and is very tiring.
  • The testing demands a very big investment in the human resources.
  • The testing is less reliable
  • The testing cannot be programmed.


List out some advantages of automated testing?

Some of the advantages of automated testing are:

  • It is very fast.
  • Investment is very less.
  • Testing is more reliable.
  • The testing can be programmed.

7) Is it necessary to write the test case for every logic?

No, we should write the test case only for that logic that can be reasonably broken.

8) What are the useful JUnit extensions?
  • JWebUnit
  • XMLUnit
  • Cactus
  • MockObject
9) How is the testing of 'private' method done?

There is no direct way for testing of the private method; hence manual testing is to be performed, or the method is changed to "protected" method.

10) If the JUnit method's return type is 'string', what will happen?

JUnit test methods are designed to return 'void'. So the execution will fail.