JUnit Flashcards

1
Q

What is JUnit?

A

JUnit is a test framework which uses annotations to identify methods that specify a test.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are some of the annotations used in JUnit?

A

@BeforeAll
@AfterEach
@DisplayName
@Test

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Test Driven Development (TDD)?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the approach taken in TDD?

A

In the Test Driven Development (TDD), the test is first developed which specifies and validates what the code will do.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Benefits of unit testing?

A
  1. Unit testing increases confidence in changing/maintaining code.
  2. Codes are more reusable. To make unit testing possible, codes must be modular.
  3. Cost of fixing a defect during unit testing is less than defects detected at higher levels.
  4. Debugging becomes easier. When a test fails, only latest changes need to be debugged.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is unit testing?

A

A level of software testing where individual units of a software are tested.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Purpose of unit testing?

A

The purpose of unit testing is to validate that each unit in the software performs as designed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly