---
title: "String Calculator"
url: "https://osherove.com/string-calculator.md"
canonical: "https://osherove.com/string-calculator"
tags: []
author: "Roy Osherove"
description: "Intro The following is a TDD Kata- an exercise in coding, refactoring and test-first, that you should apply daily for at least 15 minutes . You can downloa"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# String Calculator

TDD Kata

# Intro

The following is a TDD Kata- an exercise in coding, refactoring and test-first, that you should apply daily for at least 15 minutes .

[You can download a more readable version of the Kata here.](https://osherove.com/s/String-Calculator-Kata-v1.pdf)

## Before you start: 

- Try not to read ahead.

- Do one task at a time. The trick is to learn to work incrementally.

- Make sure you only test for **correct inputs**. there is no need to test for invalid inputs for this kata

---

# Step 1

```
Create a simple String calculator with a method signature:
```

```
Hints:
```

---

# Detail 3

Sed a ligula quis sapien lacinia egestas. Suspendisse nec congue purus. Nulla eu pretium massa. Aliquam bibendum, turpis eu mattis iaculis, ex lorem mollis sem, ut sollicitudin risus orci quis tellus. Quisque congue porttitor ullamcorper. Donec eget risus diam. Sed a ligula quis sapien lacinia egestas.


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
