2. 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
Connected Systems Consulting Ltd
3. Agenda
•
•
•
•
•
•
BDD 101
How can BDD help BizTalk projects
Simple Specflow Example
Detailed BizTalk Example
Limitations
Discussion
Connected Systems Consulting Ltd
4. 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
Connected Systems Consulting Ltd
5. 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
Connected Systems Consulting Ltd
7. 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)
Connected Systems Consulting Ltd
8. Example Behaviour
Why is the feature
important
Who cares about
the feature
What are we
trying to do
Prerequisites
The
trigger
What should
happen
9. Key Points
Key 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
Connected Systems Consulting Ltd
11. Common Challenges
Area
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
Connected Systems Consulting Ltd
12. 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
13. 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?
Connected Systems Consulting Ltd
14. 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
Connected Systems Consulting Ltd
15. 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
Connected Systems Consulting Ltd
16. Abstraction in the test
Gherkin
Specflow
Test Definition
BizUnit
Test Implementation
20. 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
Connected Systems Consulting Ltd
22. Common Challenges
Area
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
R
R
R
Testing
R
R
- The
feature files can be used as part of the documentation
- The documentation is
-
accurate to the build of code and can be published with a release
The scenarios are effective to document the scenarios and are not over excessive
- The
scenarios are maintained with the code
- There’s
- The
an abstraction between the intention and implementation of tests making them easier to understand
requirements drive the testing
Connected Systems Consulting Ltd
23. 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?
Connected Systems Consulting Ltd