Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deepak-147/unit-testing-springboot-junit-mockito

Unit Testing SpringBoot application with JUnit and Mockito
https://github.com/deepak-147/unit-testing-springboot-junit-mockito

Last synced: 7 days ago
JSON representation

Unit Testing SpringBoot application with JUnit and Mockito

Awesome Lists containing this project

README

        

# TDD
Test Driven Development

Test-Driven Development (TDD) is a software development approach that emphasizes writing tests before writing the actual code. This methodology has gained popularity for its ability to improve code quality, enhance maintainability, and facilitate efficient collaboration among development teams.

## Red-Green-Refactor flow
![TDD-flow](./assets/images/flow.png)

TDD is a software development process that follows a cyclic pattern: Red-Green-Refactor. This cycle involves the following steps:

1. **Red**: Write a failing test for the specific functionality you’re about to implement. This test should demonstrate that the desired behavior is not currently present in the code.

2. **Green**: Write the minimum amount of code necessary to make the failing test pass. The goal is to achieve a passing test, indicating that the new functionality has been successfully added.

3. **Refactor**: Once the test passes, refactor the code to improve its design and maintainability. This step ensures that the code remains clean and well-structured.

## JUnit
JUnit is a unit testing framework designed for Java programming language.

## Code Coverage

![Code-Coverage-1](./assets/images/coverage_1.png)

![Code-Coverage-2](./assets/images/coverage_2.png)