SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
An Exploratory Study on the Refactoring of
Unit Test Files in Android Applications
Anthony Peruma, Christian D. Newman, Mohamed Wiem Mkaouer, Ali Ouni, Fabio Palomba
4 t h I n t e r n a t i o n a l W o r k s h o p o n R e f a c t o r i n g ( I W o R 2 0 2 0 )
REFACTORING
Smelly source
code files
Refactoring
source code
Smell free
source code
Smells are symptoms of bad
programming practices – a
threat to design
Refactoring improves the
internal design of software
systems without altering its
external behavior
Refactoring involves locating
and correcting smells
exhibited by the source code
An essential software maintenance activity
Refactoring operations enable developers to take necessary actions to correct bad programming practices
01
TEST SMELLS
Test code, like production code, is subject to smells
Formally introduced in 2001 with 11 smell types
Inclusion of additional smell types, analysis of their
evolution and longevity, and elimination patterns
Tools to detect specific smell types
Studies on traditional Java applications
02
2.5 million+ apps
available on
Google Play
(December 2019)
03
GOAL
Expand our understanding of the
relationship between refactoring
changes and their effect on test smells
in Android apps
04
RESEARCH QUESTIONS
What types of refactoring operations are applied to
unit test files compared to non-test files?01
What types of refactoring operations are frequently
applied to smelly test files?02
What kinds of refactorings are typically used to remove
test smells?03
05
CONTRIBUTIONS
01
An understanding of
refactoring operations
applied to test suites of
Android apps
02
Insights into the
relationships between
refactoring operations
and test smells
03
A dataset for replication
and extension
purposes, available on
our project website
06
EXPERIMENT DESIGN
Dataset of test
files & smells in
Android apps
Detection of
refactoring
operations
Dataset of
refactoring
operations
Analysis of results
open-source apps: 250 refactored test files: 4,709
refactoring commits: 62,953
refactoring operations: 336,771
07
TEST SMELLS & REFACTORING OPERATIONS
◸ Assertion Roulette
◸ Conditional Test Logic
◸ Constructor Initialization
◸ Default Test
◸ Duplicate Assert
◸ Eager Test
◸ Empty Test
◸ Exception Handling
◸ General Fixture
◸ Ignored Test
.
.
.
◸ Rename Method
◸ Change Variable Type
◸ Rename Variable
◸ Inline Method
◸ Extract Method
◸ Move Class
◸ Move Method
◸ Pull Up Method
◸ Split Attribute
◸ Push Down Method.
.
.
.
19 Test Smells 39 Refactoring Operations
08
RQ 1 - What types of refactoring operations are applied
to unit test files compared to non-test files?
◸ 91.98% of refactorings are applied to methods
Vs. 8.02% to classes
Refactoring Operations Count %
Rename Method 1511 19.81%
Change Variable Type 1452 19.03%
Rename Variable 803 10.53%
Change Attribute Type 773 10.13%
Extract Method 426 5.58%
Other Operations 2,664 34.29%
Total 7,629 100%
Refactoring Operations Count %
Move Class 23,180 13.33%
Change Parameter Type 14,178 8.15%
Change Attribute Type 12,921 7.43%
Rename Method 12,074 6.94%
Rename Parameter 11,299 6.50%
Other Operations 100,249 57.65%
Total 173,901 100%
Test Files Non-Test Files
◸ 49.27% of refactorings are applied to methods
Vs. 50.73% to classes
65% 42%
◸ Test files tend to undergo more renames ◸ Non-test files are subject to more design level
types of refactorings 09
RQ 2 - What types of refactoring operations are
frequently applied to smelly test files?
Co-occurring
Count %Smell Type Refactoring Operation
Assertion Roulette Change Variable Type 141 53.01%
Eager Test Extract Method 14 42.42%
Lazy Test Extract Method 20 30.30%
General Fixture Change Attribute Type 8 38.10%
Redundant
Assertion Move Method 9 29.03%
Approach: Extracted test files that exhibited only one smell type and then looked at the refactorings in the file
4,589 test files that had one or more smells had undergone a refactoring
The attribute is utilized in the setup()
method
The variable and the smell exist
within a test method
These smells and refactoring
operation are related to test methods
A debugging smell introduced when
making design level changes
10
RQ 3 - What kinds of refactorings are typically used to
remove test smells?
Approach: Lifetime history of a smelly test file; matched the refactoring applied with a smell reduction
38%2.121.30
Avg. smells removed
by refactoring test file
Avg. refactoring operations
to reduce smell count
Freq. for a single refactoring
to remove a single smell type
481
Smelly test files that had
a reduction & refactoring
◸ Change Variable Type being one of the most common refactorings applied when a smell is removed
◸ Eager Test is frequently resolved by developers when performing a single refactoring operation
◸ Please refer the paper for a qualitative based set of examples on the co-occurrence of smell type
reduction and refactoring operations -- Extract Method resolving the Conditional Test Logic smell
◸ Manual review - most refactorings are applied for reasons other than for the correction of smell
◹ More in-depth, and developer supported, studies are needed
11
TAKEAWAYS
RQ 1
Developers are better
prepared to estimate
rework effort for (non-)
test files
Specialized tools for
refactoring files
RQ 2
Developers are better
prepared in determining
the most likely smell
being introduced when
performing a refactoring
of a test file
RQ 3
Refactoring of test files
are mostly related to
development activities
such as fixing issues,
adhering to coding
standards, etc.
12
SUMMARY
Mined refactoring operations and test smells in 250
open-source Android apps01
App developers apply a different set of refactorings to
test and non-test source code files02
There exist scenarios where refactoring operations are
utilized to correct a test smell04
Certain test smells and refactoring operations that co-
occur frequently (e.g., Lazy Test & Extract Method)03
13
THANKS!
h t t p s : / / t e s t s m e l l s . g i t h u b . i o
An Exploratory Study on the Refactoring of Unit Test Files in Android Applications

