solit 2013, behaviour driven development, Ихелис Александр
DESCRIPTION
Александр Ихелис, Лондон, эксперт в автоматизации тестирования международного уровня «Behaviour Driven Development». Процессы, принципы разработки, бенефиты, примеры. Лекция. Development секция. Webinar из Лондона.TRANSCRIPT
Behavior Driven Development
by Aliaksandr Ikhelis, 2013 @Expedia.comSunday, 10 March 13
• BDD
• Development workflow
• Testing quadrants (types of tests)
• Testing Pyramid
• Stubbing in Functional Tests
• Continuous Integration
Agenda
Sunday, 10 March 13
Communication Issue
They are slow!..
They do not know what they need!..
Sunday, 10 March 13
Communication Issue
They are slow!..
They do not know what they need!..
Sunday, 10 March 13
Building communication bridge
Sunday, 10 March 13
Building communication bridge
Sunday, 10 March 13
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
Behavior Driven DevelopmentPractices
Sunday, 10 March 13
Behavior Driven DevelopmentPractices
• Establish goals
Sunday, 10 March 13
Behavior Driven DevelopmentPractices
• Establish goals
• Draw out features using feature injection
Sunday, 10 March 13
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
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
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
What BDD adds to TDD
Sunday, 10 March 13
What BDD adds to TDD
• Test what an object does instead of what it is
Sunday, 10 March 13
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
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
The BDD “Outside-In” cycle
Sunday, 10 March 13
The BDD “Outside-In” cycle
Sunday, 10 March 13
Gherkin: feature title and narrative
Feature: Adding movies to the queue
Sunday, 10 March 13
Gherkin: feature title and narrative
Feature: Adding movies to the queue
Sunday, 10 March 13
Gherkin: feature title and narrative
Feature: Adding movies to the queue
Sunday, 10 March 13
Gherkin: feature title and narrative
Feature: Adding movies to the queue
Sunday, 10 March 13
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
© 2012 Expedia, Inc..
Cucumber step definitions
Sunday, 10 March 13
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
Describing code with RSpecDescribing code with RSpec
Sunday, 10 March 13
Example: process flow
Sunday, 10 March 13
Example: story card
Sunday, 10 March 13
Describing code with RSpecDescribing code with RSpec
Sunday, 10 March 13
Benefits
• Communication
• Living Documentation
• Traceability
• Focus on behavior
Sunday, 10 March 13
Sunday, 10 March 13
Testing quadrands
Sunday, 10 March 13
AFTERBEFORE
Get the testing pyramid (un)fit
Sunday, 10 March 13
© 2012 Expedia, Inc..
Stubbing services/back-ends
Sunday, 10 March 13
© 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
© 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
© 2012 Expedia, Inc..
Jenkins: trunk pipeline
Sunday, 10 March 13
© 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
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
Do not forget to Have Fun!
Sunday, 10 March 13
• [email protected]• www.linkedin.com/in/aikhelis/
Sunday, 10 March 13
Recommended reading
by Aliaksandr Ikhelis, 2013Sunday, 10 March 13