SlideShare a Scribd company logo
1 of 13
Download to read offline
EMPIRICAL STUDY OF PROGRAMMING TOEMPIRICAL STUDY OF PROGRAMMING TO
AN INTERFACEAN INTERFACE
B. Verhaeghe1, Christopher Fuhrman2,
L. Guerrouj2, N. Anquetil3 and S. Ducasse4
1Berger-Levrault, France
2École de technologie supérieure, Montreal, Canada
3University of Lille, CRIStAL
4RMoD - Inria Nord Europe
  
1
Empirical study of programming to an interface

MOTIVATIONMOTIVATION
Heuristic from Design Patterns book (GoF 1994).
Clients are less fragile if implementations change.
We have been teaching this to students for decades,
but is there any empirical evidence to support it?
“Program to an interface, not an
implementation.”
2
Empirical study of programming to an interface

RELATED PRINCIPLESRELATED PRINCIPLES
Protected Variation (C. Larman)
Open-Closed Principle (B. Meyer)
Information Hiding (D. Parnas)
3
Empirical study of programming to an interface

WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE
Beginner design in Java
Client
«interface»
List
ArrayList TreeList
Coupling to
implementation
ArrayList myList = new ArrayList();
4 . 1
Empirical study of programming to an interface

WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE
Improved design…
Client
«interface»
List
ArrayList TreeList
Coupling to
interface
«creates»
Coupling to
implementation
List myList = new ArrayList();
4 . 2
Empirical study of programming to an interface

WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE
Factory design decouples client from implementation
Client
«interface»
List
ArrayList
TreeList
ListFactory
Coupling
to interface
creates
creates
uses
List myList = ListFactory.create("...");
4 . 3
Empirical study of programming to an interface

CONSEQUENCES OF PTICONSEQUENCES OF PTI
Protect clients changing implementation(s)
Favor extensions to implementations
Simplify the API, overcome single-inheritance
limitation
Speculative Generality (code smell)
Additional level of hierarchy
Factories decouple clients from implementations
Changed interface breaks clients and
implementations
5
Empirical study of programming to an interface

EMPIRICAL STUDY OF THE CONSEQUENCESEMPIRICAL STUDY OF THE CONSEQUENCES
Human studies: qualities such as
understandability, ease of extensibility, etc.
Observational studies: Code repositories to see if
client code is protected (change propagation), fault
location, etc.
6
Empirical study of programming to an interface

OBSERVATIONAL STUDY: PROTECTED VARIATIONOBSERVATIONAL STUDY: PROTECTED VARIATION
Cochange in Java projects (GitHub)
Static analysis identi es cochange pairs (client,
implementation)
Unprotected pairs (direct coupling)
Protected pairs (no coupling)
Client A Client B
«interface»
ISomething
Implementation
7 . 1
Empirical study of programming to an interface

RESEARCH QUESTIONRESEARCH QUESTION
Do unprotected pairs cochange more often than
protected pairs?
Client A Client B
«interface»
ISomething
Implementation
7 . 2
Empirical study of programming to an interface

COCHANGE HISTORYCOCHANGE HISTORY
H is the history of commits.
Cochanged Protected Dependencies ratio
CPD(%) =
|H∩P|
|P|
Cochanged Unprotected Dependencies ratio
CUD(%) =
|H∩U|
|U|
.
7 . 3
Empirical study of programming to an interface

RESULTSRESULTS
126 (popular) Java projects on GitHub
Ratios of CPD and CUD
p < 0.001 and effect size (Cliff’s) d = 0.32 (small)
7 . 4
Empirical study of programming to an interface

FUTURE WORKFUTURE WORK
Observational studies with more context
Classify projects (abstractness)
Microarchitectures (e.g., factories)
Natural experiments for quality aspects
8
Empirical study of programming to an interface


More Related Content

What's hot

Btec National Unit 18 Dna Technology
Btec National Unit 18 Dna TechnologyBtec National Unit 18 Dna Technology
Btec National Unit 18 Dna TechnologyTeresa Briercliffe
 
ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)kvsrteja
 
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsA Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsYuhao Wu
 
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
 
A Novel Approach for Code Clone Detection Using Hybrid Technique
A Novel Approach for Code Clone Detection Using Hybrid TechniqueA Novel Approach for Code Clone Detection Using Hybrid Technique
A Novel Approach for Code Clone Detection Using Hybrid TechniqueINFOGAIN PUBLICATION
 
Btec National Unit 18 Genetic Engineering
Btec National Unit 18 Genetic EngineeringBtec National Unit 18 Genetic Engineering
Btec National Unit 18 Genetic EngineeringTeresa Briercliffe
 
Early Detection of Collaboration Conflicts & Risks in Software Development
Early Detection of Collaboration Conflicts & Risks in Software DevelopmentEarly Detection of Collaboration Conflicts & Risks in Software Development
Early Detection of Collaboration Conflicts & Risks in Software DevelopmentRoopesh Jhurani
 

