30
Testing ‘slow flows’ fast Eurostar 2010 Copenhagen Automated End-2-End testing using interrupts

Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Embed Size (px)

DESCRIPTION

EuroSTAR Software Testing Conference 2010 presentation on Testing "slow flows" Fast, Automated End-2-End Testing using interrupts by Dominic Maes. See more at: http://conference.eurostarsoftwaretesting.com/past-presentations/

Citation preview

Page 1: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Testing ‘slow flows’ fast

Eurostar 2010

Copenhagen

Automated End-2-End testing using interrupts

Page 2: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

2

Hi there !

The Challenge

The Quest for a solution

The Solution

Demonstration

Conclusion

Q & A

Page 3: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

3

Hi there !

The Challenge

The Quest for a solution

The Solution

Demonstration

Conclusion

Q & A

Page 4: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

The Challenge...

4

Suppose you have 10.000 orders placed every day in your online store. Every order results in several steps: Checking the available quantities in the warehouse,

processing the command,

ordering things that are not readily available,

making invoices,

sending confirmations to the customer,

checking money transfers,

etc...

All these processes are connected and use a central database

A step can take up several minutes/hours of processing time

Page 5: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Let's visualize the workflow

5

Process AOnline purchase

10 mins

Process BCheck Supply

Max 3 hrs

Process CCheck client status

Max 20 mins

Process DOrder missing items

Max 2 hrs

Process ESend items

5 mins

Process FInvoice10 mins

Max total time: 3h45minMin amount of time: 55 min

Processes B,C and D are other systems using the same Db’s but working

independently. These three processes take minimum

15 min each to complete.

Processes A, E and F are on the system under test.

Starting each process is a matter of seconds

Page 6: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

6

Hi there!

The Challenge

The Quest ...

The Solution

Demonstration

Conclusion

Q & A

Page 7: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

7

Economical needs

Bigger, better, faster software

Constant evolving software (RAD)

Advantages

More work enjoyment Regression testing = Tedious work

Higher test quality (avoid human errors)

Increased productivity

Extension of test options

Why automate your testing?

Page 8: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Test automation Pitfalls

8

Automating chaos only results in more chaosFirst structure, then tool !

A fool with a tool is still a fool !

A Test automation project is a development project Test tools can test everything Test tools make testing cheaper Testing with a press on a button We want to start test automation on this new

application… Let’s run our tests once with the tool

Page 9: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

What is available on Frameworks?

9

What kind of frameworks are there?

0) Plain Record and playback

1) Data driven

2) Modularity driven

3) Keyword driven

4) Model based testing

5) Hybrid testing

A lot of commercial frameworks on the market

Page 10: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Classic Frameworks fail because....

10

Conventional test automation frameworks are:

too much based on ‘online’ input & output

waiting till application responds, then they continue

not capable of dealing with time related checks

Page 11: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

11

Hi there!

The Challenge

The Quest ...

The Solution

Demonstration

Conclusion

Q & A

Page 12: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Magic ingredient(s)

12

We ‘cut’ the process-flow in subprocesses.

We start off using a ‘standard’ modular, keyword driven and data-driven framework with a modular structure for maintenance.

And we make it ‘interupt-driven’

We add an Action Queue consisting of:

Execution timestamp

Action to perform

Different arguments/parameters

Page 13: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Step 1: Cut your process flow into pieces

13

Business workflow is usually modular

In test scripts, handling different(sub-) processes is mostly modular

Process AOnline purchase

10 mins

Process BCheck Supply

Max 3 hrs

Process CCheck client status

Max 20 mins

Process DOrder missing items

Max 2 hrs

Process ESend items

5 mins

Process FInvoice10 mins

Page 14: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

14

Step 2: Built in Interrupt Mechanism

System startup

System initialization

Central system

Scheduler

Context restore

Context save

Task : Process A

Switch

Context restore

Context save

Task: Process B

