understanding the test automation culture of app developers

39
Understanding the Test Automation Culture of App Developers Pavneet Singh Kochhar 1 , Ferdian Thung 1 , Nachiappan Nagappan 2 , Thomas Zimmermann 2 , David Lo 1 1 Singapore Management University 2 Microsoft Research {kochharps.2012,ferdiant.2013,davidlo}@smu.edu.sg, {nachin,tzimmer}@Microsoft.com International Conference on Software Testing, Verification and Validation (ICST’15)

Upload: pavneet-singh-kochhar

Post on 09-Feb-2017

204 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Understanding the Test Automation Culture of App Developers

Understanding the Test Automation Culture

of App DevelopersPavneet Singh Kochhar1, Ferdian Thung1,

Nachiappan Nagappan2, Thomas Zimmermann2, David Lo1

1Singapore Management University2Microsoft Research

{kochharps.2012,ferdiant.2013,davidlo}@smu.edu.sg, {nachin,tzimmer}@Microsoft.com

International Conference on Software Testing, Verification and Validation (ICST’15)

Page 2: Understanding the Test Automation Culture of App Developers

2

Smartphones

• Smartphones have become pervasive• Worldwide sales increased by 42.3% from

2012 to 2013

Android has 78.4% of the smartphone

market1

Millions of apps available

[1] Gartner, “Gartner says annual smartphone sales surpassed sales of feature phones for the first time in 2013”

Page 3: Understanding the Test Automation Culture of App Developers

3

Study Goals

• Understand the test automation culture of app developers

• Understand the “pain points” of developers

Are mobile apps adequately tested?

Page 4: Understanding the Test Automation Culture of App Developers

4

Understanding Test Automation Culture

• Analyse over 600 Android apps– Execute test cases – Assess test adequacy

• Survey Android & Microsoft developers– Understand common testing tools used– Challenges faced by them

Page 5: Understanding the Test Automation Culture of App Developers

5

Outline

• Motivation and Goals• Test Adequacy • Data Collection & Basic Statistics• Empirical Results• Recommendations• Conclusion and Future Work

Page 6: Understanding the Test Automation Culture of App Developers

6

Test Adequacy

• Test Adequacy Criterion– Property that must be satisfied for a test suite

to be thorough. – Often measured by code coverage.

• Code Coverage– Percentage of the code executed by test cases

• Line coverage• Block coverage

Page 7: Understanding the Test Automation Culture of App Developers

7

Outline

• Motivation and Goals• Test Adequacy • Data Collection & Basic Statistics• Empirical Results• Recommendations• Conclusion and Future Work

Page 8: Understanding the Test Automation Culture of App Developers

8

Data Collection

• Repository for Free and Open Source Android applications

• We collect apps hosted on• In total, we have 627 apps• Our dataset has large and popular apps

Page 9: Understanding the Test Automation Culture of App Developers

9

First Survey• 3905 distinct email addresses of

developers of 627 apps• Ask questions about testing tools used

and challenges faced• We receive 83 responses (Response rate

2.13%)• Unit of analysis is individual developer

Page 10: Understanding the Test Automation Culture of App Developers

10

First Survey

Questions:• How do you test your app code?• Do you use any test automation tools? • What are the challenges you face during

testing either manually or using automated tools?

Page 11: Understanding the Test Automation Culture of App Developers

11

Second Survey• We improve our survey questions based

on the responses of first survey • Email 678 developers in Microsoft• We receive 127 responses (Response rate

18.73%)• Unit of analysis is individual developer

Page 12: Understanding the Test Automation Culture of App Developers

12

Second Survey

Questions:• How do you test your app code? - Manually, Automated tools, Don’t test• What type of testing do you do? - Unit testing, integration testing, system testing, regression testing etc.• What automated testing tools you use?

Page 13: Understanding the Test Automation Culture of App Developers

13

Second Survey

Questions:• Why do you use testing tools? - Generating test cases, executing test cases etc.• Do you face these challenges? - Time constraints, compatibility issues, lack of exposure to tools, poor documentation etc.• What are the top 2 things you look

for/need/would like to see?

Page 14: Understanding the Test Automation Culture of App Developers

14

Basic Statistics

Tools Number of Apps % of Apps

Without Test Cases 538 85.81%

With Test Cases 89 14.19%

Distribution of Apps w.r.t Test Cases

Total – 627 apps

Page 15: Understanding the Test Automation Culture of App Developers

15

Basic StatisticsDistribution of Apps w.r.t LOC

Page 16: Understanding the Test Automation Culture of App Developers

16

Basic StatisticsDistribution of Apps w.r.t Developers

Page 17: Understanding the Test Automation Culture of App Developers

17

Outline

• Motivation and Goals• Test Adequacy and Code Metrics• Data Collection & Basic Statistics• Empirical Results• Recommendations• Conclusion and Future Work

Page 18: Understanding the Test Automation Culture of App Developers

18

Research Questions

RQ1: Are Android applications well tested? RQ2: Do Android developers use automated testing tools to test their applications? What are the tools commonly used and the challenges faced by them while testing their applications?

