Welcome to the String Calculator TDD Kata project. This repository showcases a disciplined approach to software craftsmanship using Test-Driven Development (TDD) principles.
The String Calculator is a simple utility that takes a string of numbers and returns their sum. It handles various delimiters, supports flexible input formats, and manages error cases such as negative numbers.
This project emphasizes the Red-Green-Refactor cycle of TDD to ensure the highest code quality and reliability.
- Empty Input Handling: Returns
0
for an empty string. - Comma & New Line Delimiters: Supports comma
,
and new line\n
delimiters. - Custom Delimiters: Allows custom delimiters using the format
//[delimiter]\n
. - Error Handling: Throws exceptions for negative numbers with a detailed message.
- Java 11 or higher installed
- A Java IDE like IntelliJ IDEA or Eclipse
- Maven or Gradle for dependency management
- Clone the Repository:
git clone https://github.com/mrajkishor/String-Calculator.git cd StringCalculatorTDD
- Open the project in Java IDE
- Build the Project:
- Using Maven
mvn clean install
- Using Gradle
./gradlew build
- Running the Tests:
- Using Maven
mvn test
- Using Gradle
./gradlew test
This project was developed using the TDD Red-Green-Refactor cycle:
- Red: Write a failing test case.
- Green: Write the minimum code to make the test pass.
- Refactor: Clean up the code while keeping all tests green.
Commit History: Every commit in this repository reflects incremental steps following the TDD principles, showcasing the thought process and evolution of the codebase.
📧 Contact Email: mrajkishor331@gmail.com