+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

JUnit Interview Questions and Answers

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
Who Should Use JUnit?

JUnit is mostly used by developers for testing their written code. JUnit is designed for unit testing, which is really a coding process, not a testing process. But many testers or QA engineers, are also required to use JUnit for unit testing.

3
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.

4
Explain how you can write a simple JUnit test case?
  • Determine a subclass of TestCase
  • To initialize object(s) under test, override the setup() method
  • To release object(s) under test override the teardown() method
  • Determine one or more public test XYZ() methods that exercise the objects under test and assert expected results.

5
Mention what are parameterized tests?

Parameterized tests enable developer to perform the same test over and again using different values.

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US