Battle: BDD vs notBDD

Post on 22-Jan-2018

43 views 2 download

Transcript of Battle: BDD vs notBDD

1CONFIDENTIAL

BDD to Do or not to Do

Roman Iovlev Anton Shapin

2CONFIDENTIAL

ROMAN IOVLEV

Chief QA Automation

In Testing more than 12 years

In Testing Automation 10 years

3CONFIDENTIAL

Let’s bdd it

4CONFIDENTIAL

EXPERT

5CONFIDENTIAL

EXPERT

6CONFIDENTIAL

• Layer, Regex steps

• Scripted poor language

• DDT, step to step

• No classes

• Debug

• Navigation…

PAIN

7CONFIDENTIAL

• Time:• BDD layer support

• Workarounds with before and in data flow

• Tests support (debug, navigation…)

• …

• Stability

• Complexity

• …

• No profit (((

LOOSES

8CONFIDENTIAL

WHY?

9CONFIDENTIAL

WHAT IS BDD?

10CONFIDENTIAL

Scenario: Sum two numbers

• Given I Have Calculator

• When I calculate sum of ‘2’ and ‘3’

• Then I get result ‘5’

TESTS IN GHERKIN

11CONFIDENTIAL

public void sumTwoNumbers() {

Calculator calc = new Calculator();

int sum = calc.sum(2,3);

areEquals(sum, 5);

}

TESTS IN GHERKIN

Scenario: Sum two numbers

• Given I Have Calculator

• When I calculate sum of ‘2’ and ‘3’

• Then I get result ‘5’

public void sumTwoNumbers() {

I.HaveCalculator();

I.CalculateSum(2,3);

I.GetResult(5);

}

STEPS

PATTERN

13CONFIDENTIAL

We write 200 tests per year…

We write 300 tests per year!

Really? And what about thousands of tests?

PROFIT?

14CONFIDENTIAL

In 90% or even 95%

cases we don’t need

BDD on projects

NO REASONS TO USE BDD

15CONFIDENTIAL

• homePage.open();

• loginForm.loginAs(admin)

• mainMenu.select(Search);

• products.filterBy(“MacBook”)

• Assert.eachOf(SearchResults)

.contains(“MacBook”);

CODE LIKE BDD

16CONFIDENTIAL

• Write tests faster

• More stable

• More obvious, clear and simple...

WRITE NO BDD

17CONFIDENTIAL

WHEN IT IS GOOD TO USE BDD?

18CONFIDENTIAL

HOW IT IS GOOD TO USE BDD?

19CONFIDENTIAL

CONTACTS

roman.Iovlev

roman_iovlev@epam.com