官术网_书友最值得收藏!

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 number
  • Then, I get a binary equivalent B of the original decimal number

Scenario 2:

  • Given I have binary number X
  • When I convert this number to a decimal number
  • Then, I get a decimal equivalent Y of the original binary number

Scenario 3:

  • Given I have decimal number A
  • When I convert A to binary to get binary number B
  • And again convert B to decimal number C
  • Then A is equal to C

Tip

To read more about gherkin language visit: https://github.com/cucumber/cucumber/wiki/Gherkin

主站蜘蛛池模板: 玛多县| 通河县| 迁安市| 萍乡市| 高密市| 苏尼特左旗| 临夏市| 永胜县| 泗阳县| 来凤县| 乌兰察布市| 丰台区| 郸城县| 临漳县| 上犹县| 德惠市| 永靖县| 盘山县| 越西县| 上饶县| 同德县| 牡丹江市| 玉屏| 清丰县| 丁青县| 珲春市| 高密市| 焦作市| 北碚区| 安福县| 五莲县| 绵阳市| 萨迦县| 东兴市| 理塘县| 泾川县| 叶城县| 滦南县| 洛扎县| 新野县| 太康县|