SlideShare a Scribd company logo
1 of 28
MOBILESoft 2015 - 2nd ACM International Conference on Mobile Software Engineering and Syste
Exploiting the Saturation Effect in Automatic
Random Testing of Android Applications
Domenico
Amalfitano,
Nicola Amatucci,
Anna Rita Fasolino,
Porfirio Tramontana
Emily Kowalczyk,
Atif M. Memon
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Context and Motivations
 Context
◦ Automatic GUI Random Testing of Mobile
Applications.
 Motivation
◦ To formalize a stopping criterion for
random testing.
MOBILESoft 2015 – Florence, Italy – May 16 2
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
GUI Random Testing
Techniques
 A.K.A. Monkey Fuzz Testing
Techniques.
 Usually exploited for stress testing.
 Sequences of random events are sent
to the application under test (AUT).
◦ Generally only user events (i.e. mouse or
keyboard events).
 Fully automated.
MOBILESoft 2015 – Florence, Italy – May 16 3
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
MFT Tools
 Tools implementing MFT techniques.
 Easy to use  growing popularity for
testing mobile applications.
4MOBILESoft 2015 – Florence, Italy – May 16
https://github.com/reverse-
unina/AndroidRipper
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
The Problem …
 When the execution of an MFT tool must
be stopped?
 The stop condition is:
◦ able to affect the effectiveness and the cost
of automatic testing processes.
◦ even more important with random testing
techniques, affected by problems of
reliability and efficiency of the test adequacy.
 Covered Statements Percentage
usually exploited to measure the test
adequacy of testing techniques.
CSP =
#SetCoveredStatements
#SetStatementsAUT
´100
MOBILESoft 2015 – Florence, Italy – May 16 5
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Mostly Used Stop Criteria …
 Predefined testing time or number of
fired events.
0
10
20
30
40
50
60
70
80
90
100
300
500
700
900
1100
1300
1500
1700
1900
EXP1
EXP2
EXP3
Low #Events  (1)
Low Reliability, (2)
Low Effectiveness
Number of fired Events
CoveredStatementPercentage
MOBILESoft 2015 – Florence, Italy – May 16 6
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
… Mostly Used Stop Criteria
 Fix the testing time or the number of
fired events.
Too many Events
 Low Efficiency
Number of fired Events
40
45
50
55
60
65
70
75
80
85
90
100
700
1300
1900
2500
3100
3700
4300
4900
5500
6100
6700
7300
7900
8500
9100
9700
S1
S2
S3
7
CoveredStatementPercentage
MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
The proposed solution …
 A testing process that automatically
stops its execution at a point
representing an optimal trade-off
between effectiveness and cost.
◦ A point were test adequacy is maximized
and no testing effort is wasted.
 It exploits two typical phenomena of
random testing.
8MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
First phenomenon1
 The existence of a saturation effect in MFT.
◦ A well-known phenomenon where the test
adequacy tends to a specific value as the
amount of test execution increases.
◦ There is a point at which no more progress is
made towards maximizing a test adequacy
criterion.
 It is called saturation point.
◦ We propose it as the optimal termination point.
9
1- E. Sherman, M. B. Dwyer, and S. Elbaum, “Saturation-based testing of concurrent programs,” SIGSOFT ‘09
MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Second phenomenon2
 The predictability property of MFT
◦ The difference between the test
adequacies reached by two random test
cases tend to be definitely zero.
◦ In other words, two test cases tend to
reach the same test adequacy (i.e., same
found faults or same set of executed
LOCs )
10
2- A. Arcuri, M. Z. Iqbal, and L. Briand, “Random testing: Theoretical results and practical implications,” IEEE Trans. Softw.
Eng.
MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
… The proposed solution
 The process exploits the definition of
predictability to reach a potential
saturation point.
 The determination of the potential
saturation point is based on the
simultaneous execution of several
random testing sessions.
 The testing process is stopped when
the difference in code coverage is
zero.
◦ When the sessions have executed the
same code. 11MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Graphical interpretation of the
solution
12MOBILESoft 2015 – Florence, Italy – May 16
40
45
50
55
60
65
70
75
80
85
90
100
600
1100
1600
2100
2600
3100
3600
4100
4600
5100
5600
6100
6600
7100
7600
8100
8600
9100
9600
S1
S2
S3
Saturation Effect – Saturation Point
Predictability – differences
in code coverage tend
definitely to zero
Unreliability Zone
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Differences in code coverage
 Covered Statements Percentage (CSP) as test
adequacy.
 All the sessions have actually covered the same
statements of the AUT  all the sessions reach a
test adequacy value equals to the Cumulative
Coverage Statement Percentage (CSCP).
13MOBILESoft 2015 – Florence, Italy – May 16
CSP = 40%
CSP = 40%
CSCP = 70%
Sessions
have
covered
different
code
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Differences in code coverage
 Covered Statements Percentage (CSP) as test
adequacy.
 All the sessions have actually covered the same
statements of the AUT  all the sessions reach a
test adequacy value equals to the Cumulative
Coverage Statement Percentage (CSCP).
14MOBILESoft 2015 – Florence, Italy – May 16
CSP = 55%
CSP = 55%
CSCP = 55%
Sessions
have
covered the
same code
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
The algorithm
Mobilesoft 2015 – Florence, Italy – May 16
Launch of k testing sessions
While the k sessions do not reach the same
coverage
Each session fires a new random
event
The termination condition is evaluated at
predefined sampling steps
15
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
TerP and TerL
 The algorithm produces two outputs:
◦ Termination Point (TerP): the minimum number of
events at which the termination condition is verified.
◦ Termination Level (TerL): the coverage statement
percentage reached by all the k testing sessions.
Mobilesoft 2015 – Florence, Italy – May 16
40
50
60
70
80
90
100
400
700
1000
1300
1600
1900
2200
2500
2800
3100
3400
3700
S1
S2
S3
UNION
(TerP = 3700, TerL = 85%)
16
Number of fired Events
CoveredStatementPercentage
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Testing infrastructure
 Implemented for executing the testing process.
◦ It targets the Android mobile platform.
Mobilesoft 2015 – Florence, Italy – May 16 17
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Experimentation – RQs
 Experiment aimed at answering the
following research questions:
◦ RQ 1: Is the proposed testing process
able to reach the Saturation at the
termination point?
◦ RQ 2 : Which are the main factors able to
affect the effectiveness of the proposed
testing process at the termination point?
Mobilesoft 2015 – Florence, Italy – May 16 18
Why TerL ≠ 100% ?
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Experimentation - Subjects
 18 open source Android applications were
selected.
19
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Experimentation - Metrics
 A set o metrics were proposed to assess the Saturation
effect at the termination point.
◦ RePRS it is the Residual Percentage of Reachable
Statements by the process at the termination point.
◦ If RePRS = 0 (or approximately equal to zero) then all
the reachable code of the application has been actually
covered.
Executed Code
Not Executed Code
20MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Experimentation - Metrics
 A set o metrics were proposed to assess the Saturation
effect at the termination point.
◦ RePRS it is the Residual Percentage of Reachable
Statements by the process at the termination point.
◦ If RePRS = 0 (or approximately equal to zero) then all
the reachable code of the application has been actually
covered.
Executed Code
Unreachable Code
Reachable Code
21MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Experimental Procedure
 AndroidRipper was exploited as MFT
tool.
◦ It was configured for:
 sending events on the GUI widgets having at least
a registered listener, for emulating the pressure of
the back and openMenu buttons and the device
rotation;
 filling in the EditText widgets with random numeric
values;
 firing consecutive events with a delay of 500 ms;
 For each AUT:
◦ a specific initial precondition was defined;
◦ k=12 testing sessions were executed.
 All the testing sessions were executed
on Android Virtual Devices (AVD) having 22MOBILESoft 2015 – Florence, Italy – May 16
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Results
 To answer the RQs the code
statements left uncovered by the
testing process were manually
analyzed.
Mobilesoft 2015 – Florence, Italy – May 16 23
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Discussion of the results
 RQ 1 answer: in all the cases the
proposed testing process was able to
reach the Saturation at the termination
point.
 RQ 2 answer: the main factors affecting
the effectiveness of the proposed testing
processes were:
1. the preconditions of the AUT,
2. the configurations of the testing platform,
3. the limitations and the configuration of the
MFT tool, and
4. the existence of unreachable statements in
the source code of the AUT.
Mobilesoft 2015 – Florence, Italy – May 16 24
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Lesson learned …
 We were able to derive an alternative and
more efficient stop condition.
◦ “The data suggested that the process could be
stopped, without loss of code coverage, as soon
as the coverage of one of the sessions reached
the cumulative one.”
Mobilesoft 2015 – Florence, Italy – May 16 25
Don’t wait that the slowest
session covers the same code
executed by the other ones.
The process terminates when
the fastest session covers also
all the code executed by the
other ones.
what it means in practice
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
… Lesson learned
 To validate this intuition, we evaluated the new
Termination points and Termination Levels.
 The reduction rate varies between 24.48% and
93.58%.
 The same TerL values were obtained.
Mobilesoft 2015 – Florence, Italy – May 16 26
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Conclusions
 A fully automatic MFT process that is able to find
a cost-effective termination point was presented.
 The process is supported by a software
infrastructure we developed for testing Android
mobile applications.
 The validity of the approach was shown by an
experiment.
27Mobilesoft 2015 – Florence, Italy – May 16
Future Works
 Improve the experimentation in order to extend
the validity of the proposed approach in mobile
context.
 Extend the validity of the approach in other
contexts, i.e. desktop applications.
Exploiting the Saturation Effect in Automatic Random Testing of Android Applications
Thank you !!!
Mobilesoft 2015 – Florence, Italy – May 16 28

More Related Content

What's hot

Lijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunnerLijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunner
Lijie Xia
 
Software Testing - Sajid Sidi
Software Testing - Sajid SidiSoftware Testing - Sajid Sidi
Software Testing - Sajid Sidi
Sajid Sidi
 
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
Kevin Moran
 
Automated GUI-Testing of Android Apps: From Research to Practice
Automated GUI-Testing of Android Apps: From Research to PracticeAutomated GUI-Testing of Android Apps: From Research to Practice
Automated GUI-Testing of Android Apps: From Research to Practice
Kevin Moran
 
Iwsm2014 application of function points to software based on open source - ...
Iwsm2014   application of function points to software based on open source - ...Iwsm2014   application of function points to software based on open source - ...
Iwsm2014 application of function points to software based on open source - ...
Nesma
 

What's hot (17)

The History of Software Testing
The History of Software TestingThe History of Software Testing
The History of Software Testing
 
Lijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunnerLijie xia lx223809 monkeyrunner
Lijie xia lx223809 monkeyrunner
 
Software Testing - Sajid Sidi
Software Testing - Sajid SidiSoftware Testing - Sajid Sidi
Software Testing - Sajid Sidi
 
WekaNose presentation
WekaNose presentationWekaNose presentation
WekaNose presentation
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testing
 
ICSE17 - Tool Demonstration - CrashScope A Practical Tool for the Automated T...
ICSE17 - Tool Demonstration - CrashScope A Practical Tool for the Automated T...ICSE17 - Tool Demonstration - CrashScope A Practical Tool for the Automated T...
ICSE17 - Tool Demonstration - CrashScope A Practical Tool for the Automated T...
 
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
ICSE17Tech Briefing - Automated GUI Testing of Android Apps: From Research to...
 
How do Developers Test Android Applications?
How do Developers Test Android Applications?How do Developers Test Android Applications?
How do Developers Test Android Applications?
 
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
Continuous, Evolutionary and Large-Scale: A New Perspective for Automated Mob...
 
Automated GUI-Testing of Android Apps: From Research to Practice
Automated GUI-Testing of Android Apps: From Research to PracticeAutomated GUI-Testing of Android Apps: From Research to Practice
Automated GUI-Testing of Android Apps: From Research to Practice
 
On-Device Bug Reporting for Android Applications
On-Device Bug Reporting for Android ApplicationsOn-Device Bug Reporting for Android Applications
On-Device Bug Reporting for Android Applications
 
Software Reliability
Software ReliabilitySoftware Reliability
Software Reliability
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
 
