behaviour driven biztalk development

25
Behavior Driven BizTalk Development Connected Systems Consulting Ltd

Upload: michael-stephenson

Post on 12-May-2015

159 views

Category:

Technology


0 download

DESCRIPTION

How can you use BDD techniques to help you deliver effective BizTalk projects

TRANSCRIPT

Page 1: Behaviour Driven BizTalk Development

Behavior Driven BizTalk Development

Connected Systems Consulting Ltd

Page 2: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Who am I?Michael Stephenson

– UK-Based Freelance Consultant specializing in:• BizTalk• Windows Azure• Integration

– Was BizTalk MVP now a Microsoft Integration MVP for 5+ years

– One of organizers of UK Connected Systems User Group

– Blog: www.geekswithblogs.net/michaelstephenson

– Twitter: @michael_Stephen

– Linked In: http://www.linkedin.com/in/michaelstephensonuk1

Page 3: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Agenda• BDD 101• How can BDD help BizTalk projects• Simple Specflow Example• Detailed BizTalk Example• Limitations• Discussion

Page 4: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Setting the scene• Small integration team with a number of BizTalk and other

integration projects or varying sizes and flavours

• Team already has fairly mature development processes

• Growth in new projects and team size and complexity of projects

• As a team we wanted to look at bringing in any new practices which we felt will help us be more effective

• How people use BDD in the .net world is something we have been looking at

Page 5: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

What is BDD• Behaviour Driven Development

• Agile software development technique

• Extends the idea of test driven development

• Create a clear understanding of the behaviour of the software

• Common language with the business

• Is not a replacement for unit testing

Page 6: Behaviour Driven BizTalk Development

BDD 101

Page 7: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Gherkins & Cucumbers• Cucumber

– A ruby tool that lets you specify a behaviour in terms of Given/When/Then

• The language/syntax is called Gherkin

• You define your behaviour in a “feature file” using the Gherkin language

• In .net world SpecFlow is a tool that lets us do the same thing (there are a couple of others)

Page 8: Behaviour Driven BizTalk Development

Example BehaviourWhy is the feature important

What are we trying to do

Prerequisites

The trigger

What should happen

Who cares about the feature

Page 9: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Key PointsKey Point Description

Business Value Identifying why a feature is needed helps determine if its important

Scenarios A feature can have multiple scenarios

Given/When/Then Gives us an easy way to describe what will happening a domain language the business will understand

Development We write code to implement the behaviour

Page 10: Behaviour Driven BizTalk Development

HOW CAN BDD HELP BIZTALK PROJECTS?

Page 11: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Common ChallengesArea Challenges

Requirements X - Its difficult to capture effective requirements in enough detail

X – Its difficult the manage and communicate change in requirements

X – Its difficult to ensure the requirements that are in a release of code

Documentation X – Documentation is often out of data

X – Documentation rarely matches what is deployed

X – Documentation is often big

Testing X – Tests are often too technical to easily correlate to requirements

X – Its difficult to prove the software does what its supposed to

Page 12: Behaviour Driven BizTalk Development

An Example of current tests

• Tests are difficult to explain to non technical people

• Tests are difficult to understand if you don’t understand the business domain

• Its easy to read the implementation but difficult to understand the intention of parts of a test

Page 13: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Initial thoughts

• Can Gherkin help us define what we need to do?

• Can the features describing behaviour become documentation?

• Can we use the behaviours to help test BizTalk?

Page 14: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Introducing SpecFlow

• Specflow is a .net BDD framework

• Define features and scenarios in Visual Studio using the Gherkin language

• Features defined can become testable using SpecFlow

• Specflow tests are acceptance tests

Page 15: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

What about BizUnit?

• BizUnit is great at:– Execution of tests– Framework of test steps

• BizUnit struggles often at:– Helping you understand the intention of the test– Tests are too techy

• SpecFlow creates an abstraction between the intention and implementation of a test

Page 16: Behaviour Driven BizTalk Development

Abstraction in the test

Gherkin

Test Definition

BizUnit

Test Implementation

Specflow

Page 17: Behaviour Driven BizTalk Development

SIMPLE SPECFLOW EXAMPLE

Page 18: Behaviour Driven BizTalk Development

DETAILED BIZTALK EXAMPLE

Page 19: Behaviour Driven BizTalk Development

LIMITATIONS

Page 20: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Challenges

• BizUnitOM is a little tricky & some test steps need to add implementation of ITestStepOM.

• SpecFlow after scenario cant be used to fire the test (use a final Then)

• At present some BizUnit steps cant be ran without being in a BizUnit test so we need to build up the BizUnit test then execute it

Page 21: Behaviour Driven BizTalk Development

SUMMARY

Page 22: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Common ChallengesArea Challenges

Requirements R - Requirements can be easily defined using Given/When/Then

R – Requirements are close to the code so easier to manage as features and scenarios

R – Requirements are defined in domain language

Documentation R - The feature files can be used as part of the documentation

R - The documentation is accurate to the build of code and can be published with a release

R - The scenarios are effective to document the scenarios and are not over excessive

R - The scenarios are maintained with the code

Testing R - There’s an abstraction between the intention and implementation of tests making them easier to understand

R - The requirements drive the testing

Page 23: Behaviour Driven BizTalk Development

Connected Systems Consulting Ltd

Summary“We have a well established integration capability with a mature ALM process, however Behaviour Driven Development and SpecFlow is very interesting to us

because it offers ways to simplify some of our current pain points in the ALM process and make us more effective”

Would it help you?

Page 24: Behaviour Driven BizTalk Development

More Info

Source/Article Link

SpecFlow http://www.specflow.org/

Testing example with CAT framework webcast

http://www.cloudcasts.net/ViewWebcast.aspx?webcastid=2521028145037920619

Page 25: Behaviour Driven BizTalk Development

Questions?