What's hot (11)

ctchou-resume
ctchou-resumectchou-resume
ctchou-resume
 
Learning Curve
Learning CurveLearning Curve
Learning Curve
 
Btec National Unit 18 Dna Technology
Btec National Unit 18 Dna TechnologyBtec National Unit 18 Dna Technology
Btec National Unit 18 Dna Technology
 
ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)
 
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source ProjectsA Method to Detect License Inconsistencies for Large-Scale Open Source Projects
A Method to Detect License Inconsistencies for Large-Scale Open Source Projects
 
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
 
A Novel Approach for Code Clone Detection Using Hybrid Technique
A Novel Approach for Code Clone Detection Using Hybrid TechniqueA Novel Approach for Code Clone Detection Using Hybrid Technique
A Novel Approach for Code Clone Detection Using Hybrid Technique
 
Opposites Attract
Opposites AttractOpposites Attract
Opposites Attract
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
Icpc16.ppt
 
Btec National Unit 18 Genetic Engineering
Btec National Unit 18 Genetic EngineeringBtec National Unit 18 Genetic Engineering
Btec National Unit 18 Genetic Engineering
 
Early Detection of Collaboration Conflicts & Risks in Software Development
Early Detection of Collaboration Conflicts & Risks in Software DevelopmentEarly Detection of Collaboration Conflicts & Risks in Software Development
Early Detection of Collaboration Conflicts & Risks in Software Development
 

Similar to Empirical study of programming to an interface

IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...ijseajournal
 
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...ijseajournal
 
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...SBGC
 
Replication and Benchmarking in Software Analytics
Replication and Benchmarking in Software AnalyticsReplication and Benchmarking in Software Analytics
Replication and Benchmarking in Software AnalyticsUniversity of Zurich
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel GrichiPtidej Team
 
OOP 2021 - Eventual Consistency - Du musst keine Angst haben
OOP 2021 - Eventual Consistency - Du musst keine Angst habenOOP 2021 - Eventual Consistency - Du musst keine Angst haben
OOP 2021 - Eventual Consistency - Du musst keine Angst habenSusanne Braun
 
Software Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionSoftware Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionAttila Magyar
 
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...178 - A replicated study on duplicate detection: Using Apache Lucene to searc...
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...ESEM 2014
 
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveModel-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveDharmalingam Ganesan
 
Automated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsAutomated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsDharmalingam Ganesan
 
Writting Better Software
Writting Better SoftwareWritting Better Software
Writting Better Softwaresvilen.ivanov
 
Software Product Line Analysis and Detection of Clones
Software Product Line Analysis and Detection of ClonesSoftware Product Line Analysis and Detection of Clones
Software Product Line Analysis and Detection of ClonesRSIS International
 
Realization of natural language interfaces using
Realization of natural language interfaces usingRealization of natural language interfaces using
Realization of natural language interfaces usingunyil96
 
Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++ijseajournal
 
On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)Benoit Combemale
 
The Exploitation of OpenAPI Documents for the Generation of Web Frontends
The Exploitation of OpenAPI Documents for the Generation of Web FrontendsThe Exploitation of OpenAPI Documents for the Generation of Web Frontends
The Exploitation of OpenAPI Documents for the Generation of Web FrontendsIstvanKoren
 
Eventual Consistency - Du musst keine Angst haben
Eventual Consistency - Du musst keine Angst habenEventual Consistency - Du musst keine Angst haben
Eventual Consistency - Du musst keine Angst habenSusanne Braun
 

Similar to Empirical study of programming to an interface (20)

Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
 
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
IDENTIFICATION OF PROMOTED ECLIPSE UNSTABLE INTERFACES USING CLONE DETECTION ...
 
Icpc16.ppt
Icpc16.pptIcpc16.ppt
Icpc16.ppt
 
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...
2012 ieee projects software engineering @ Seabirds ( Trichy, Chennai, Pondich...
 
Replication and Benchmarking in Software Analytics
Replication and Benchmarking in Software AnalyticsReplication and Benchmarking in Software Analytics
Replication and Benchmarking in Software Analytics
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel Grichi
 
OOP 2021 - Eventual Consistency - Du musst keine Angst haben
OOP 2021 - Eventual Consistency - Du musst keine Angst habenOOP 2021 - Eventual Consistency - Du musst keine Angst haben
OOP 2021 - Eventual Consistency - Du musst keine Angst haben
 
Software Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionSoftware Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesion
 
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...178 - A replicated study on duplicate detection: Using Apache Lucene to searc...
178 - A replicated study on duplicate detection: Using Apache Lucene to searc...
 
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveModel-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight Executive
 
Automated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from ModelsAutomated Test Case Generation and Execution from Models
Automated Test Case Generation and Execution from Models
 
Writting Better Software
Writting Better SoftwareWritting Better Software
Writting Better Software
 
Software Product Line Analysis and Detection of Clones
Software Product Line Analysis and Detection of ClonesSoftware Product Line Analysis and Detection of Clones
Software Product Line Analysis and Detection of Clones
 
Realization of natural language interfaces using
Realization of natural language interfaces usingRealization of natural language interfaces using
Realization of natural language interfaces using
 
FuzzyDbg_Report.pdf
FuzzyDbg_Report.pdfFuzzyDbg_Report.pdf
FuzzyDbg_Report.pdf
 
Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++Is fortran still relevant comparing fortran with java and c++
Is fortran still relevant comparing fortran with java and c++
 
On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)
 
