alexander litvinok (software engineer) "bdd wtf"

17

Click here to load reader

Upload: miniq-epam-systems-inc

Post on 10-Nov-2014

3.217 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Alexander Litvinok (software engineer) "bdd wtf"

BDD: WTF? @#Have you ever heard of BDD/Gherkin/etc.?

true is near..

Alex Litvinok

© 1993-2012. EPAM Systems. All Rights Reserved.

Page 2: Alexander Litvinok (software engineer) "bdd wtf"

Behavior Driven Development

.. this is just behavioral specifications.

Page 3: Alexander Litvinok (software engineer) "bdd wtf"

DDD

TDDBDD

Au

tom

ation

Testin

g

Page 4: Alexander Litvinok (software engineer) "bdd wtf"

Feature: Post articles

In order to show trip photos

A owner

Should be abble to post article

Scenario: Post article by owner

Given I signed up as owner

When I write article "About myself"

And I post article

Then I should see "Article is created"

Page 5: Alexander Litvinok (software engineer) "bdd wtf"

This is Gherkin..

Page 6: Alexander Litvinok (software engineer) "bdd wtf"

Just..Given/ When/ And / Then

Page 7: Alexander Litvinok (software engineer) "bdd wtf"

Implementation.Cucumber

Page 8: Alexander Litvinok (software engineer) "bdd wtf"

Given /^I signed up as owner$/ dopending

end

– Ruby

Page 9: Alexander Litvinok (software engineer) "bdd wtf"

Scenario Step Definition Domain Classes

Scriptin

g

Integratio

n

Page 10: Alexander Litvinok (software engineer) "bdd wtf"

Scenarios should be:

Easy to understandConsistent

Easy to access

Page 11: Alexander Litvinok (software engineer) "bdd wtf"

Experience

Page 12: Alexander Litvinok (software engineer) "bdd wtf"

Task

Check possibility of read/write for MySQL in the PHP

Page 13: Alexander Litvinok (software engineer) "bdd wtf"

Feature: Check read/write for MySQL in PHP

Scenario: Check writeGiven connection to MySQLWhen database and a table is selectedThen some data is inserted

Scenario: Check readGiven connection to MySQLWhen database and a table is selectedAnd some data is insertedThen some data is read

Page 14: Alexander Litvinok (software engineer) "bdd wtf"

We've got the following steps:

1. connection to MySQL2. database and a table is selected3. some data is inserted4. some data is read

Page 15: Alexander Litvinok (software engineer) "bdd wtf"

/*** @Given /^ connection to MySQL$/*/public function connect(){

$this -> conn = mysql_connect();

if ( ! $this -> conn ) {throw new Exception();

}}

Page 16: Alexander Litvinok (software engineer) "bdd wtf"

Resume

BDD is a software development process.It is based on the behavior specification.

Gherkin is a meta language for writing scenarious.Cucumber is tool for testing on different languages.

Page 17: Alexander Litvinok (software engineer) "bdd wtf"