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

Problem statements

The problem statement, which we will define in this chapter, will be used throughout the book. In forthcoming chapters, we will build on this problem statement. We will be looking at building a base conversion API. We will start with an initial base 10 (decimal) number to base 2 (binary) conversions and vice versa. Then, we will add more bases for conversion.

Let's write this down in gherkin language. Gherkin is a business readable, domain-specific language that lets you describe a software's behavior without detailing how that behavior is implemented.

Feature: decimal to binary conversion:

As a user, I want to convert a decimal number to a binary number:

Scenario 1:

  • Given I have a number A
  • When I convert this number to a binary ...

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