Benefits of being a Software Vegetarian

Software Engineering Done Right — s01e02

User-centric specification

There are no bugs, only undefined behavior.

BDD Definitions

Feature XYZ
- Scenario ABC
o Behavior 123
- Scenario PQR
o Behavior 456
- Scenario LMO
o Behavior 789

Cucumber salad

Feature XYZ
- Scenario ABC
o Given some initial context
o When something happens
o Then something else is resulting
Feature: Search number
- Scenario: Search for Arc-E-Tect’s phone number
o Given Arc-E-Tect’s phone number is listed
o When I search for Arc-E-Tect’s phone number in the
phonebook
o Then I get the default phone number for Arc-E-Tect

Putting it all together

testImplementation group: "io.cucumber",
name: "cucumber-java",
version: "5.4.1"
testImplementation group: "io.cucumber",
name: "cucumber-junit",
version: "5.4.1"
testImplementation group: "io.cucumber",
name: "cucumber-junit-platform-engine",
version: "5.4.1"
package com.arc_e_tect.blog.phonebook;
import io.cucumber.junit.platform.engine.Cucumber;

@Cucumber
public class RunCucumberTest {}
Feature: application - Greetings

Scenario: application - 01 - Greeting Arc-E-Tect
Given some initial state
When this is a trigger for certain behavior
Then certain behavior is exposed
io.cucumber.junit.platform.engine.UndefinedStepException: There were 3 undefined stepsThe step "some initial state" is undefined. You can implement it using the snippet(s) below:@Given("some initial state")
public void some_initial_state() {
// Write code here that turns the phrase above into concrete actions
throw new io.cucumber.java.PendingException();
}
The step "this is a trigger for certain behavior" is undefined. You can implement it using the snippet(s) below:@When("this is a trigger for certain behavior")
public void this_is_a_trigger_for_certain_behavior() {
// Write code here that turns the phrase above into concrete actions
throw new io.cucumber.java.PendingException();
}
The step "certain behavior is exposed" is undefined. You can implement it using the snippet(s) below:@Then("certain behavior is exposed")
public void certain_behavior_is_exposed() {
// Write code here that turns the phrase above into concrete actions
throw new io.cucumber.java.PendingException();
}

Disclaimer

Credits

Some people see things and ask ‘Why?’ I dream of things and ask ‘Why not?’

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store