alexander litvinok (software engineer) "bdd wtf"

Post on 10-Nov-2014

3.217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

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

true is near..

Alex Litvinok

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

Behavior Driven Development

.. this is just behavioral specifications.

DDD

TDDBDD

Au

tom

ation

Testin

g

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"

This is Gherkin..

Just..Given/ When/ And / Then

Implementation.Cucumber

Given /^I signed up as owner$/ dopending

end

– Ruby

Scenario Step Definition Domain Classes

Scriptin

g

Integratio

n

Scenarios should be:

Easy to understandConsistent

Easy to access

Experience

Task

Check possibility of read/write for MySQL in the PHP

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

We've got the following steps:

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

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

$this -> conn = mysql_connect();

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

}}

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.

top related