JUnit Flashcards
What is JUnit?
JUnit is a test framework which uses annotations to identify methods that specify a test.
What are some of the annotations used in JUnit?
@BeforeAll
@AfterEach
@DisplayName
@Test
What is Test Driven Development (TDD)?
Test Driven Development starts with designing and developing tests for every small functionality of an application. The primary goal of TDD is to make the code clearer, simple and bug-free.
What is the approach taken in TDD?
In the Test Driven Development (TDD), the test is first developed which specifies and validates what the code will do.
Benefits of unit testing?
- Unit testing increases confidence in changing/maintaining code.
- Codes are more reusable. To make unit testing possible, codes must be modular.
- Cost of fixing a defect during unit testing is less than defects detected at higher levels.
- Debugging becomes easier. When a test fails, only latest changes need to be debugged.
What is unit testing?
A level of software testing where individual units of a software are tested.
Purpose of unit testing?
The purpose of unit testing is to validate that each unit in the software performs as designed.