Weitere ähnliche Inhalte

Ähnlich wie An Exploratory Study on the Refactoring of Unit Test Files in Android Applications

A Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software RefactoringA Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software RefactoringAli Ouni
 
Code Smell, Software Engineering
Code Smell, Software EngineeringCode Smell, Software Engineering
Code Smell, Software EngineeringAnshul Vinayak
 
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...acijjournal
 
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...acijjournal
 
Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsightchiportal
 
On The Relation of Test Smells to Software Code Quality
On The Relation of Test Smells to Software Code QualityOn The Relation of Test Smells to Software Code Quality
On The Relation of Test Smells to Software Code QualityDelft University of Technology
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringAli Ouni
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smelleSAT Publishing House
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smelleSAT Journals
 
Agile maintenance
Agile maintenanceAgile maintenance
Agile maintenancearalikatte
 
Software testing services in India .pptx
Software testing services in India .pptxSoftware testing services in India .pptx
Software testing services in India .pptxSakshiPatel82
 
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONS
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONSQUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONS
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONSijseajournal
 
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
Software Refactoring Under Uncertainty:  A Robust Multi-Objective ApproachSoftware Refactoring Under Uncertainty:  A Robust Multi-Objective Approach
Software Refactoring Under Uncertainty: A Robust Multi-Objective ApproachWiem Mkaouer
 
Software Reuse: Challenges and Business Success
Software Reuse: Challenges and Business SuccessSoftware Reuse: Challenges and Business Success
Software Reuse: Challenges and Business SuccessUniversity of Zurich
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenanceAnsh Kapoor
 
Solving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingPerfecto by Perforce
 

Ähnlich wie An Exploratory Study on the Refactoring of Unit Test Files in Android Applications (20)

A Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software RefactoringA Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software Refactoring
 
Code Smell, Software Engineering
Code Smell, Software EngineeringCode Smell, Software Engineering
Code Smell, Software Engineering
 
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
 
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
 
Track g semiconductor test program - testinsight
Track g  semiconductor test program - testinsightTrack g  semiconductor test program - testinsight
Track g semiconductor test program - testinsight
 
On The Relation of Test Smells to Software Code Quality
On The Relation of Test Smells to Software Code QualityOn The Relation of Test Smells to Software Code Quality
On The Relation of Test Smells to Software Code Quality
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software Enginnering
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smell
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smell
 
Phenolics assays - Tannins
Phenolics assays - TanninsPhenolics assays - Tannins
Phenolics assays - Tannins
 
Agile maintenance
Agile maintenanceAgile maintenance
Agile maintenance
 
