20
Variability vs. Repeatability An Experience Report Jonathan Li On Wing

Variability vs. Repeatability

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Variability vs. Repeatability

Variability vs. Repeatability!An Experience Report

Jonathan Li On Wing

Page 2: Variability vs. Repeatability

Introduction

This talk is about my experience in adding some variability to automated testing and what I learned about it

2!

Page 3: Variability vs. Repeatability

My Historical Approach To Testing

Manual Testing known inputs and expected outputs

Automated Testing

automating the manual tests

Exploratory no fixed inputs and adapt tests

Automated Testing with variability

3!

Page 4: Variability vs. Repeatability

EXAMPLES

Page 5: Variability vs. Repeatability

Example 1

Get all the hotels in a given city

Page 6: Variability vs. Repeatability

Example 1

Get all the hotels in a given city

Page 7: Variability vs. Repeatability

Example 1

Get all the hotels in a given city

Page 8: Variability vs. Repeatability

Example 2

Get the details of a given hotel

Page 9: Variability vs. Repeatability

METHODOLOGY

Page 10: Variability vs. Repeatability

Previous Methodology

Data driven testing expected inputs matched with expected outputs

10!

DB

Web ServiceTest Client

Input/Output

Page 11: Variability vs. Repeatability

Implemented Methodology

01 testGetHotelDetails() { 02 //Get 10 random hotels 03 List<Hotel> hotels = DBWrapper.getRandomHotel(10); 04 foreach (Hotel hotel in hotels) { 05 Response response = HttpClient.getHotels(hotel); 06 Hotel hotelReturned = new Hotel(response); 07 Oracle.assertEquals(hotel, hotelReturned); 08 } 09 }

11!

DB

Web Service

Test Controller

HTTP Client

Oracle

Page 12: Variability vs. Repeatability

Implemented Methodology

01 testAllHotelsBelongInRegion() { 02 //Get 10 random regions 03 List<Region> regionsToTestWith = DBWrapper.getRandomRegion(10); 04 foreach (Region region in regionsToTestWith) { 05 Response response = HttpClient.getHotelsInRegion(region); 06 Oracle.assertVerifyHotelsBelongInRegion(response, region); 07 } 08 }

12!

DB

Web Service

Test Controller

HTTP Client

Oracle

Page 13: Variability vs. Repeatability

OBSERVATIONS

Page 14: Variability vs. Repeatability

Time

Initial construction took longer

Creating test cases could be faster and up to 3 times slower

Maintenance of tests is generally easier and faster

14!

Page 15: Variability vs. Repeatability

Bugs

About 10% more bugs found

Majority of these bugs were low priority

Majority of the these were also

real data issues

15!

AB

D                    C  

E

Page 16: Variability vs. Repeatability

Confidence

Hard to measure

Test team felt more confident

not testing the same data over and over again

tested more permutations

than I can in a lifetime

16!

Page 17: Variability vs. Repeatability

Comparison

17!

Variability

Uncover more bugs

Easier to maintain

Generates more confidence

Tests more variations

Good for large data sets

Repeatability

Faster to develop initially

Lower coding bar

Predictable

Page 18: Variability vs. Repeatability

Criticisms

Lack of repeatability and predictability

Duplicating feature work

Testing the tests

18!

Page 19: Variability vs. Repeatability

Future work

Add ease of repeatability Replay based on logs or

test session id with a seed

Adaptable tests Use machine learning and statistical analysis

to allow tests to explore areas on its own

19  

Page 20: Variability vs. Repeatability

Thank you.

Jonathan Li On Wing Software Development Engineer in Test

Groupon | Getaways

[email protected] | [email protected]