Iwsm2014 application of function points to software based on open source - ...
Iwsm2014   application of function points to software based on open source - ...Iwsm2014   application of function points to software based on open source - ...
Iwsm2014 application of function points to software based on open source - ...
 
Automatically Discovering, Reporting and Reproducing Android Application Crashes
Automatically Discovering, Reporting and Reproducing Android Application CrashesAutomatically Discovering, Reporting and Reproducing Android Application Crashes
Automatically Discovering, Reporting and Reproducing Android Application Crashes
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
SSBSE 2020 keynote
SSBSE 2020 keynoteSSBSE 2020 keynote
SSBSE 2020 keynote
 

Viewers also liked

catalogue- cable seals
catalogue- cable sealscatalogue- cable seals
catalogue- cable seals
lei lilan
 
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
comfoodforhealth
 

Viewers also liked (14)

Kourtney Resume
Kourtney ResumeKourtney Resume
Kourtney Resume
 
Dani westhelle portfolio
Dani westhelle   portfolioDani westhelle   portfolio
Dani westhelle portfolio
 
La web 2.0 Gloria Isaza
La web 2.0 Gloria IsazaLa web 2.0 Gloria Isaza
La web 2.0 Gloria Isaza
 
Principais diretrizes para a criação de conteúdos acessíveis
Principais diretrizes para a criação de conteúdos acessíveisPrincipais diretrizes para a criação de conteúdos acessíveis
Principais diretrizes para a criação de conteúdos acessíveis
 
Sakerhet
SakerhetSakerhet
Sakerhet
 
33535
3353533535
33535
 
Me gate'14-paper-01
Me gate'14-paper-01Me gate'14-paper-01
Me gate'14-paper-01
 
KeeGuard and KeeWalk Case Study
KeeGuard and KeeWalk Case StudyKeeGuard and KeeWalk Case Study
KeeGuard and KeeWalk Case Study
 
catalogue- cable seals
catalogue- cable sealscatalogue- cable seals
catalogue- cable seals
 
Research on food for health marketing for shaping consumers' acceptance
Research on food for health marketing for shaping consumers' acceptanceResearch on food for health marketing for shaping consumers' acceptance
Research on food for health marketing for shaping consumers' acceptance
 
презентация Md audit 05_2016
презентация Md audit 05_2016презентация Md audit 05_2016
презентация Md audit 05_2016
 
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
Overview of the FoodRisC project. Aine McConnon. University College Dublin, I...
 
A Show of of Painted Hands
A Show of of Painted HandsA Show of of Painted Hands
A Show of of Painted Hands
 
Methods of Teaching in Speaking
Methods of Teaching in SpeakingMethods of Teaching in Speaking
Methods of Teaching in Speaking
 

Similar to Exploiting the Saturation Effect in Automatic Random Testing of Android Applications

Mdc2010 Automated Mobile Testing
Mdc2010 Automated Mobile TestingMdc2010 Automated Mobile Testing
Mdc2010 Automated Mobile Testing
momobangalore
 

Similar to Exploiting the Saturation Effect in Automatic Random Testing of Android Applications (20)

Cloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the EnterpriseCloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the Enterprise
 
Robot test system for Car navigation and Automotive
Robot test system for Car navigation and AutomotiveRobot test system for Car navigation and Automotive
Robot test system for Car navigation and Automotive
 
Mobile testing
Mobile testingMobile testing
Mobile testing
 
Meetic Mobile Strategy - Microsoft TechDays Paris 2015
Meetic Mobile Strategy - Microsoft TechDays Paris 2015Meetic Mobile Strategy - Microsoft TechDays Paris 2015
Meetic Mobile Strategy - Microsoft TechDays Paris 2015
 
Stratégie mobile de Meetic sur Windows
Stratégie mobile de Meetic sur WindowsStratégie mobile de Meetic sur Windows
Stratégie mobile de Meetic sur Windows
 
Mobile test automation overview & tools evaluation
Mobile test automation overview & tools evaluationMobile test automation overview & tools evaluation
Mobile test automation overview & tools evaluation
 