Software testing services in India .pptx
Software testing services in India .pptxSoftware testing services in India .pptx
Software testing services in India .pptx
 
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONS
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONSQUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONS
QUALITY METRICS OF TEST SUITES IN TESTDRIVEN DESIGNED APPLICATIONS
 
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
Software Refactoring Under Uncertainty:  A Robust Multi-Objective ApproachSoftware Refactoring Under Uncertainty:  A Robust Multi-Objective Approach
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
 
Software Reuse: Challenges and Business Success
Software Reuse: Challenges and Business SuccessSoftware Reuse: Challenges and Business Success
Software Reuse: Challenges and Business Success
 
C41041120
C41041120C41041120
C41041120
 
Smoke testing
Smoke testingSmoke testing
Smoke testing
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
 
Solving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous Testing
 
Regression testing
Regression testingRegression testing
Regression testing
 

Mehr von University of Hawai‘i at Mānoa

Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...University of Hawai‘i at Mānoa
 
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...University of Hawai‘i at Mānoa
 
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...
Preparing for the Academic Job Market: Experience and Tips from a Recent F...University of Hawai‘i at Mānoa
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...University of Hawai‘i at Mānoa
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...University of Hawai‘i at Mānoa
 
Understanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUnderstanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUniversity of Hawai‘i at Mānoa
 
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...University of Hawai‘i at Mānoa
 
Using Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUsing Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUniversity of Hawai‘i at Mānoa
 
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...University of Hawai‘i at Mānoa
 
Contextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesContextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesUniversity of Hawai‘i at Mānoa
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...University of Hawai‘i at Mānoa
 
Permission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyPermission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyUniversity of Hawai‘i at Mānoa
 

Mehr von University of Hawai‘i at Mānoa (20)

Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
 
A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]
 
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
 
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
 
A Primer on High-Quality Identifier Naming
A Primer on High-Quality Identifier NamingA Primer on High-Quality Identifier Naming
A Primer on High-Quality Identifier Naming
 
Test Anti-Patterns: From Definition to Detection
Test Anti-Patterns: From Definition to DetectionTest Anti-Patterns: From Definition to Detection
Test Anti-Patterns: From Definition to Detection
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
 
Understanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUnderstanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory Study
 
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
 
IDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolIDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal Tool
 
Using Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUsing Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name Evolution
 
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
 
Contextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesContextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit Messages
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
 
A Preliminary Study of Android Refactorings
A Preliminary Study of Android RefactoringsA Preliminary Study of Android Refactorings
A Preliminary Study of Android Refactorings
 
Permission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyPermission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory Study
 
A Career In IT
A Career In ITA Career In IT
A Career In IT
 
Web Content Management - Introduction
Web Content Management - IntroductionWeb Content Management - Introduction
Web Content Management - Introduction
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 

Kürzlich hochgeladen

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Kürzlich hochgeladen (20)

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

