O'Reilly logo

Scala Test-Driven Development by Gaurav Sood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing application code to fix the test – GREEN

Now we will write code in our application class to fix the test, that is, for it to go green. This will be done in baby steps, and we will only fix the issue the test complains about in each of the steps. This is where the term "test-driven" takes root. Our test is driving our implementation. At no point are we free to jump to conclusions.

Note

As you get better with your TDD, it is forgivable to jump a few steps. For appreciation and empathy with TDD, we will follow TDD in its purest form in this chapter.

From the error we got in our last run, that is, an implementation is missing, we can see that the test runner is complaining about a missing implementation of the function decimalToBinary.

To make ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required