behavior driven development in delphi

15
EMBARCADERO TECHNOLOGIES Behavior Driven Development Roman Yankovsky [email protected] http://roman.yankovsky.me/ http://plus.google.com/ +RomanYankovsky/ 12 th August, 2014 ownload a free trial – NOW! ttp://embt.co/trialdownloads

Upload: romanyankovsky

Post on 15-Jan-2015

552 views

Category:

Software


4 download

DESCRIPTION

In this Skill Sprint I introduce behavior driven development principles, tell a few words about Gherkin language and demonstrate how this can be applied to Delphi programming.

TRANSCRIPT

Page 1: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIESEMBARCADERO TECHNOLOGIES

Behavior Driven DevelopmentRoman [email protected]://roman.yankovsky.me/http://plus.google.com/+RomanYankovsky/

12th August, 2014Download a free trial – NOW!http://embt.co/trialdownloads

Page 2: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

This Skill Sprint Works with . . .

• Windows• OS X• Android• iOS• RAD Studio• Appmethod• Object Pascal• C++

• RAD Studio XE6 DocWiki– http://embt.co/raddocwiki– http://docwiki.embarcadero.com/RADStudio/XE6/en/

• Appmethod 1.14 DocWiki– http://embt.co/appmethoddocwiki – http://docwiki.appmethod.com/appmethod/1.14/topics/en/

• Appmethod supports the FireMonkey framework on all 4 platforms while RAD Studio, Delphi and C++Builder also support VCL on Windows. Contact sales with any questions!

Page 3: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

Communication is the Key

Customer := TCustomer.Create;

We would like to encourage new users to buy in your shop. Therefore we offer

10% discount for their first order.

1. Register a user2. Order a book3. Verify price

Product Owner Software Engineer QA

Page 4: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

Shared Understanding

Product Owner Software Engineer QA

Given the user has not ordered yetWhen the user adds a book with the price of EUR 10 into his shopping cartThen the shopping cart sub-total is EUR 9

Page 5: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

Behavior Driven DevelopmentGherkinBusiness Readable, Domain Specific Language that lets you describe software’s behaviour without detailing how that behaviour is implemented.https://github.com/cucumber/cucumber/wiki/Gherkin

I do think that the greatest potential benefit of DSLs comes when business people participate directly in the writing of the DSL code. The sweet spot, however is in making DSLs business-readable rather than business-writeable. If business people are able to look at the DSL code and understand it, then we can build a deep and rich communication channel between software development and the underlying domain.

© Martin Fowler

Page 6: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

In order to …As a …I want …

Page 7: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

In order to avoid silly mistakesAs a math idiotI want to be told the sum of two numbers

Page 8: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

Context

Event

Outcome

Scenario:

Page 9: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

Context

Event

Outcome

Scenario:GIVEN

Page 10: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

Context

Event

Outcome

Scenario:GIVEN

WHEN

Page 11: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

Context

Event

Outcome

Scenario:GIVEN

WHEN

THEN

Page 12: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

User Story in BDD

Feature: Calculator In order to avoid silly mistakes As a math idiot I want to be told the sum and the multiplication of two numbers

Scenario: Add two numbers Given I have entered 50 in calculator And I have entered 50 in calculator When I press Add Then the result should be 100 on the screen

Page 13: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

DEMONSTRATIONDelphiSpec

Page 14: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIES

Resources

• DelphiSpec– https://github.com/RomanYankovsky/DelphiSpec

• Samples– https://github.com/RomanYankovsky/DelphiSpec/tree/master/Demo

• Gherkin– https://github.com/cucumber/cucumber/wiki/Gherkin

• Blog Posts– http://roman.yankovsky.me/?p=1299– http://roman.yankovsky.me/?p=1458– http://roman.yankovsky.me/?p=1648

Download a free trial – NOW!http://embt.co/trialdownloads

Page 15: Behavior driven development in Delphi

EMBARCADERO TECHNOLOGIESEMBARCADERO TECHNOLOGIES

Q & A

Download your free trial now! http://embt.co/trialdownloads

@EmbarcaderoTech