automated testing for biztalk hl7 solutions

34
Automated Testing for BizTalk HL7 Accelerator Connected Systems Consulting Ltd

Upload: michael-stephenson

Post on 01-Dec-2014

475 views

Category:

Healthcare


0 download

DESCRIPTION

This slide deck is about automated testing of BizTalk HL7 solutions and showing how you can use behaviour driven acceptance tests to automate your testing

TRANSCRIPT

Page 1: Automated Testing for BizTalk HL7 Solutions

Automated Testing for BizTalk HL7 Accelerator

Connected Systems Consulting Ltd

Page 2: Automated Testing for BizTalk HL7 Solutions

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– Pluralsight Author– One of organizers of UK Connected Systems User Group– Founder of BizTalk Maturity Assessment – www.biztalkmaturity.com

– Contact Info:• Blog: www.geekswithblogs.net/michaelstephenson• Twitter: @michael_Stephen• Linked In: http://www.linkedin.com/in/michaelstephensonuk1• Email: [email protected]

Page 3: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Before we start• Projects are often poor at automated testing

• Projects often struggle to have applications to test against

• Projects struggle to stub out applications– Particularly HL7 applications

• HL7 projects with BizTalk are some of the most complex

Page 4: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Agenda• Intro• Common Scenario• Typical Solutions• What do we want?• Usage Scenarios• Demo• Summary

Page 5: Automated Testing for BizTalk HL7 Solutions

INTRO

Page 6: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Aim of today

• Improve your productivity!

• Improve the quality of the solutions you deliver!

• Lower the total cost of ownership of your BizTalk solution!

• Help you to automate testing of HL7 integration

Page 7: Automated Testing for BizTalk HL7 Solutions

COMMON SCENARIO

Page 8: Automated Testing for BizTalk HL7 Solutions

Example Interface

BizTalk

MLLP Adapter

Message Box

MLLP Adapter

Receive Pipeline Send Pipeline

HL7 Application HL7 Application

Orchestration

Page 9: Automated Testing for BizTalk HL7 Solutions

Typical Testing Environment

BizTalk

Application 6

Application 5

Application 4

Application 3

Application 2

Application 1

Sorry this application is being used by another team

Sorry this application is down for maintenance

This application isn’t very reliable in the test environment

This application is managed by a vendor and there is an SLA to

arrange to use it

Page 10: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Typical Problems• Don’t have enough test environments• Each environment doesn’t have an instance of

each application• Environment usage conflict between projects or

teams• Test cases take a long time to run which creates

usage conflict• Applications in an environment aren’t always the

right versions• Applications are shared between environments• Need resources from other teams to help you

Dependency on the HL7 applications is the problem

Stub them out is the answer!

Page 11: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Value of Stubs

DevelopmentEarly

Integration Testing

System TestingUser

Acceptance Testing

Pre-Production

Testing

Cost to find defect

Stub here to focus on getting BizTalk working

Stub here to do your developer and build tests

Stub here to deal with typical environment constraints

You shouldn’t need to stub here because BizTalk just works

But you can if you need to

Page 12: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

The Challenge

• Removing the dependencies can really help

• Stubbing out web services is easy, but how can we stub out the HL7 application?

Page 13: Automated Testing for BizTalk HL7 Solutions

TYPICAL SOLUTIONS

Page 14: Automated Testing for BizTalk HL7 Solutions

Use a different adapter

BizTalk

File Adapter

Message Box

File Adapter

Receive Pipeline Send Pipeline

Tester

Orchestration

Test Folder Test Folder

Checks message to see its valid

Page 15: Automated Testing for BizTalk HL7 Solutions

Thoughts

What’s good?• Orchestration tested• Not much else

What’s bad?• Port not tested• Adapter not tested• Tested solution not like

real solution• Low confidence

Page 16: Automated Testing for BizTalk HL7 Solutions

MLLP Utilities

BizTalk

MLLP Adapter

Message Box

MLLP Adapter

Receive Pipeline Send Pipeline

MLLPSend.exe MLLPReceive.exeOrchestration

TesterTrigger sending message

Start receiverCheck file

Page 17: Automated Testing for BizTalk HL7 Solutions