Meetic Mobile Strategy - Microsoft TechDays Paris 2015
Meetic Mobile Strategy - Microsoft TechDays Paris 2015Meetic Mobile Strategy - Microsoft TechDays Paris 2015
Meetic Mobile Strategy - Microsoft TechDays Paris 2015
 
Mdc2010 Automated Mobile Testing
Mdc2010 Automated Mobile TestingMdc2010 Automated Mobile Testing
Mdc2010 Automated Mobile Testing
 
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous IntegrationExperitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
 
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
DEPLOYMENT OF CALABASH AUTOMATION FRAMEWORK TO ANALYZE THE PERFORMANCE OF AN ...
 
Mobile Monitoring for Peak Events
Mobile Monitoring for Peak EventsMobile Monitoring for Peak Events
Mobile Monitoring for Peak Events
 
Techniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing AutomationTechniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing Automation
 
Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor, Android and Bluet...
Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor, Android and Bluet...Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor, Android and Bluet...
Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor, Android and Bluet...
 
Experitest & Tech Mahindra Co-Webinar
 Experitest & Tech Mahindra Co-Webinar Experitest & Tech Mahindra Co-Webinar
Experitest & Tech Mahindra Co-Webinar
 
IRJET - Mobile Application Testing and Report Generation using Image Proc...
IRJET -  	  Mobile Application Testing and Report Generation using Image Proc...IRJET -  	  Mobile Application Testing and Report Generation using Image Proc...
IRJET - Mobile Application Testing and Report Generation using Image Proc...
 
Reduce Release Risk with Feature Monitoring
Reduce Release Risk with Feature MonitoringReduce Release Risk with Feature Monitoring
Reduce Release Risk with Feature Monitoring
 
Mobile Testing in the Cloud
Mobile Testing in the CloudMobile Testing in the Cloud
Mobile Testing in the Cloud
 
Robotic Vehicle Movement with Webcam Operated by Cell Phone
Robotic Vehicle Movement with Webcam Operated by Cell PhoneRobotic Vehicle Movement with Webcam Operated by Cell Phone
Robotic Vehicle Movement with Webcam Operated by Cell Phone
 
IRJET-Android Controlled Firefighting Robot using Arduino
IRJET-Android Controlled Firefighting Robot using ArduinoIRJET-Android Controlled Firefighting Robot using Arduino
IRJET-Android Controlled Firefighting Robot using Arduino
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 

Recently uploaded

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (6)

Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 