Context restore

Context save

Task : Process E

Context restore

Context save

Task : Process F

calls

Reporting

Generic functions

Error Handling

Page 15: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

15

Add a timestamp check in your scheduler

If Timestamp(x) ≥ Current System Time

Then Start Action(x)

Step 2: Built in Interrupt Mechanism

Page 16: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

16

Adapt your functions or modules inside your automation tool to the new mechanism.

Build in a ‘waiting time’ or a ‘check regularly’

Add a line similar to this one at the end of a task (context save)

Add_to_Action_queue(Execution time, Action name,

Argument 1, Argument 2,…)

Step 2: Built in Interrupt Mechanism

Page 17: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Step 3: Add an 'Action Queue'

17

Make sure you have an action queue and add an ‘execution timestamp’ into it.

Action Param 1 Param 2 ….

Add Order 12455 Mr. Smith ….

Add Order 12456 Ms. Simpson ….

Add Order 12457 Mr. Doe …

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:00:00 Add Order 12455 Mr. Smith ….

1/12/2010 - 08:01:00 Add Order 12456 Ms. Simpson ….

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

Page 18: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

18

Hi there!

The Challenge

The Quest ...

The Solution

Let’s Rock ‘n Roll !

Conclusion

Q & A

Page 19: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

19

Start off with your action queue:

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:00:00 Add Order 12455 Mr. Smith ….

1/12/2010 - 08:01:00 Add Order 12456 Ms. Simpson ….

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

Page 20: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

20

Check of first action is added in action queue

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:00:00 Add Order 12455 Mr. Smith ….

1/12/2010 - 08:01:00 Add Order 12456 Ms. Simpson ….

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

1/12/2010 - 08:10:15 Check Order 12455 Mr. Smith …

Page 21: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

21

Sorted action queue before action 2

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:01:00 Add Order 12456 Ms. Simpson ….

1/12/2010 - 08:10:15 Check Order 12455 Mr. Smith …

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

Page 22: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

22

Performing second action in list

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:01:00 Add Order 12456 Ms. Simpson ….

1/12/2010 - 08:10:15 Check Order 12455 Mr. Smith …

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

1/12/2010 - 08:11:15 Check Order 12456 Ms. Simpson …

Page 23: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

23

Before start of third action

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:10:15 Check Order 12455 Mr. Smith …

1/12/2010 - 08:11:15 Check Order 12456 Ms. Simpson …

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

Page 24: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo preparation

24

Start of Second (sub)process for first Order

Execution Timestamp Action Param 1 Param 2 ….

1/12/2010 - 08:10:15 Check Order 12455 Mr. Smith …

1/12/2010 - 08:11:15 Check Order 12456 Ms. Simpson …

1/12/2010 - 08:20:30 Add Order 12457 Mr. Doe …

1/12/2010 - 08:10:30 Start Invoice 12455 Mr. Smith …

Page 25: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Demo

25

Page 26: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

26

Hi there!

The Challenge

The Quest ...

The Solution

Let’s Rock ‘n Roll !

Conclusion

Q & A

Page 27: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Framework Drawbacks

27

When flows can not be cut into(sub-) processes

Timing accuracy can be tricky

Depending on ‘input-times’

Trade off between ‘Quantity’ and ‘Accuracy’

Needs to be ‘fine-tuned’

Processing will not be the same in different runs

Luckily we ‘log’ the right order of processing

Page 28: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Summary

28

Starting with a‘plain’ record and playback tool

Built on a modular, data-driven and keyword-driven framework

Add ‘time-driven’ to make your framework more versatile

Page 29: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Agenda

29

Hi there!

The Challenge

The Quest ...

The Solution

Let’s Rock ‘n Roll !

Conclusion

Q & A

Page 30: Dominic Maes - Testing "slow flows" Fast, Automated End-2-End Testing using interrupts - EuroSTAR 2010

Thank you !

30