automated testing with logic apps and specflow

21
Automated Testing with Logic Apps and Specflow Michael Stephenson https://www.linkedin.com/in/michaelstephensonuk1

Upload: biztalk360

Post on 08-Apr-2017

149 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Automated Testing with Logic Apps and Specflow

Automated Testing with Logic Apps and Specflow

Michael Stephensonhttps://www.linkedin.com/in/michaelstephensonuk1

Page 2: Automated Testing with Logic Apps and Specflow

Michael StephensonMVP

Testing Logic Apps

Page 3: Automated Testing with Logic Apps and Specflow

3

Michael Stephenson• Coaching & Consultancy

• Azure Trainer• Integration Architect

• Loads of real world Azure projects

• #IntegrationMonday

• Blog - http://microsoftintegration.guru/blog/

• Twitter - @michael_stephen

Page 4: Automated Testing with Logic Apps and Specflow

Agenda• Agenda• Why is this a challenge?• What does good look like?• Why Specflow?• Option 1 – Cloud Only• Option 2 – VS Black Box

Testing• Option 3 – VS Whitebox

Testing• Other Challenges

• Outcomes• Awareness of different ways

to test Logic Apps

• Practical examples

Page 5: Automated Testing with Logic Apps and Specflow

5

Meet the Dev Team

Dave – The lazy developer

Everyone hates supporting Dave’s code

Bob – Wants to deliver quality solutions but isn’t really sure how to do it

Bob also likes funky hats and has fashion issues

Steve – Has loads of automated testing experience, always looking to improve quality.

Steve works out but rarely does Leg Day

Page 6: Automated Testing with Logic Apps and Specflow

What does good look like?

Page 7: Automated Testing with Logic Apps and Specflow

7

• Developer runs tests on their own machine before checking in changes• On check in an automated build creates a clean

environment and build/deploy/run tests in a sandbox• After build we have a reliable version of code which is well

tested and we have confidence in• The version can be deployed to other environments easily• The tests are self describing and tests the software does

what its expected to do• The tests are ran each time a change is committed

What does Good Look Like?

Page 8: Automated Testing with Logic Apps and Specflow

Why is it a challenge?

Page 9: Automated Testing with Logic Apps and Specflow

9

• Stubbing• BizTalk had separation between Transport and Logic• Logic Apps does not• Makes it hard to test logic without dependencies on transport

• Fear/Lack of experience of Cloud• Many of the integration scenarios are new• Learning curve is steep• Automated testing is one more complexity

• Logic App Maturity• Changing product• Hard to settle on approaches for ALM while lots of change

Challenges

Page 10: Automated Testing with Logic Apps and Specflow

10

Sample Logic App

If Label = YES

Page 11: Automated Testing with Logic Apps and Specflow

Option 1 – Cloud Only

Page 12: Automated Testing with Logic Apps and Specflow

12

Example 1

If Label = YES

Run TriggerI cant see the File in the container

Page 13: Automated Testing with Logic Apps and Specflow

13

Example 2

1) Make HTTP request2) Did I get a good response

3) Does the data match in Salesforce

Postman

Page 14: Automated Testing with Logic Apps and Specflow

14

Good BadIts ok for trying stuff out and easy to test This is what bad BizTalk testing has looked

like for yearsIts not reliable/repeatableThere is no knowledge transfer to others about how solution worksWont work with automated buildNot great in team scenarios

Thoughts

Page 15: Automated Testing with Logic Apps and Specflow

Option 2 – Black Box Testing

Page 16: Automated Testing with Logic Apps and Specflow

16

Example 3

If Label = YES

1) Clean Queue

Automated Test

3) Pop message on queue 2) Clean Storage4) Did file appear

Page 17: Automated Testing with Logic Apps and Specflow

17

Good BadProvides some knowledge of how its supposed to work

Did the logic app execute the way we expected it to?How do we know if it took the wrong branch?

Repeatable test Tests are often brittle as lots of waiting for something to happen

Risk is reduced Some scenarios might be difficult depending upon the dependancies

You can probably automate most scenarios

Thoughts

Page 18: Automated Testing with Logic Apps and Specflow

Option 3 – Whitebox Testing

Page 19: Automated Testing with Logic Apps and Specflow

19

Example 4

If Label = YES

1) Clean Queue

Automated Test

3) Pop message on queue 2) Clean Storage

4) Make assertions about the workflow events- Eg did action execute

Workflow Execution EventsDiagnostics – Event Hub

5) Is file in folder

6) Does file content match expected

Page 20: Automated Testing with Logic Apps and Specflow

20

Good BadProvides extensive detail on how solution works

Diagnostics events sometimes slowish so tests aren’t that quick

Repeatable test Diagnostics events sometimes include old events, my helper class gets rid of those

Risk is reduced significantlyTest what happens inside the logic appTests reliableTest the actions and triggers you expect have been executed

Thoughts

Page 21: Automated Testing with Logic Apps and Specflow

Questions