Exploiting the Saturation Effect in Automatic Random Testing of Android Applications

  • 1. MOBILESoft 2015 - 2nd ACM International Conference on Mobile Software Engineering and Syste Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Domenico Amalfitano, Nicola Amatucci, Anna Rita Fasolino, Porfirio Tramontana Emily Kowalczyk, Atif M. Memon
  • 2. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Context and Motivations  Context ◦ Automatic GUI Random Testing of Mobile Applications.  Motivation ◦ To formalize a stopping criterion for random testing. MOBILESoft 2015 – Florence, Italy – May 16 2
  • 3. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications GUI Random Testing Techniques  A.K.A. Monkey Fuzz Testing Techniques.  Usually exploited for stress testing.  Sequences of random events are sent to the application under test (AUT). ◦ Generally only user events (i.e. mouse or keyboard events).  Fully automated. MOBILESoft 2015 – Florence, Italy – May 16 3
  • 4. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications MFT Tools  Tools implementing MFT techniques.  Easy to use  growing popularity for testing mobile applications. 4MOBILESoft 2015 – Florence, Italy – May 16 https://github.com/reverse- unina/AndroidRipper
  • 5. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications The Problem …  When the execution of an MFT tool must be stopped?  The stop condition is: ◦ able to affect the effectiveness and the cost of automatic testing processes. ◦ even more important with random testing techniques, affected by problems of reliability and efficiency of the test adequacy.  Covered Statements Percentage usually exploited to measure the test adequacy of testing techniques. CSP = #SetCoveredStatements #SetStatementsAUT ´100 MOBILESoft 2015 – Florence, Italy – May 16 5
  • 6. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Mostly Used Stop Criteria …  Predefined testing time or number of fired events. 0 10 20 30 40 50 60 70 80 90 100 300 500 700 900 1100 1300 1500 1700 1900 EXP1 EXP2 EXP3 Low #Events  (1) Low Reliability, (2) Low Effectiveness Number of fired Events CoveredStatementPercentage MOBILESoft 2015 – Florence, Italy – May 16 6
  • 7. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications … Mostly Used Stop Criteria  Fix the testing time or the number of fired events. Too many Events  Low Efficiency Number of fired Events 40 45 50 55 60 65 70 75 80 85 90 100 700 1300 1900 2500 3100 3700 4300 4900 5500 6100 6700 7300 7900 8500 9100 9700 S1 S2 S3 7 CoveredStatementPercentage MOBILESoft 2015 – Florence, Italy – May 16
  • 8. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications The proposed solution …  A testing process that automatically stops its execution at a point representing an optimal trade-off between effectiveness and cost. ◦ A point were test adequacy is maximized and no testing effort is wasted.  It exploits two typical phenomena of random testing. 8MOBILESoft 2015 – Florence, Italy – May 16
  • 9. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications First phenomenon1  The existence of a saturation effect in MFT. ◦ A well-known phenomenon where the test adequacy tends to a specific value as the amount of test execution increases. ◦ There is a point at which no more progress is made towards maximizing a test adequacy criterion.  It is called saturation point. ◦ We propose it as the optimal termination point. 9 1- E. Sherman, M. B. Dwyer, and S. Elbaum, “Saturation-based testing of concurrent programs,” SIGSOFT ‘09 MOBILESoft 2015 – Florence, Italy – May 16
  • 10. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Second phenomenon2  The predictability property of MFT ◦ The difference between the test adequacies reached by two random test cases tend to be definitely zero. ◦ In other words, two test cases tend to reach the same test adequacy (i.e., same found faults or same set of executed LOCs ) 10 2- A. Arcuri, M. Z. Iqbal, and L. Briand, “Random testing: Theoretical results and practical implications,” IEEE Trans. Softw. Eng. MOBILESoft 2015 – Florence, Italy – May 16
  • 11. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications … The proposed solution  The process exploits the definition of predictability to reach a potential saturation point.  The determination of the potential saturation point is based on the simultaneous execution of several random testing sessions.  The testing process is stopped when the difference in code coverage is zero. ◦ When the sessions have executed the same code. 11MOBILESoft 2015 – Florence, Italy – May 16
  • 12. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Graphical interpretation of the solution 12MOBILESoft 2015 – Florence, Italy – May 16 40 45 50 55 60 65 70 75 80 85 90 100 600 1100 1600 2100 2600 3100 3600 4100 4600 5100 5600 6100 6600 7100 7600 8100 8600 9100 9600 S1 S2 S3 Saturation Effect – Saturation Point Predictability – differences in code coverage tend definitely to zero Unreliability Zone
  • 13. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Differences in code coverage  Covered Statements Percentage (CSP) as test adequacy.  All the sessions have actually covered the same statements of the AUT  all the sessions reach a test adequacy value equals to the Cumulative Coverage Statement Percentage (CSCP). 13MOBILESoft 2015 – Florence, Italy – May 16 CSP = 40% CSP = 40% CSCP = 70% Sessions have covered different code
  • 14. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Differences in code coverage  Covered Statements Percentage (CSP) as test adequacy.  All the sessions have actually covered the same statements of the AUT  all the sessions reach a test adequacy value equals to the Cumulative Coverage Statement Percentage (CSCP). 14MOBILESoft 2015 – Florence, Italy – May 16 CSP = 55% CSP = 55% CSCP = 55% Sessions have covered the same code
  • 15. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications The algorithm Mobilesoft 2015 – Florence, Italy – May 16 Launch of k testing sessions While the k sessions do not reach the same coverage Each session fires a new random event The termination condition is evaluated at predefined sampling steps 15
  • 16. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications TerP and TerL  The algorithm produces two outputs: ◦ Termination Point (TerP): the minimum number of events at which the termination condition is verified. ◦ Termination Level (TerL): the coverage statement percentage reached by all the k testing sessions. Mobilesoft 2015 – Florence, Italy – May 16 40 50 60 70 80 90 100 400 700 1000 1300 1600 1900 2200 2500 2800 3100 3400 3700 S1 S2 S3 UNION (TerP = 3700, TerL = 85%) 16 Number of fired Events CoveredStatementPercentage
  • 17. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Testing infrastructure  Implemented for executing the testing process. ◦ It targets the Android mobile platform. Mobilesoft 2015 – Florence, Italy – May 16 17
  • 18. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Experimentation – RQs  Experiment aimed at answering the following research questions: ◦ RQ 1: Is the proposed testing process able to reach the Saturation at the termination point? ◦ RQ 2 : Which are the main factors able to affect the effectiveness of the proposed testing process at the termination point? Mobilesoft 2015 – Florence, Italy – May 16 18 Why TerL ≠ 100% ?
  • 19. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Experimentation - Subjects  18 open source Android applications were selected. 19
  • 20. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Experimentation - Metrics  A set o metrics were proposed to assess the Saturation effect at the termination point. ◦ RePRS it is the Residual Percentage of Reachable Statements by the process at the termination point. ◦ If RePRS = 0 (or approximately equal to zero) then all the reachable code of the application has been actually covered. Executed Code Not Executed Code 20MOBILESoft 2015 – Florence, Italy – May 16
  • 21. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Experimentation - Metrics  A set o metrics were proposed to assess the Saturation effect at the termination point. ◦ RePRS it is the Residual Percentage of Reachable Statements by the process at the termination point. ◦ If RePRS = 0 (or approximately equal to zero) then all the reachable code of the application has been actually covered. Executed Code Unreachable Code Reachable Code 21MOBILESoft 2015 – Florence, Italy – May 16
  • 22. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Experimental Procedure  AndroidRipper was exploited as MFT tool. ◦ It was configured for:  sending events on the GUI widgets having at least a registered listener, for emulating the pressure of the back and openMenu buttons and the device rotation;  filling in the EditText widgets with random numeric values;  firing consecutive events with a delay of 500 ms;  For each AUT: ◦ a specific initial precondition was defined; ◦ k=12 testing sessions were executed.  All the testing sessions were executed on Android Virtual Devices (AVD) having 22MOBILESoft 2015 – Florence, Italy – May 16
  • 23. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Results  To answer the RQs the code statements left uncovered by the testing process were manually analyzed. Mobilesoft 2015 – Florence, Italy – May 16 23
  • 24. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Discussion of the results  RQ 1 answer: in all the cases the proposed testing process was able to reach the Saturation at the termination point.  RQ 2 answer: the main factors affecting the effectiveness of the proposed testing processes were: 1. the preconditions of the AUT, 2. the configurations of the testing platform, 3. the limitations and the configuration of the MFT tool, and 4. the existence of unreachable statements in the source code of the AUT. Mobilesoft 2015 – Florence, Italy – May 16 24
  • 25. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Lesson learned …  We were able to derive an alternative and more efficient stop condition. ◦ “The data suggested that the process could be stopped, without loss of code coverage, as soon as the coverage of one of the sessions reached the cumulative one.” Mobilesoft 2015 – Florence, Italy – May 16 25 Don’t wait that the slowest session covers the same code executed by the other ones. The process terminates when the fastest session covers also all the code executed by the other ones. what it means in practice
  • 26. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications … Lesson learned  To validate this intuition, we evaluated the new Termination points and Termination Levels.  The reduction rate varies between 24.48% and 93.58%.  The same TerL values were obtained. Mobilesoft 2015 – Florence, Italy – May 16 26
  • 27. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Conclusions  A fully automatic MFT process that is able to find a cost-effective termination point was presented.  The process is supported by a software infrastructure we developed for testing Android mobile applications.  The validity of the approach was shown by an experiment. 27Mobilesoft 2015 – Florence, Italy – May 16 Future Works  Improve the experimentation in order to extend the validity of the proposed approach in mobile context.  Extend the validity of the approach in other contexts, i.e. desktop applications.
  • 28. Exploiting the Saturation Effect in Automatic Random Testing of Android Applications Thank you !!! Mobilesoft 2015 – Florence, Italy – May 16 28