Test-driven development is a scary topic for many new developers, but the concepts are simple. Once you get the hang of TDD, the benefits become clear. Your code will be simpler, cleaner, and easier to refactor. With TDD, we only write the code we need to write, and avoid adding unnecessary fluff. It will no longer be a scary prospect to make changes to your code. You have tests to verify that your changes won’t break existing code. If something goes wrong, you’ll know where the break occurred.
Our goal for this chapter is to create a Calculator class that has a single method. That method will return ...