RQ3: Do Microsoft developers use automated testing tools to test their applications? What are the tools commonly used and the challenges faced by them while testing their applications?

Page 19: Understanding the Test Automation Culture of App Developers

19

Research Questions

RQ1:Current State of Testing in

Android Applications

Page 20: Understanding the Test Automation Culture of App Developers

20

RQ1: Current State of TestingDistribution of Test Suites (89 apps)

Page 21: Understanding the Test Automation Culture of App Developers

21

RQ1: Current State of TestingLine Coverage (41 apps)

Page 22: Understanding the Test Automation Culture of App Developers

22

RQ1: Current State of TestingBlock Coverage (41 apps)

Page 23: Understanding the Test Automation Culture of App Developers

23

RQ1: Current State of Testing

• Only 14.19% (89 out of 627) of the apps contain test cases

• Only 0.64% (9.75% of 14.19%) have line coverage above 40%

Results

Page 24: Understanding the Test Automation Culture of App Developers

24

Research Questions

RQ2:Survey of Android Developers

Page 25: Understanding the Test Automation Culture of App Developers

25

RQ2: Survey of Android DevelopersAndroid Automated Testing Tools Usage

Tools Number of Respondents

JUnit 18

MonkeyRunner 8

Robotium 7

Robolectric 6

Android unit testing framework

6

Monkey 1

No tool 35

Page 26: Understanding the Test Automation Culture of App Developers

26

RQ2: Survey of Android DevelopersChallenges faced by developers

Tools Number of Respondents

Time constraints 20

Compatibility issues 16

Lack of exposure 11

Cumbersome tool 9

Emphasis on development

6

Lack of organization support

5

Unclear benefits 4

Page 27: Understanding the Test Automation Culture of App Developers

27

RQ2: Survey of Android DevelopersChallenges faced by developers

• Time “Designing and implementing test cases takes some extra time, which makes it difficult to finish the project in time”• Compatibility “I tried robolectric, but ran into several issues, that were probably also related to the fact that I am using Scala on Android”• Usability “I think Monkey runner is kinda cumbersome, and breaks easily when changing layout options”

Page 28: Understanding the Test Automation Culture of App Developers

28

RQ2: Survey of Android DevelopersChallenges faced by developers

• Lack of Support “The advice I was given was ... not bother with trying to use the Android testing tools/frameworks”• Poor Documentation “Testing is documented there, but not very well and there should be far more information”• Steep Learning Curve “I fear it would represent a strong learning curve”

Page 29: Understanding the Test Automation Culture of App Developers

29

RQ2: Survey of Android Developers

• Developers use tools such as JUnit, Robolectric, Robotium etc.

• However, large number of developers prefer manual testing

• Developer face challenges such as time constraints, compatibility issues, lack of exposure, cumbersome tools, unclear benefits, poor documentation etc.

Results

Page 30: Understanding the Test Automation Culture of App Developers

30

Research Questions

RQ3:Survey of Microsoft Developers

Page 31: Understanding the Test Automation Culture of App Developers

31

RQ3: Survey of Microsoft DevelopersTypes of Testing

Page 32: Understanding the Test Automation Culture of App Developers

32

RQ3: Survey of Microsoft DevelopersAutomated Testing Tools Usage

Tools Number of Respondents

Visual Studio 35

Internal tool 8

Selenium 7

Microsoft Test Manager 5

Others (Qunit,Robotium etc.)

27

Page 33: Understanding the Test Automation Culture of App Developers

33

RQ3: Survey of Microsoft DevelopersAutomated Testing Tools Usage

Page 34: Understanding the Test Automation Culture of App Developers

34

RQ3: Survey of Microsoft DevelopersChallenges faced by developers

Page 35: Understanding the Test Automation Culture of App Developers

35

RQ3: Survey of Microsoft Developers

• Top 3 reasons for using automated testing tools are executing test cases, finding potential bugs, and analyzing code coverage.

• Top 3 challenges faced by Microsoft developers are time constraints, compatibility issues, and lack of exposure to tools.

• Developers prefer well documented and easy to use tools

Results

Page 36: Understanding the Test Automation Culture of App Developers

36

Recommendations

• Need to promote new tools that can be easily used by developers

• Need tools which can help test difficult cases• Need tools which have good documentation• Need to spread information about tools

through online channels

Page 37: Understanding the Test Automation Culture of App Developers

Conclusion

37

• Only 14% of the apps contain test cases & 0.64% (9% of 14%) of the apps have coverage above 40%.

• Android developers prefer using JUnit whereas Microsoft developers use Visual Studio, Internal tool, Selenium.

• Developers face challenges such as time constraints, compatibility issues, lack of exposure, cumbersome tools, unclear benefits, poor documentation etc.

Page 38: Understanding the Test Automation Culture of App Developers

38

Future Work

• Expand the study to include more apps– Address the threats to external validity

• Survey more developers to get more responses

• We plan to develop tools to address “pain points”.

Page 39: Understanding the Test Automation Culture of App Developers

Thank you!

Questions? Comments? Advice?{kochharps.2012,ferdiant.2013}@[email protected]{nachin, tzimmer} @microsoft.com