solit 2013, behaviour driven development, Ихелис Александр

43
Behavior Driven Development by Aliaksandr Ikhelis, 2013 @Expedia.com Sunday, 10 March 13

Upload: solit

Post on 26-Dec-2014

273 views

Category:

Technology


4 download

DESCRIPTION

Александр Ихелис, Лондон, эксперт в автоматизации тестирования международного уровня «Behaviour Driven Development». Процессы, принципы разработки, бенефиты, примеры. Лекция. Development секция. Webinar из Лондона.

TRANSCRIPT

Page 1: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven Development

by Aliaksandr Ikhelis, 2013 @Expedia.comSunday, 10 March 13

Page 2: Solit 2013, Behaviour Driven Development, Ихелис Александр

• BDD

• Development workflow

• Testing quadrants (types of tests)

• Testing Pyramid

• Stubbing in Functional Tests

• Continuous Integration

Agenda

Sunday, 10 March 13

Page 3: Solit 2013, Behaviour Driven Development, Ихелис Александр

Communication Issue

They are slow!..

They do not know what they need!..

Sunday, 10 March 13

Page 4: Solit 2013, Behaviour Driven Development, Ихелис Александр

Communication Issue

They are slow!..

They do not know what they need!..

Sunday, 10 March 13

Page 5: Solit 2013, Behaviour Driven Development, Ихелис Александр

Building communication bridge

Sunday, 10 March 13

Page 6: Solit 2013, Behaviour Driven Development, Ихелис Александр

Building communication bridge

Sunday, 10 March 13

Page 7: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven Development

BDD is an evolution in the thinking behind TDD & ATDP

Focus on delivery of the prioritized and verifiable business value

by providing a common vocabulary

Sunday, 10 March 13

Page 8: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

Sunday, 10 March 13

Page 9: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

• Establish goals

Sunday, 10 March 13

Page 10: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

• Establish goals

• Draw out features using feature injection

Sunday, 10 March 13

Page 11: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

• Establish goals

• Draw out features using feature injection

• Involve stakeholders in the implementation process through outside-in software development

Sunday, 10 March 13

Page 12: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

• Establish goals

• Draw out features using feature injection

• Involve stakeholders in the implementation process through outside-in software development

• Use examples to describe behavior

Sunday, 10 March 13

Page 13: Solit 2013, Behaviour Driven Development, Ихелис Александр

Behavior Driven DevelopmentPractices

• Establish goals

• Draw out features using feature injection

• Involve stakeholders in the implementation process through outside-in software development

• Automate examples to provide quick feedback and regression testing

• Use examples to describe behavior

Sunday, 10 March 13

Page 14: Solit 2013, Behaviour Driven Development, Ихелис Александр

What BDD adds to TDD

Sunday, 10 March 13

Page 15: Solit 2013, Behaviour Driven Development, Ихелис Александр

What BDD adds to TDD

• Test what an object does instead of what it is

Sunday, 10 March 13

Page 16: Solit 2013, Behaviour Driven Development, Ихелис Александр

What BDD adds to TDD

• Test what an object does instead of what it is

• Design top-down, which is essential for YAGNI – You Aren't Gonna Need It

Sunday, 10 March 13

Page 17: Solit 2013, Behaviour Driven Development, Ихелис Александр

What BDD adds to TDD

• Test what an object does instead of what it is

• Design top-down, which is essential for YAGNI – You Aren't Gonna Need It

• Define acceptance criteria with the customer and specify it in the automated way, serve the living spec

Sunday, 10 March 13

Page 18: Solit 2013, Behaviour Driven Development, Ихелис Александр

The BDD “Outside-In” cycle

Sunday, 10 March 13

Page 19: Solit 2013, Behaviour Driven Development, Ихелис Александр

The BDD “Outside-In” cycle

Sunday, 10 March 13

Page 20: Solit 2013, Behaviour Driven Development, Ихелис Александр

Gherkin: feature title and narrative

Feature: Adding movies to the queue