An Exploratory Study on the Refactoring of Unit Test Files in Android Applications

  • 1. An Exploratory Study on the Refactoring of Unit Test Files in Android Applications Anthony Peruma, Christian D. Newman, Mohamed Wiem Mkaouer, Ali Ouni, Fabio Palomba 4 t h I n t e r n a t i o n a l W o r k s h o p o n R e f a c t o r i n g ( I W o R 2 0 2 0 )
  • 2. REFACTORING Smelly source code files Refactoring source code Smell free source code Smells are symptoms of bad programming practices – a threat to design Refactoring improves the internal design of software systems without altering its external behavior Refactoring involves locating and correcting smells exhibited by the source code An essential software maintenance activity Refactoring operations enable developers to take necessary actions to correct bad programming practices 01
  • 3. TEST SMELLS Test code, like production code, is subject to smells Formally introduced in 2001 with 11 smell types Inclusion of additional smell types, analysis of their evolution and longevity, and elimination patterns Tools to detect specific smell types Studies on traditional Java applications 02
  • 4. 2.5 million+ apps available on Google Play (December 2019) 03
  • 5. GOAL Expand our understanding of the relationship between refactoring changes and their effect on test smells in Android apps 04
  • 6. RESEARCH QUESTIONS What types of refactoring operations are applied to unit test files compared to non-test files?01 What types of refactoring operations are frequently applied to smelly test files?02 What kinds of refactorings are typically used to remove test smells?03 05
  • 7. CONTRIBUTIONS 01 An understanding of refactoring operations applied to test suites of Android apps 02 Insights into the relationships between refactoring operations and test smells 03 A dataset for replication and extension purposes, available on our project website 06
  • 8. EXPERIMENT DESIGN Dataset of test files & smells in Android apps Detection of refactoring operations Dataset of refactoring operations Analysis of results open-source apps: 250 refactored test files: 4,709 refactoring commits: 62,953 refactoring operations: 336,771 07
  • 9. TEST SMELLS & REFACTORING OPERATIONS ◸ Assertion Roulette ◸ Conditional Test Logic ◸ Constructor Initialization ◸ Default Test ◸ Duplicate Assert ◸ Eager Test ◸ Empty Test ◸ Exception Handling ◸ General Fixture ◸ Ignored Test . . . ◸ Rename Method ◸ Change Variable Type ◸ Rename Variable ◸ Inline Method ◸ Extract Method ◸ Move Class ◸ Move Method ◸ Pull Up Method ◸ Split Attribute ◸ Push Down Method. . . . 19 Test Smells 39 Refactoring Operations 08
  • 10. RQ 1 - What types of refactoring operations are applied to unit test files compared to non-test files? ◸ 91.98% of refactorings are applied to methods Vs. 8.02% to classes Refactoring Operations Count % Rename Method 1511 19.81% Change Variable Type 1452 19.03% Rename Variable 803 10.53% Change Attribute Type 773 10.13% Extract Method 426 5.58% Other Operations 2,664 34.29% Total 7,629 100% Refactoring Operations Count % Move Class 23,180 13.33% Change Parameter Type 14,178 8.15% Change Attribute Type 12,921 7.43% Rename Method 12,074 6.94% Rename Parameter 11,299 6.50% Other Operations 100,249 57.65% Total 173,901 100% Test Files Non-Test Files ◸ 49.27% of refactorings are applied to methods Vs. 50.73% to classes 65% 42% ◸ Test files tend to undergo more renames ◸ Non-test files are subject to more design level types of refactorings 09
  • 11. RQ 2 - What types of refactoring operations are frequently applied to smelly test files? Co-occurring Count %Smell Type Refactoring Operation Assertion Roulette Change Variable Type 141 53.01% Eager Test Extract Method 14 42.42% Lazy Test Extract Method 20 30.30% General Fixture Change Attribute Type 8 38.10% Redundant Assertion Move Method 9 29.03% Approach: Extracted test files that exhibited only one smell type and then looked at the refactorings in the file 4,589 test files that had one or more smells had undergone a refactoring The attribute is utilized in the setup() method The variable and the smell exist within a test method These smells and refactoring operation are related to test methods A debugging smell introduced when making design level changes 10
  • 12. RQ 3 - What kinds of refactorings are typically used to remove test smells? Approach: Lifetime history of a smelly test file; matched the refactoring applied with a smell reduction 38%2.121.30 Avg. smells removed by refactoring test file Avg. refactoring operations to reduce smell count Freq. for a single refactoring to remove a single smell type 481 Smelly test files that had a reduction & refactoring ◸ Change Variable Type being one of the most common refactorings applied when a smell is removed ◸ Eager Test is frequently resolved by developers when performing a single refactoring operation ◸ Please refer the paper for a qualitative based set of examples on the co-occurrence of smell type reduction and refactoring operations -- Extract Method resolving the Conditional Test Logic smell ◸ Manual review - most refactorings are applied for reasons other than for the correction of smell ◹ More in-depth, and developer supported, studies are needed 11
  • 13. TAKEAWAYS RQ 1 Developers are better prepared to estimate rework effort for (non-) test files Specialized tools for refactoring files RQ 2 Developers are better prepared in determining the most likely smell being introduced when performing a refactoring of a test file RQ 3 Refactoring of test files are mostly related to development activities such as fixing issues, adhering to coding standards, etc. 12
  • 14. SUMMARY Mined refactoring operations and test smells in 250 open-source Android apps01 App developers apply a different set of refactorings to test and non-test source code files02 There exist scenarios where refactoring operations are utilized to correct a test smell04 Certain test smells and refactoring operations that co- occur frequently (e.g., Lazy Test & Extract Method)03 13
  • 15. THANKS! h t t p s : / / t e s t s m e l l s . g i t h u b . i o