What is MockingBird?

MockingBird is a tool-set for mocking web services. The core engine is essentially a configurable message interceptor that can act as a stand in for any web service.

The two primary usage scenarios for MockingBird are
  • Contract First development
  • Isolation of build & dev servers from external dependencies

Current Release

BETA-2 is now available. The downloads page lists the changes/updates in this release.

Source

The source code contains fixes post Beta-2 aimed at the V1 RTM release. The bug fixes are mainly for the Studio module.

Why should I care? - The Elevator Pitch for MockingBird

Consider the scenario where you are given the WSDL for a third-party web-service but no functioning system is available yet (it may be a brand new service or perhaps dev/site licenses are being negotiated). You need to get on with development right now. What do you code against? If you are into TDD & MockObjects you may look to mock up an interface corresponding to the WSDL and develop against that. But what if you ‘don’t do’ TDD & Mocks? Or it may be that you are maintaining/enhancing an existing system that wasn’t coded against interfaces so mocking may not be possible. Or what if you are a BizTalk developer? You cannot mock/inject dependencies into your orchestrations and other components (well, except for pipeline components, but thats another story)!!

Next, imagine that you are setting up a build server and multiple environments (DEV, TEST, UAT etc). But the vendor says you can only have one license for their software. Now how do you run DEV, TEST, UAT in parallel with different data sets? Or you may have more than one license, but what if that service has maintenance schedules that clash with your build? Your build server is then completely exposed to something you don’t control.

Being able to set up complete mock services is invaluable in these scenarios. Unfortunately there aren't many tools available to help with this so we have to resort to manually coding mock services. MockingBird aims to make it easy and quick to build configurable mock services.

Please read through the documentation available on this workspace (and included with each release) to understand how the MockingBird toolset works in greater detail.

Where did it come from and who is it aimed at?

MockingBird started life as MockWeb an internal tool that my former colleagues (Senthil Sai and Will Struthers) and I developed. All credit must go to them as Senthil first came up with the concept and Will then contributed a lot to the code-base.

It started when we got rather fed up with having to set up multiple instances of a third party service and build data-sets just to help with testing our BizTalk orchestrations reliably. It grew rapidly and organically. While we felt that this concept and tool would be useful to the .NET dev community at large (not just BizTalk teams), the structure of the codebase (at the time) would not lend itself to easy extension and needed to be refactored before making it publicly available. Its taken a while , but now I've completely rewritten MockWeb and as I have mentioned in the roadmap, I intend this to go beyond HTTP Web Services and hence the new name.

So what is it actually?

There are two parts to MockingBird at this time (and many more to come)
  • An ASP.NET HttpHandler which is configured to return pre-set responses
  • A 'Service Studio application that has two main modules
    • A module to parse a given WSDL and generate sample requests and responses and help in setting up a mock service quickly.
    • A module to invoke the test services or remote services and check the responses.

In the current version, there is one message handler provided out of the box called the BasicSoapMessageHandler which ignores SoapHeaders and returns responses based on XPath and other configuration parameters. The framework is designed to be extensible. One of the main extension points is in the area of handlers. For instance, if you need to write a handler to process custom headers or return responses in a different way, you should be able to write a handler and plug it in via configuration.

Do note that although this is a regular ASP.NET HttpHandler there is no reason it cannot mock a WCF service call to a HTTP end point. Just register the end-point with the .svc extension in configuration.

Workspace Contents

Note: the Documentation below needs to be updated BUT the downloadable document (included with the download packages) is upto date with installation and testing instructions
  1. Quick Setup Guide - the 10 min overview to setting it up
  2. Deploying your mock service endpoints - How to go about setting up your own endpoints
  3. Detailed Scenarios - description of the Contract First approaches and the Environment Isolation
  4. Architecture and Implementation - how this works inside
  5. Alternative approaches - what other approaches can be used for mocking services?

Blog Articles

My blog articles charting the progress of the development of this tool
  1. Introducing MockingBird (announcing this tool)
  2. Waltzing with WSDL (progress on the Studio GUI
  3. MockingBird Beta
  4. MockingBird Beta-2

Forthcoming Release(s)

Next on the roadmap is the RTM. Check out my blog post on the Beta-2 release (linked above) for a list of things that I am looking at for the RTM.

Platform and Pre-requisites

This is written against .NET 3.5 and uses some C# 3.0 features as well as the MoQ mock-object framework. The IoC mechanism is Unity . The test framework is MbUnit3.5. MbUnit 3.5 uses the Gallio Test Automation Platform and these binaries are only required if you run the unit and functional tests (and the packages include the binaries used for development).

Roadmap

  • MockingBird v1 will retain its core nature of a HttpHandler (plus GUI).
  • MockingBird v2 will be completely rewritten to be a WCF Message Interceptor (+ a workflow service as the core engine) (and associated dynamic behaviours etc so that it can support non HTTP channels as well as make use of the power of WCF).

I'm also looking at using MEF as the extensibility mechanism.

I intend MockingBird v2 to become a platform for
  • A more general web service test tool
  • A set of mock BizTalk WCF Send and Receive adapters
  • Code generation of Biztalk and other artifacts (such as regular unit test fixtures, BizUnit tests and so on )
  • etc

Of course, it all depends on time available outside regular work as this is a personal project and not officially endorsed in any way by my employer. If you would like to join up and contribute, that would be cool. Let me know. Please do send me feedback on your installation /setup experiences, thoughts on making it more extensible and so on, and most importantly of course, if its working for you or not. All feedback is appreciated.


Last edited Oct 18 at 10:16 PM by santoshbenjamin, version 35

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2009.10.27.15987