Sunday, 10 March 13

Page 21: Solit 2013, Behaviour Driven Development, Ихелис Александр

Gherkin: feature title and narrative

Feature: Adding movies to the queue

Sunday, 10 March 13

Page 22: Solit 2013, Behaviour Driven Development, Ихелис Александр

Gherkin: feature title and narrative

Feature: Adding movies to the queue

Sunday, 10 March 13

Page 23: Solit 2013, Behaviour Driven Development, Ихелис Александр

Gherkin: feature title and narrative

Feature: Adding movies to the queue

Sunday, 10 March 13

Page 24: Solit 2013, Behaviour Driven Development, Ихелис Александр

Describing Features with Cucumber

Cucumber is a BDD tool that reads plain text descriptions of application features with example scenarios, which can be converted into automation. The text is written in a business readable domain language, known as Gherkin.

Sunday, 10 March 13

Page 25: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

Cucumber step definitions

Sunday, 10 March 13

Page 26: Solit 2013, Behaviour Driven Development, Ихелис Александр

Describing code with RSpec

RSpec is a BDD framework, which is used to write executable examples of the expected behaviour of a small bit of code in a controlled context.

Code example: Output:

Sunday, 10 March 13

Page 27: Solit 2013, Behaviour Driven Development, Ихелис Александр

Describing code with RSpecDescribing code with RSpec

Sunday, 10 March 13

Page 28: Solit 2013, Behaviour Driven Development, Ихелис Александр

Example: process flow

Sunday, 10 March 13

Page 29: Solit 2013, Behaviour Driven Development, Ихелис Александр

Example: story card

Sunday, 10 March 13

Page 30: Solit 2013, Behaviour Driven Development, Ихелис Александр

Describing code with RSpecDescribing code with RSpec

Sunday, 10 March 13

Page 31: Solit 2013, Behaviour Driven Development, Ихелис Александр

Benefits

• Communication

• Living Documentation

• Traceability

• Focus on behavior

Sunday, 10 March 13

Page 32: Solit 2013, Behaviour Driven Development, Ихелис Александр

Sunday, 10 March 13

Page 33: Solit 2013, Behaviour Driven Development, Ихелис Александр

Testing quadrands

Sunday, 10 March 13

Page 34: Solit 2013, Behaviour Driven Development, Ихелис Александр

AFTERBEFORE

Get the testing pyramid (un)fit

Sunday, 10 March 13

Page 35: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

Stubbing services/back-ends

Sunday, 10 March 13

Page 36: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

• Spoofing the service (replicate behavior with mocked backend + store data)

• Prepared canned responses

• Stubbing per browser session

Stubbing services/back-ends

Sunday, 10 March 13

Page 37: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

Stage 1 Stage 2 Stage 3- Compile - Deploy - Stub - Package - isWorking acceptance- Unit tests - Stub- PMD (static analysis) integration

Jenkins: trunk pipeline

Sunday, 10 March 13

Page 38: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

Jenkins: trunk pipeline

Sunday, 10 March 13

Page 39: Solit 2013, Behaviour Driven Development, Ихелис Александр

© 2012 Expedia, Inc..

•Start small

•Keep it fast – set a limit

•Fail Fast

•Keep it green

•Everyone is responsible for Quality

•Pre-checkin Ant Targets

CI tips

Sunday, 10 March 13

Page 40: Solit 2013, Behaviour Driven Development, Ихелис Александр

Speaking the same language = building together

As an awesome teamWe want to build such a great productSo that everyone loves it

Given the investment of 22M of bricks When you place all the bricks properly Then the Solit Conference Tower is visible to all people across the Globe

Sunday, 10 March 13

Page 41: Solit 2013, Behaviour Driven Development, Ихелис Александр

Do not forget to Have Fun!

Sunday, 10 March 13

Page 43: Solit 2013, Behaviour Driven Development, Ихелис Александр

Recommended reading

by Aliaksandr Ikhelis, 2013Sunday, 10 March 13