bdd with the cucumber

23
BDD With Cucumber MÜCAHİT KURT Sn. Project Manager @ INNOVA @mucahitkurt

Upload: muecahit-kurt

Post on 06-Jan-2017

69 views

Category:

Software


0 download

TRANSCRIPT

Page 1: BDD with the Cucumber

BDD With Cucumber

MÜCAHİT KURTSn. Project Manager @ INNOVA

@mucahitkurt

Page 2: BDD with the Cucumber

Mücahit KurtSn. Project Manager

@mucahitkurt

@mucahitkurt

@mucahitkurt

mucahit.blogspot.com.tr

2

Page 3: BDD with the Cucumber

Test Pyramid

3

GUI Tests

API Tests

Integration Tests

Component Tests

Unit Tests

Manuel

Tests

GUI Tests

API Tests

Integration Tests

Component Tests

Unit Tests

Manuel Tests

How it should be done What many teams do

Page 4: BDD with the Cucumber

BDD Concept

“Using examples in conversation to illustrate behaviour.”

4

Specification by Example

Acceptance TDD

Extented TDD BDD

Page 5: BDD with the Cucumber

Why BDD?

5

Communication

Collaboration

Automation

Living Documentation

Page 6: BDD with the Cucumber

Traditional

6

Analyst DeveloperTester

Deployment

Bug Report

Requirements

Clarify

Page 7: BDD with the Cucumber

Collaboration

7

Analyst

Developer

Tester

Deployment

Bug Report

Requirements

Clarify

Specifications

Developer Analyst

Three Amigos

Tester

Page 8: BDD with the Cucumber

Cucumber is the Tool

8

Features

Scenarios

Steps

Page 9: BDD with the Cucumber

Cucumber

9

Your Project

Features

Scenarios

Steps

Step Definitions

Support Code

Automation Library

Your System

Business

Facing

Technology

Facing

Page 10: BDD with the Cucumber

Sample Feature

10

Language

Feature

Scenario

Steps

Page 11: BDD with the Cucumber

Gherkin is the Language

11

Cucumber supports over 60 spoken languages.

Page 12: BDD with the Cucumber

Step Definitions

12

Page 13: BDD with the Cucumber

Regular Expressions

13

http://regexr.com

Page 14: BDD with the Cucumber

How it Works?

14

Execute Scenario

Read First Step

Do we have a matching step definition?

Execute Step Definition Code

Block

Was an exception thrown?

Any more steps?

Passed Scenario Failed ScenarioPending Scenario

Undefined Scenario

Pending

Read next step

No

Yes

No

No

Yes

No

Yes

Yes

Page 15: BDD with the Cucumber

Expressive ScenariosBackground, Data Table, Scenario Outline, Tag, Hook

15

Page 16: BDD with the Cucumber

Outside-in

16

Failing

Acceptance

Test

Failing

Unit

Test

Make it

PassRefactor

Page 17: BDD with the Cucumber

17

Exercise

Page 18: BDD with the Cucumber

Keeping Your

Cucumbers SweetDon’t forget the test pyramid

Work together

Care your tests & codes

18

Page 19: BDD with the Cucumber

Environment

Parallel Run

19

Jenkins-Plugin-Parallel Run

Reporting

Different sets with tags

Spring, Pico-Container, Selenium etc. support

Page 20: BDD with the Cucumber

ConclusionCollaboration on requirements builds trust between

stakeholders and delivery team members

Collaboration requires preparation

Looking at the end goal as business process

documentation is a useful model

Long-term value comes from living documentation

20

Page 21: BDD with the Cucumber

References

The Cucumber For Java BookBy Seb Rose, Matt Wynne, Aslak Hellesoy

Specification By ExampleBy Gojko Adzic

21

Page 22: BDD with the Cucumber

End of the Fun

22

Page 23: BDD with the Cucumber

Credits

23

• Three feathers by Deb, https://www.flickr.com/photos/25154062@N02/5522723111/

• analyst by Gregor Črešnar from the Noun Project

• percentage by Gregor Črešnar from the Noun Project

• Money by Gregor Črešnar from the Noun Project

• Value by Gregor Črešnar from the Noun Project

• Search by Luis Prado from the Noun Project

• User by Wilson Joseph from the Noun Project

• bug by Robert Bjurshagen from the Noun Project

• cycle by Robert Bjurshagen from the Noun Project

• Checklist by Davo Sime from the Noun Project

• question-mark by Cris Dobbins from the Noun Project

• Cross by Zaff Studio from the Noun Project

• Back-ache !!!!!!!!!!! by Craig Sunter, https://www.flickr.com/photos/16210667@N02/9046360969

• Lemur up there by Tambako The Jaguar, https://www.flickr.com/photos/tambako/13662196145/