Thoughts

What’s good?• Tests the full BizTalk

solution• Can stub out HL7

applications with BizTalk MLLP Utility tools

• Other tools available to do similar– HL7 Edit

What’s bad?• Doesn’t scale easily to

many interfaces• Difficult to automate• If not automated takes

ages to run tests• Cant easily inspect

messages

Page 18: Automated Testing for BizTalk HL7 Solutions

WHAT DO WE WANT?

Page 19: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Vision• Test interfaces with:

– Behaviour Driven Development– .net Unit Testing approaches

• Be able to automate the tests• Stub out all HL7 Applications• Able to scale to work with complex solutions• Easy to use• Able to use in developer tests and integration tests

Page 20: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Introducing the solution

• AppFx.HL7.Testing.Utilities– Open source testing library– Aimed specifically at BizTalk Healthcare solutions (can be used

elsewhere thou)– Stub out HL7 Applications– Test your assumptions on how an HL7 application works

– Find it on • Codeplex – https://appfxhl7testing.codeplex.com/

Page 21: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Features

• Transport– Send messages over MLLP– Receive messages over MLLP

• Application Stubbing– Stub many applications by adding configuration– Handle messages for different test scenarios

• HL7 Messages– Helpers to parse messages– Patterns to make messages easier to compare

• Testing– Can be used by .net Testing– Can be used by Specflow BDD testing

Page 22: Automated Testing for BizTalk HL7 Solutions

USAGE SCENARIOS

Page 23: Automated Testing for BizTalk HL7 Solutions

Validate Application Assumptions

HL7 ApplicationHL7 Test Framework

BDD Test

Send message

Receive Acknowledgement

Validate Acknowledgement

Send response

Validate Response

We know how the HL7 application works before we connect BizTalk to it

Page 24: Automated Testing for BizTalk HL7 Solutions

Automated BizTalk Testing

BizTalk

MLLP Adapter

Message Box

MLLP Adapter

Receive Pipeline Send Pipeline

Orchestration

BDD Test

HL7 Test Framework

Validate Message

We can stub out the HL7 applications

This allows us to test BizTalk in isolation

Page 25: Automated Testing for BizTalk HL7 Solutions

DEMO

Page 26: Automated Testing for BizTalk HL7 Solutions

Connected Systems Consulting Ltd

Demo Challenge

• Lets take one of the HL7 accelerator samples and write BDD style specifications and tests for it!

Page 27: Automated Testing for BizTalk HL7 Solutions

Demo Scenario

Interrogative Tutorial in BizTalk HL7 accelerator samples

Page 28: Automated Testing for BizTalk HL7 Solutions

Demo Walk-thru

BizTalk

Message Box

ADT Receive HIS Send

BDD Test

HL7 Test Framework

Validate Message

ADT Send HIS Receive

Send Message

Send ACK

Send Message to HIS

Send Response

Send Response to ADT

Page 29: Automated Testing for BizTalk HL7 Solutions

Sample Domain

Demo Infrastructure

Domain Controller BizTalk 2009+

SQL Server 2008

Tester Machine

BizTalk HL7 Sample Deployed here

BDD Tests developed and ran from here

BizTalk send ports point to test machine

Page 30: Automated Testing for BizTalk HL7 Solutions

DEMO

Page 31: Automated Testing for BizTalk HL7 Solutions

SUMMARY

Page 32: Automated Testing for BizTalk HL7 Solutions

Thoughts

What’s good?• Tests the full solution• Quite simple to use• Can stub out many HL7 applications

concurrently• Can have different message handlers

for different test cases• Fits into .net testing frameworks• Validation of messages• Reusability within test

implementation• Promotes the benefits of BDD/TDD• Use in different types of testing

– Developer unit testing– Automated system testing

• Works with multiple versions of BizTalk

What’s Next?• Looking for community feedback• Does it work for your scenarios• Are there any missing features

Page 33: Automated Testing for BizTalk HL7 Solutions

More Info

Source/Article Link

SpecFlow http://www.specflow.org/

Testing example with CAT framework webcast

http://tinyurl.com/test-insidebiztalk

Page 34: Automated Testing for BizTalk HL7 Solutions

Questions?