J Unit Interview Questions
(1) What is Junit?
J unit is a regression testing framework used to create
unit test cases by developers.it is an open-source framework to write
and run repeatable tests.
(2) What is the difference between JUnit 3 and JUnit 4?
|
|
|
|
|
|
|
|
(3) How do we write JUnit test cases?
In j unit 3 test
cases are written by extending the JUnit test case class. In JUnit 4 test cases are written by annotations.
(4) What is the JUnit life cycles method?
In JUnit 3 there are two life cycle methods
setup() and teardown().both methods are called before and after each
test method.
In JUnit 4 there are 4 life cycle methods.setupBeforeClass(),setup(),teardown()
and tearDownAfterClass().setupBeforeClass() is called before
the testcase and tearDownAfterClass() is called after the testcase.
(5) What is the naming convention of test methods?
Test methods must start with test prefix
“test” in JUnit 3.in j unit 4 naming convention is not required, we have to put
annotation @Test above test method for testing the particular method.
(6) What is regression testing?
When a new
functionality is tested with old functionalities that is known as
regression testing.
(7) What is the difference between JUnit testing and regression testing?
Both are the same and
done with the help of JUnit test cases.
(8) Who prepare the JUnit test case?
Developers
(9) Who performing JUnit testing?
Developers
(10) What is a test suite?
Test suite is
collection of test cases.
(11) What is unit testing?
Unit testing
represents smallest testable part of an application called units is being
tested with JUnit.
(12) What is a test case?
Testcase is a class that contains multiple test methods.
(13) What is load testing?
It is performance
testing to check system under load.
No comments:
Post a Comment