SlideShare a Scribd company logo
CSMR’13
A New Family of Software Anti-Patterns:
Linguistic Anti-Patterns
Venera Arnaoudova1, Massimiliano Di Penta2, Giuliano
Antoniol1,Yann-Gaël Guéhéneuc1
1 École Polytechnique de Montréal, Canada
2 University of Sannio, Benevento, Italy
1
Venera Arnaoudova CSMR’13
Families of
Patterns/Anti-Patterns
• Patterns, e.g., Design
• Anti-Patterns, e.g., Software Development
2
Venera Arnaoudova CSMR’13
Source code lexicon
• What do we know?
• We should strive for good quality lexicon
• How is quality of the lexicon measured?
• English words, domain terms
• Abbreviations, acronyms
i.e. vocabulary of your code
3
[Takang et al., ’96], [Deissenbock and Pizka, ’05], [Lawrie et al., ’07], [Abebe et al., ’09]
Venera Arnaoudova CSMR’13
• Consider method:
public ??? setBreadth(Dimension target, int source){ ??? }
• What is it’s return type?
• What is it’s implementation?
What does it do?
public void setBreadth(Dimension target, int source){
target.setBreadth(source);
}
Expecting:
Receiving: public Dimension setBreadth(Dimension target, int source) {
if (orientation == VERTICAL)
return new Dimension(source, (int)target.getHeight());
else return new Dimension((int)target.getWidth(), source);
}
4
Venera Arnaoudova CSMR’13
• Consider method:
public ??? setBreadth(Dimension target, int source){ ??? }
• What is it’s return type?
• What is it’s implementation?
public void setBreadth(Dimension target, int source){
target.setBreadth(source);
}
Expecting:
Receiving: public Dimension setBreadth(Dimension target, int source) {
if (orientation == VERTICAL)
return new Dimension(source, (int)target.getHeight());
else return new Dimension((int)target.getWidth(), source);
}
4
Does more than it says
Venera Arnaoudova CSMR’13
What does it do?
Consider method:
public ??? isClassPathCorrect(wellKnownType, compUnitDecl){ ??? }
• What is it’s return type?
• What is it’s implementation?
public boolean isClassPathCorrect(..){
if(..){return true; else {return false;}
}
Expecting:
Receiving: public void isClassPathCorrect(wellKnownType, compUnitDecl) {
referenceContext = compUnitDecl;
this.handle(..);
}
5
Venera Arnaoudova CSMR’13
Consider method:
public ??? isClassPathCorrect(wellKnownType, compUnitDecl){ ??? }
• What is it’s return type?
• What is it’s implementation?
public boolean isClassPathCorrect(..){
if(..){return true; else {return false;}
}
Expecting:
Receiving: public void isClassPathCorrect(wellKnownType, compUnitDecl) {
referenceContext = compUnitDecl;
this.handle(..);
}
5
Says more than it does
Venera Arnaoudova CSMR’13
What does it contain?
• Consider attribute:
private static ??? stats
• What is it’s declared type?
• What is it’s purpose?
private static int[] stats // some statistics..Expecting:
Receiving: private static boolean stats = true;
6
Venera Arnaoudova CSMR’13
• Consider attribute:
private static ??? stats
• What is it’s declared type?
• What is it’s purpose?
private static int[] stats // some statistics..Expecting:
Receiving: private static boolean stats = true;
6
Says more than it contains
Venera Arnaoudova CSMR’13
Linguistic Anti-Patterns
• LAs: Recurring poor practices in the
naming, documentation and choice of
identifiers in the implementation.
• Different families
• One such family is related to
inconsistencies:
7
Venera Arnaoudova CSMR’13
• Inconsistency between a program entity’s
• documentation (i.e., comments)
• name
• behaviour (type, implementation)
8
Inconsistency LAs
Venera Arnaoudova CSMR’13
Inconsistency LAs
Does more than it says
Says more than it does
Does the opposite than it says
Contains more than it says
Says more than it contains
Contains the opposite than it says
Behaviour
State
9
Dimension setBreadth(..)
void isClassPathCorrect(..)
ControlEnableState disable(..)
int[] isReached
boolean _stats
//.. default exclude pattern..
INCLUDE_NAME_DEFAULT
Others trust what you say!
Venera Arnaoudova CSMR’13
Does more than it says
Says more than it does
Does the opposite
Behaviour
“Get” - more than an accessor
“Is” returns more than a Boolean
“Set” method returns
Expecting but not getting a single instance
Inconsistency LAs
10
Others trust what you say!
Venera Arnaoudova CSMR’13
Does more than it says
Says more than it does
Does the opposite
Validation method does not confirm
“Get” method does not return
Not implemented condition
Not answered question
Transform method does not return
Expecting but not getting a collection
Behaviour
Inconsistency LAs
11
Others trust what you say!
Venera Arnaoudova CSMR’13
Does more than it says
Says more than it does
Does the opposite
Method signature and comment are opposite
Method name and return type are opposite
Behaviour
Inconsistency LAs
12
Others trust what you say!
Venera Arnaoudova CSMR’13
Contains more than it says
Says more than it contains
Name suggests Boolean but type does not
Says one but contains many
Says many but contains one
Attribute signature and comment are opposite
Attribute name and type are opposite
Inconsistency LAs
State
13
Others trust what you say!
Contains the opposite
Venera Arnaoudova CSMR’13
Study
• Prototype detector: LAPD
• RQ:To what extent LAs exist?
• Context: System Version Methods Attributes
ArgoUML
0.10.1 5 K 3 K
ArgoUML
0.34 11 K 6 K
Cocoon 2.2.0 4 K 3 K
Eclipse 1.0 36 K 22 K
14
Venera Arnaoudova CSMR’13
Inconsistency LAs
Does more than it says
Do they exist?
Says more than it does
Does the opposite than it says
Contains more than it says
Says more than it contains
Contains the opposite than it says
Behaviour
State
Detected
wrt the
population
194 0.35%
1016 1.82%
288 0.52%
Detected
wrt the
population
438 1.3%
302 0.89%
24 0.07%
15
Venera Arnaoudova CSMR’13
Inconsistency LAs
Does more than it says
Says more than it does
Does the opposite than it says
Contains more than it says
Says more than it contains
Contains the opposite than it says
Behaviour
State
Precision
88%
85%
12%
Precision
57%
75%
13%
16
Confidence: 95% ±10%
Venera Arnaoudova CSMR’13
To summarize
• Defined Inconsistency LAs
• Prototype detection tool - LAPD
• 72% precision
• Inconsistency LAs represent 5% of the
studied systems
17
Venera Arnaoudova CSMR’13
Why do we care?
• What can go wrong with LAs:
• Useless time and effort spent to
understand source code
• Wrong assumptions
• Being aware they exist is the first step...
18
Venera Arnaoudova CSMR’13
The next step
• Opinion of developers
• Study the impact
• Solutions
19
Venera Arnaoudova CSMR’13
Inconsistency LAs
Does more than it says
Says more than it does
Does the opposite than it says
Contains more than it says
Says more than it contains
Contains the opposite than it says
Behaviour
State
20
void getMethodBodies(..)
int isValid()
ControlEnableState disable(..)
int[] isReached
boolean _stats
//.. default exclude pattern..
INCLUDE_NAME_DEFAULT
What do you think?

More Related Content

Similar to Csmr13d.ppt

Software Repositories for Research-- An Environmental Scan
Software Repositories for Research-- An Environmental ScanSoftware Repositories for Research-- An Environmental Scan
Software Repositories for Research-- An Environmental ScanMicah Altman
 
7 Citations and References
7 Citations and References7 Citations and References
7 Citations and ReferencesSusha Das
 
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in Malware
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in MalwareMeasuring the Speed of the Red Queen's Race; Adaption and Evasion in Malware
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in MalwarePriyanka Aash
 
Improving Your Literature Reviews with NVivo 10 for Windows
Improving Your Literature Reviews with NVivo 10 for WindowsImproving Your Literature Reviews with NVivo 10 for Windows
Improving Your Literature Reviews with NVivo 10 for WindowsQSR International
 
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...Nathan Dunn
 
Scholarly indentity: Distinguish yourself and your research
Scholarly indentity: Distinguish yourself and your researchScholarly indentity: Distinguish yourself and your research
Scholarly indentity: Distinguish yourself and your researchDiane Clark
 
The noun phrase introducers of npChapter 4the noun phr.docx
The noun phrase  introducers of npChapter 4the noun phr.docxThe noun phrase  introducers of npChapter 4the noun phr.docx
The noun phrase introducers of npChapter 4the noun phr.docxarnoldmeredith47041
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language ProcessingPranav Gupta
 
Intro for asm workshop see
Intro for asm workshop seeIntro for asm workshop see
Intro for asm workshop seemelnhe
 
Welch Wordifier Bosc2009
Welch Wordifier Bosc2009Welch Wordifier Bosc2009
Welch Wordifier Bosc2009bosc
 
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...geraintduck
 
Genetic Malware
Genetic MalwareGenetic Malware
Genetic MalwareOkta
 
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...Franz et al ice 2016 addressing the name meaning drift challenge in open ende...
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...taxonbytes
 
Data Science Course In Pune
Data Science Course In Pune Data Science Course In Pune
Data Science Course In Pune APT
 
data science institute in bangalore
data science institute in bangaloredata science institute in bangalore
data science institute in bangaloredevipatnala1
 
Data Science Course Pune
Data Science Course PuneData Science Course Pune
Data Science Course PuneAPT
 
Data science course pdf
Data science course pdfData science course pdf
Data science course pdfAPT
 
Data Science course in Pune
Data Science course in PuneData Science course in Pune
Data Science course in Puneashvisingh
 
data science certification
data science certificationdata science certification
data science certificationdevipatnala1
 

Similar to Csmr13d.ppt (20)

Software Repositories for Research-- An Environmental Scan
Software Repositories for Research-- An Environmental ScanSoftware Repositories for Research-- An Environmental Scan
Software Repositories for Research-- An Environmental Scan
 
7 Citations and References
7 Citations and References7 Citations and References
7 Citations and References
 
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in Malware
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in MalwareMeasuring the Speed of the Red Queen's Race; Adaption and Evasion in Malware
Measuring the Speed of the Red Queen's Race; Adaption and Evasion in Malware
 
Improving Your Literature Reviews with NVivo 10 for Windows
Improving Your Literature Reviews with NVivo 10 for WindowsImproving Your Literature Reviews with NVivo 10 for Windows
Improving Your Literature Reviews with NVivo 10 for Windows
 
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...
Genome annotation with open source software: Apollo, Jbrowse and the GO in Ga...
 
Scholarly indentity: Distinguish yourself and your research
Scholarly indentity: Distinguish yourself and your researchScholarly indentity: Distinguish yourself and your research
Scholarly indentity: Distinguish yourself and your research
 
The noun phrase introducers of npChapter 4the noun phr.docx
The noun phrase  introducers of npChapter 4the noun phr.docxThe noun phrase  introducers of npChapter 4the noun phr.docx
The noun phrase introducers of npChapter 4the noun phr.docx
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processing
 
Intro for asm workshop see
Intro for asm workshop seeIntro for asm workshop see
Intro for asm workshop see
 
Welch Wordifier Bosc2009
Welch Wordifier Bosc2009Welch Wordifier Bosc2009
Welch Wordifier Bosc2009
 
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...
SMBM 2012: Ambiguity and Variability of Database and Software Names in Bioinf...
 
Genetic Malware
Genetic MalwareGenetic Malware
Genetic Malware
 
Genetic Malware
Genetic MalwareGenetic Malware
Genetic Malware
 
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...Franz et al ice 2016 addressing the name meaning drift challenge in open ende...
Franz et al ice 2016 addressing the name meaning drift challenge in open ende...
 
Data Science Course In Pune
Data Science Course In Pune Data Science Course In Pune
Data Science Course In Pune
 
data science institute in bangalore
data science institute in bangaloredata science institute in bangalore
data science institute in bangalore
 
Data Science Course Pune
Data Science Course PuneData Science Course Pune
Data Science Course Pune
 
Data science course pdf
Data science course pdfData science course pdf
Data science course pdf
 
Data Science course in Pune
Data Science course in PuneData Science course in Pune
Data Science course in Pune
 
data science certification
data science certificationdata science certification
data science certification
 

More from Yann-Gaël Guéhéneuc

Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Yann-Gaël Guéhéneuc
 
Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Yann-Gaël Guéhéneuc
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Yann-Gaël Guéhéneuc
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Yann-Gaël Guéhéneuc
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Yann-Gaël Guéhéneuc
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Yann-Gaël Guéhéneuc
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...Yann-Gaël Guéhéneuc
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesYann-Gaël Guéhéneuc
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Yann-Gaël Guéhéneuc
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1Yann-Gaël Guéhéneuc
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6Yann-Gaël Guéhéneuc
 

More from Yann-Gaël Guéhéneuc (20)

Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0
 
Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its Consequences
 
Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
 
Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6
 
ICSOC'21
ICSOC'21ICSOC'21
ICSOC'21
 
Vissoft21.ppt
Vissoft21.pptVissoft21.ppt
Vissoft21.ppt
 
Service computation20.ppt
Service computation20.pptService computation20.ppt
Service computation20.ppt
 
Serp4 iot20.ppt
Serp4 iot20.pptSerp4 iot20.ppt
Serp4 iot20.ppt
 
Msr20.ppt
Msr20.pptMsr20.ppt
Msr20.ppt
 
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Iwesep19.ppt
 
Icsoc20.ppt
Icsoc20.pptIcsoc20.ppt
Icsoc20.ppt
 

Recently uploaded

top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownloadvrstrong314
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandIES VE
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessWSO2
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion Clinic
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of ProgrammingMatt Welsh
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsGlobus
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisNeo4j
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfMeon Technology
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILNatan Silnitsky
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024Ortus Solutions, Corp
 

Recently uploaded (20)

top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 

Csmr13d.ppt

  • 1. CSMR’13 A New Family of Software Anti-Patterns: Linguistic Anti-Patterns Venera Arnaoudova1, Massimiliano Di Penta2, Giuliano Antoniol1,Yann-Gaël Guéhéneuc1 1 École Polytechnique de Montréal, Canada 2 University of Sannio, Benevento, Italy 1
  • 2. Venera Arnaoudova CSMR’13 Families of Patterns/Anti-Patterns • Patterns, e.g., Design • Anti-Patterns, e.g., Software Development 2
  • 3. Venera Arnaoudova CSMR’13 Source code lexicon • What do we know? • We should strive for good quality lexicon • How is quality of the lexicon measured? • English words, domain terms • Abbreviations, acronyms i.e. vocabulary of your code 3 [Takang et al., ’96], [Deissenbock and Pizka, ’05], [Lawrie et al., ’07], [Abebe et al., ’09]
  • 4. Venera Arnaoudova CSMR’13 • Consider method: public ??? setBreadth(Dimension target, int source){ ??? } • What is it’s return type? • What is it’s implementation? What does it do? public void setBreadth(Dimension target, int source){ target.setBreadth(source); } Expecting: Receiving: public Dimension setBreadth(Dimension target, int source) { if (orientation == VERTICAL) return new Dimension(source, (int)target.getHeight()); else return new Dimension((int)target.getWidth(), source); } 4
  • 5. Venera Arnaoudova CSMR’13 • Consider method: public ??? setBreadth(Dimension target, int source){ ??? } • What is it’s return type? • What is it’s implementation? public void setBreadth(Dimension target, int source){ target.setBreadth(source); } Expecting: Receiving: public Dimension setBreadth(Dimension target, int source) { if (orientation == VERTICAL) return new Dimension(source, (int)target.getHeight()); else return new Dimension((int)target.getWidth(), source); } 4 Does more than it says
  • 6. Venera Arnaoudova CSMR’13 What does it do? Consider method: public ??? isClassPathCorrect(wellKnownType, compUnitDecl){ ??? } • What is it’s return type? • What is it’s implementation? public boolean isClassPathCorrect(..){ if(..){return true; else {return false;} } Expecting: Receiving: public void isClassPathCorrect(wellKnownType, compUnitDecl) { referenceContext = compUnitDecl; this.handle(..); } 5
  • 7. Venera Arnaoudova CSMR’13 Consider method: public ??? isClassPathCorrect(wellKnownType, compUnitDecl){ ??? } • What is it’s return type? • What is it’s implementation? public boolean isClassPathCorrect(..){ if(..){return true; else {return false;} } Expecting: Receiving: public void isClassPathCorrect(wellKnownType, compUnitDecl) { referenceContext = compUnitDecl; this.handle(..); } 5 Says more than it does
  • 8. Venera Arnaoudova CSMR’13 What does it contain? • Consider attribute: private static ??? stats • What is it’s declared type? • What is it’s purpose? private static int[] stats // some statistics..Expecting: Receiving: private static boolean stats = true; 6
  • 9. Venera Arnaoudova CSMR’13 • Consider attribute: private static ??? stats • What is it’s declared type? • What is it’s purpose? private static int[] stats // some statistics..Expecting: Receiving: private static boolean stats = true; 6 Says more than it contains
  • 10. Venera Arnaoudova CSMR’13 Linguistic Anti-Patterns • LAs: Recurring poor practices in the naming, documentation and choice of identifiers in the implementation. • Different families • One such family is related to inconsistencies: 7
  • 11. Venera Arnaoudova CSMR’13 • Inconsistency between a program entity’s • documentation (i.e., comments) • name • behaviour (type, implementation) 8 Inconsistency LAs
  • 12. Venera Arnaoudova CSMR’13 Inconsistency LAs Does more than it says Says more than it does Does the opposite than it says Contains more than it says Says more than it contains Contains the opposite than it says Behaviour State 9 Dimension setBreadth(..) void isClassPathCorrect(..) ControlEnableState disable(..) int[] isReached boolean _stats //.. default exclude pattern.. INCLUDE_NAME_DEFAULT Others trust what you say!
  • 13. Venera Arnaoudova CSMR’13 Does more than it says Says more than it does Does the opposite Behaviour “Get” - more than an accessor “Is” returns more than a Boolean “Set” method returns Expecting but not getting a single instance Inconsistency LAs 10 Others trust what you say!
  • 14. Venera Arnaoudova CSMR’13 Does more than it says Says more than it does Does the opposite Validation method does not confirm “Get” method does not return Not implemented condition Not answered question Transform method does not return Expecting but not getting a collection Behaviour Inconsistency LAs 11 Others trust what you say!
  • 15. Venera Arnaoudova CSMR’13 Does more than it says Says more than it does Does the opposite Method signature and comment are opposite Method name and return type are opposite Behaviour Inconsistency LAs 12 Others trust what you say!
  • 16. Venera Arnaoudova CSMR’13 Contains more than it says Says more than it contains Name suggests Boolean but type does not Says one but contains many Says many but contains one Attribute signature and comment are opposite Attribute name and type are opposite Inconsistency LAs State 13 Others trust what you say! Contains the opposite
  • 17. Venera Arnaoudova CSMR’13 Study • Prototype detector: LAPD • RQ:To what extent LAs exist? • Context: System Version Methods Attributes ArgoUML 0.10.1 5 K 3 K ArgoUML 0.34 11 K 6 K Cocoon 2.2.0 4 K 3 K Eclipse 1.0 36 K 22 K 14
  • 18. Venera Arnaoudova CSMR’13 Inconsistency LAs Does more than it says Do they exist? Says more than it does Does the opposite than it says Contains more than it says Says more than it contains Contains the opposite than it says Behaviour State Detected wrt the population 194 0.35% 1016 1.82% 288 0.52% Detected wrt the population 438 1.3% 302 0.89% 24 0.07% 15
  • 19. Venera Arnaoudova CSMR’13 Inconsistency LAs Does more than it says Says more than it does Does the opposite than it says Contains more than it says Says more than it contains Contains the opposite than it says Behaviour State Precision 88% 85% 12% Precision 57% 75% 13% 16 Confidence: 95% ±10%
  • 20. Venera Arnaoudova CSMR’13 To summarize • Defined Inconsistency LAs • Prototype detection tool - LAPD • 72% precision • Inconsistency LAs represent 5% of the studied systems 17
  • 21. Venera Arnaoudova CSMR’13 Why do we care? • What can go wrong with LAs: • Useless time and effort spent to understand source code • Wrong assumptions • Being aware they exist is the first step... 18
  • 22. Venera Arnaoudova CSMR’13 The next step • Opinion of developers • Study the impact • Solutions 19
  • 23. Venera Arnaoudova CSMR’13 Inconsistency LAs Does more than it says Says more than it does Does the opposite than it says Contains more than it says Says more than it contains Contains the opposite than it says Behaviour State 20 void getMethodBodies(..) int isValid() ControlEnableState disable(..) int[] isReached boolean _stats //.. default exclude pattern.. INCLUDE_NAME_DEFAULT What do you think?