Behavior Driven Development with BizTalk Server - TechNet Articles - United States (English) - TechNet Wiki

Table of Contents

Behavior Driven Development with BizTalk Server

Introduction

This page is intended as a place to help you explore the use of behavior driven development techniques and how it can be applied to BizTalk development.

While this article focuses on use of this technique for BizTalk solutions, this BDD approach can also be used to develop any solutions that call or expose interfaces.

What is Behavior Driven Development?

Behavior Driven Development is an agile software development practice that changes the way we do testing as a developer to focus on defining the behavior of software using business language and allowing us to work closely with non-technical people to agree the specification for what the software should do.  In this process we write features using the standard user story type approach and within that acceptance tests using the Gherkin syntax of Given/When/Then.  An example could be:

Feature: Employee Promotion Rules

In order to manage staff promotions

As a hr manager

I want to be able to calculate if an employee should be promoted or not

Scenario: Level 4 Employee should not be promoted regardless of score

Given I have an employee called Joe 

And the employees current level is Level 4

And the employees current performance is 100

When The employees appraisal is evaluated by the promotion rules

Then the employees appraisal score should be 100

And the employee should not be recommended for promotion

BDD is not a replacement for test driven development but should enhance it to give you a number of significant additional benefits.

For more background on BDD please refer to Wikipedia.

Business Case

Justifications as to why we should adopt BDD and stubbing in integration and interface solutions is documented here:

What are some of the Tools for BDD in the .net world?

In the .net world there are a number of tools available to help you implement BDD they are listed below: 

In most of the articles we have written for BizTalk and BDD we have used Specflow but the principles are equally transferable to other implementations.

How can it be applied to BizTalk?

Below are a number of different resources showing how BDD can be applied to different aspects of BizTalk development. 

[Getting Started] Overview of developing BizTalk Solutions with BDD

Michael Stephenson has produced videos with example code.  These are available via CodePlex http://biztalkbddsample.codeplex.com

  • The 1st video outlines what behavior driven development is and how it can help BizTalk developers.  
  • The 2nd video he walks through a practical example of using the technique.
Another video is available here with a few more lessons learnt from the field: http://www.integrationusergroup.com/behaviour-driven-integration-development

Developing Business Rules with BDD

This article talks about how to use BDD techniques to develop BizTalk Business Rules.

Developing Maps with BDD

This article talks about how to use Specflow to help develop and test maps.

Developing Business Rules with BDD

This article talks about how to use BDD techniques to develop BizTalk Business Rules.

Developing Maps with BDD

This article talks about how to use Specflow to help develop andx" target="_blank" style="font-size:12.1px;">http://geekswithblogs.net/michaelstephenson/archive/2012/07/13/150230.aspx

Andy Davis has also written an article about using a specification base class to help you test maps using BDD techniques also.  This article is particularly useful to demonstrate a quick way to test individual field mappings

The techniques in both articles could also be combined together to create a powerful approach suited to anything from a simple map to a very complicated one which would also benefit from the documentation that specflow would offer.

BizTalk 2006, BizUnit 2 & BDD

In this article it discusses how people using older versions of BizTalk where Specflow may not be supported in your version of Visual Studio can use a different technique with BizUnit 2 to still achieve the same end results of having a BDD approach to acceptance testing.

As a follow on from the article about using a style of implementation of BDD with BizUnit 2 for BizTalk 2006 R2 implementations the below article shows how you can use MSBuild to generate documentation from your test cases so you get a similar output from your build process where you have nice feature documentation for all of your acceptance tests.

BizTalk HL7 Solutions


The video on the below link shows the use of an open source framework Michael Stephenson has developed to help stub out HL7 applications which use MLLP and then the video demonstrates how this can be integrated into BDD style development using Specflow acceptance testing.
acceptance testing



The project with the HL7 component for testing is available on the following codeplex site:

See Also

Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.