The Exploitation of OpenAPI Documents for the Generation of Web Frontends
The Exploitation of OpenAPI Documents for the Generation of Web FrontendsThe Exploitation of OpenAPI Documents for the Generation of Web Frontends
The Exploitation of OpenAPI Documents for the Generation of Web Frontends
 
Eventual Consistency - Du musst keine Angst haben
Eventual Consistency - Du musst keine Angst habenEventual Consistency - Du musst keine Angst haben
Eventual Consistency - Du musst keine Angst haben
 

Recently uploaded

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
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
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
(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
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Recently uploaded (20)

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
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...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
(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...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Empirical study of programming to an interface

  • 1. EMPIRICAL STUDY OF PROGRAMMING TOEMPIRICAL STUDY OF PROGRAMMING TO AN INTERFACEAN INTERFACE B. Verhaeghe1, Christopher Fuhrman2, L. Guerrouj2, N. Anquetil3 and S. Ducasse4 1Berger-Levrault, France 2École de technologie supérieure, Montreal, Canada 3University of Lille, CRIStAL 4RMoD - Inria Nord Europe    1 Empirical study of programming to an interface 
  • 2. MOTIVATIONMOTIVATION Heuristic from Design Patterns book (GoF 1994). Clients are less fragile if implementations change. We have been teaching this to students for decades, but is there any empirical evidence to support it? “Program to an interface, not an implementation.” 2 Empirical study of programming to an interface 
  • 3. RELATED PRINCIPLESRELATED PRINCIPLES Protected Variation (C. Larman) Open-Closed Principle (B. Meyer) Information Hiding (D. Parnas) 3 Empirical study of programming to an interface 
  • 4. WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE Beginner design in Java Client «interface» List ArrayList TreeList Coupling to implementation ArrayList myList = new ArrayList(); 4 . 1 Empirical study of programming to an interface 
  • 5. WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE Improved design… Client «interface» List ArrayList TreeList Coupling to interface «creates» Coupling to implementation List myList = new ArrayList(); 4 . 2 Empirical study of programming to an interface 
  • 6. WHAT IT LOOKS LIKEWHAT IT LOOKS LIKE Factory design decouples client from implementation Client «interface» List ArrayList TreeList ListFactory Coupling to interface creates creates uses List myList = ListFactory.create("..."); 4 . 3 Empirical study of programming to an interface 
  • 7. CONSEQUENCES OF PTICONSEQUENCES OF PTI Protect clients changing implementation(s) Favor extensions to implementations Simplify the API, overcome single-inheritance limitation Speculative Generality (code smell) Additional level of hierarchy Factories decouple clients from implementations Changed interface breaks clients and implementations 5 Empirical study of programming to an interface 
  • 8. EMPIRICAL STUDY OF THE CONSEQUENCESEMPIRICAL STUDY OF THE CONSEQUENCES Human studies: qualities such as understandability, ease of extensibility, etc. Observational studies: Code repositories to see if client code is protected (change propagation), fault location, etc. 6 Empirical study of programming to an interface 
  • 9. OBSERVATIONAL STUDY: PROTECTED VARIATIONOBSERVATIONAL STUDY: PROTECTED VARIATION Cochange in Java projects (GitHub) Static analysis identi es cochange pairs (client, implementation) Unprotected pairs (direct coupling) Protected pairs (no coupling) Client A Client B «interface» ISomething Implementation 7 . 1 Empirical study of programming to an interface 
  • 10. RESEARCH QUESTIONRESEARCH QUESTION Do unprotected pairs cochange more often than protected pairs? Client A Client B «interface» ISomething Implementation 7 . 2 Empirical study of programming to an interface 
  • 11. COCHANGE HISTORYCOCHANGE HISTORY H is the history of commits. Cochanged Protected Dependencies ratio CPD(%) = |H∩P| |P| Cochanged Unprotected Dependencies ratio CUD(%) = |H∩U| |U| . 7 . 3 Empirical study of programming to an interface 
  • 12. RESULTSRESULTS 126 (popular) Java projects on GitHub Ratios of CPD and CUD p < 0.001 and effect size (Cliff’s) d = 0.32 (small) 7 . 4 Empirical study of programming to an interface 
  • 13. FUTURE WORKFUTURE WORK Observational studies with more context Classify projects (abstractness) Microarchitectures (e.g., factories) Natural experiments for quality aspects 8 Empirical study of programming to an interface 