On the Analysis of Co-occurrence of
Anti-patterns and Clones
Fehmi Jaafar, Angela Lozano, Yann-Gaël Guéhéneuc,
and Kim Mens
The Department of Information Systems Security and Assurance at Concordia
University of Edmonton, Alberta, Canada
E-mail: jaafar@ubitrak.com
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 1
Plan
1. Smells in software systems
2. Percentage of classes participating in anti-
patterns and clones?
3. Smells co-occurrence and fault-proneness
4. Conclusion
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 2
Smells in software system
• A smell is a part of a software system’s source code with a poor
quality and that may indicate a deeper problem.
• "bad structures in the code that suggest the possibility of
refactoring”.
M. Fowler, Refactoring: Improving the design of existing code. International Thomson Computer Press, 1999.
• Indicators of a poor quality of a source code with respect to
reusability, maintainability, and efficiency.
M. Mantyla, J. Vanhanen, and C. Lassenius, “A taxonomy and an initial empirical study of bad smells in code,” in Software Maintenance, 2003.
ICSM 2003.
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 3
Example of code smells: Clones
• Code Clones or Duplicate Code is a computer programming term for a
sequence of source code that occurs more than once, within a program or
across different programs owned or maintained by the same entity.
• Duplicate code is generally considered undesirable for a number of
reasons:
1. A mark of poor or lazy programming style
2. They deteriorate the changeability of a source code: if a clone needs to
be maintained, we shall propagate the maintenance changes to the rest
of duplicated instances.
3. Unintentionally incomplete changes and bugs
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 4
• There are mainly three types of code clones defined by the
researchers based on textual similarity:
1. Type-1 clones are identical code fragments but may have some
variations in whitespace, layout and comments. They are also
known as identical clones.
2. Type-2 clones are syntactically equivalent fragments with some
variations in identifiers, literals, types, whitespace, layout and
comments.
3. Type-3 clones could include all the changes of Type-1/Type-2 clones
with further modifications such as changed, added or removed
statements
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 5
Example of code smells: Clones
• Design defects that describe bad solutions to recurring design.
• Previous work have reported that the existence of anti-patterns in a
software source code co-occurred with a high probability of change
and fault-proneness.
• The maintenance activities of a the software system became more
complicated and difficult.
F. Khomh, M. D. Penta, Y.-G. Gueheneuc, and G. Antoniol, “An exploratory study of the impact of antipatterns on class change and fault
proneness,” Empirical Software Engineering, 2012.
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns
Example of design smells: Anti-patterns
6
• Blob: where one class monopolizes the processing, and a set of
related classes save the data. Thus, features are implemented in just
one class.
• SpaghettiCode: if a class contains or implies a procedural structure
(instead of an object-oriented structure): A limited number of classes
with large methods and that includes a single, multistage process
flow.
• Anti-patterns make the software system very difficult to update or to
reuse, and thus, increases the maintenance cost.
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 7
Example of design smells: Anti-patterns
Smells interference
• It was not clear from previous work if the interference of these smells could
increase or decrease the risk of faults.
• An empirical study to analyze the resulting impact of the interference of these
code smells on fault-proneness.
• Provide empirical evidences of co-occurrences of two different smells indicating
two different problems: duplicating code and poor design.
• RQ1: What is the percentage of classes participating in anti-patterns and
clones? quantitative data on the number of cases with which anti-patterns and
clones occur and co-occur in the releases of the studied systems.
• RQ2: What is the impact on fault-proneness for a class that participates in
anti-patterns and clones? co-occurrence of anti-patterns and clones is related
to higher or lower fault-proneness?
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 8
Approach
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 9
What is the percentage of classes participating
in anti-patterns and clones?
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 10
1. Having clones and anti-patterns is a very frequent observation: at least, more
than 52% of anti-pattern classes have clones, while 59% to 78% of classes with
clones are participating in anti-patterns.
2. No evidences of a relationship between the sizes of software systems and the
proportion of clones and anti-patterns detected in their source codes.
3. Clones represent more than 50% of Azureus, Eclipse, and JHotDraw. This
confirms the observation of Baker and Ducasse: clones exist at rates of over
50% of Cobol and C systems.
4. We notice that the anti-patterns that are large by default, i.e., Blob,
LongMethod, LongParameterList, and LargeClass do not have a much larger
percentage of internal clones.
5. Contrary to intuition, anti-patterns resulting in large classes are not the most
affected by clones.
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 11
What is the percentage of classes participating
in anti-patterns and clones?
What is the impact on fault-proneness for a class
that participates in anti-patterns and clones?
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 12
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 13
1. Classes having clones and anti-patterns are significantly more fault-prone than other
classes.
2. In Eclipse, we observed that the risk for a class to be fault-prone if it has a co-
occurrence of clone and anti-pattern is at least 7 times higher than a class that hasn’t
neither a co-occurrence of clone and anti-pattern.
3. Moreover, this risk is higher than a class that has just an occurrence of an anti-pattern
and higher than a class that has just an occurrence of a clone.
4. Cloned code are only co-changed with a set of classes that involve their clones or with a
set of classes without their clones in the system, but never with both of sets.
What is the impact on fault-proneness for a class
that participates in anti-patterns and clones?
Conclusion and future work
Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 14
• Having clones and anti-patterns is a very frequent observation in
software systems.
• Classes having clones and anti-patterns are significantly more fault-
prone than other classes.
• Other observations open the door for further investigations to predict
changes, inconsistent changes, and late prorogation changes among
clones, and by consequence, avoid fault induction during the
maintenance of software systems.

More Related Content

PDF
Ppap13a.ppt
PDF
PDF
Csmr13c.ppt
PDF
130404 fehmi jaafar - on the relationship between program evolution and fau...
PDF
Wcre2009 bettenburg
PDF
Most Influential Paper - SANER 2017
PDF
PPTX
toxic commnets classification using python
Ppap13a.ppt
Csmr13c.ppt
130404 fehmi jaafar - on the relationship between program evolution and fau...
Wcre2009 bettenburg
Most Influential Paper - SANER 2017
toxic commnets classification using python

Similar to Qrs17b.ppt (20)

PDF
Immediate download Plant Immunity Methods and Protocols 1st Edition Patrick C...
PDF
Biological models of security for virus propagation in computer networks
PDF
WCRE09a.ppt
PDF
Secure and Reliable Data Transmission in Generalized E-Mail
PDF
Does Refactoring of Test Smells Induce Fixing Flaky Tests?
PDF
Biological aspects of computer virology
PDF
FUNCTIONAL OVER-RELATED CLASSES BAD SMELL DETECTION AND REFACTORING SUGGESTIONS
PDF
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
PDF
Functional over related classes bad smell detection and refactoring suggestions
PPTX
Three's a crowd-source: Observations on Collaborative Genome Annotation
PDF
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
PDF
Thesis+of+fehmi+jaafar.ppt
PDF
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
PDF
A Survey On Plagiarism Detection
PDF
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
PPT
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
PDF
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
PDF
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
PDF
CSMR11a.ppt
PPTX
hate speech detection system using machine learning
Immediate download Plant Immunity Methods and Protocols 1st Edition Patrick C...
Biological models of security for virus propagation in computer networks
WCRE09a.ppt
Secure and Reliable Data Transmission in Generalized E-Mail
Does Refactoring of Test Smells Induce Fixing Flaky Tests?
Biological aspects of computer virology
FUNCTIONAL OVER-RELATED CLASSES BAD SMELL DETECTION AND REFACTORING SUGGESTIONS
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
Functional over related classes bad smell detection and refactoring suggestions
Three's a crowd-source: Observations on Collaborative Genome Annotation
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
Thesis+of+fehmi+jaafar.ppt
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
A Survey On Plagiarism Detection
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
Lessons Learned from Teaching Intrusion Detection and Intrusion Prevention wi...
Plant Immunity Methods and Protocols 1st Edition Patrick Cournoyer
Comparing Reuse Mechanisms for Model Transformation Languages: Design for an ...
CSMR11a.ppt
hate speech detection system using machine learning
Ad

More from Ptidej Team (20)

PDF
From IoT to Software Miniaturisation
PDF
Presentation
PDF
Presentation
PDF
Presentation
PDF
Presentation by Lionel Briand
PDF
Manel Abdellatif
PDF
Azadeh Kermansaravi
PDF
Mouna Abidi
PDF
CSED - Manel Grichi
PDF
Cristiano Politowski
PDF
Will io t trigger the next software crisis
PDF
PDF
Thesis+of+laleh+eshkevari.ppt
PDF
Thesis+of+nesrine+abdelkafi.ppt
PDF
Medicine15.ppt
PDF
Icpc11c.ppt
PDF
Icsme16.ppt
PDF
Msr17a.ppt
PDF
Icsoc15.ppt
PDF
Thesis+of+étienne+duclos.ppt
From IoT to Software Miniaturisation
Presentation
Presentation
Presentation
Presentation by Lionel Briand
Manel Abdellatif
Azadeh Kermansaravi
Mouna Abidi
CSED - Manel Grichi
Cristiano Politowski
Will io t trigger the next software crisis
Thesis+of+laleh+eshkevari.ppt
Thesis+of+nesrine+abdelkafi.ppt
Medicine15.ppt
Icpc11c.ppt
Icsme16.ppt
Msr17a.ppt
Icsoc15.ppt
Thesis+of+étienne+duclos.ppt
Ad

Recently uploaded (20)

PDF
Types of Token_ From Utility to Security.pdf
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PPTX
Cybersecurity: Protecting the Digital World
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
assetexplorer- product-overview - presentation
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
Cost to Outsource Software Development in 2025
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Microsoft Office 365 Crack Download Free
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Types of Token_ From Utility to Security.pdf
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Topaz Photo AI Crack New Download (Latest 2025)
Salesforce Agentforce AI Implementation.pdf
CCleaner 6.39.11548 Crack 2025 License Key
Cybersecurity: Protecting the Digital World
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Computer Software and OS of computer science of grade 11.pptx
assetexplorer- product-overview - presentation
Weekly report ppt - harsh dattuprasad patel.pptx
Cost to Outsource Software Development in 2025
Wondershare Recoverit Full Crack New Version (Latest 2025)
Designing Intelligence for the Shop Floor.pdf
iTop VPN Crack Latest Version Full Key 2025
MCP Security Tutorial - Beginner to Advanced
Microsoft Office 365 Crack Download Free
AI/ML Infra Meetup | LLM Agents and Implementation Challenges

Qrs17b.ppt

  • 1. On the Analysis of Co-occurrence of Anti-patterns and Clones Fehmi Jaafar, Angela Lozano, Yann-Gaël Guéhéneuc, and Kim Mens The Department of Information Systems Security and Assurance at Concordia University of Edmonton, Alberta, Canada E-mail: jaafar@ubitrak.com Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 1
  • 2. Plan 1. Smells in software systems 2. Percentage of classes participating in anti- patterns and clones? 3. Smells co-occurrence and fault-proneness 4. Conclusion Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 2
  • 3. Smells in software system • A smell is a part of a software system’s source code with a poor quality and that may indicate a deeper problem. • "bad structures in the code that suggest the possibility of refactoring”. M. Fowler, Refactoring: Improving the design of existing code. International Thomson Computer Press, 1999. • Indicators of a poor quality of a source code with respect to reusability, maintainability, and efficiency. M. Mantyla, J. Vanhanen, and C. Lassenius, “A taxonomy and an initial empirical study of bad smells in code,” in Software Maintenance, 2003. ICSM 2003. Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 3
  • 4. Example of code smells: Clones • Code Clones or Duplicate Code is a computer programming term for a sequence of source code that occurs more than once, within a program or across different programs owned or maintained by the same entity. • Duplicate code is generally considered undesirable for a number of reasons: 1. A mark of poor or lazy programming style 2. They deteriorate the changeability of a source code: if a clone needs to be maintained, we shall propagate the maintenance changes to the rest of duplicated instances. 3. Unintentionally incomplete changes and bugs Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 4
  • 5. • There are mainly three types of code clones defined by the researchers based on textual similarity: 1. Type-1 clones are identical code fragments but may have some variations in whitespace, layout and comments. They are also known as identical clones. 2. Type-2 clones are syntactically equivalent fragments with some variations in identifiers, literals, types, whitespace, layout and comments. 3. Type-3 clones could include all the changes of Type-1/Type-2 clones with further modifications such as changed, added or removed statements Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 5 Example of code smells: Clones
  • 6. • Design defects that describe bad solutions to recurring design. • Previous work have reported that the existence of anti-patterns in a software source code co-occurred with a high probability of change and fault-proneness. • The maintenance activities of a the software system became more complicated and difficult. F. Khomh, M. D. Penta, Y.-G. Gueheneuc, and G. Antoniol, “An exploratory study of the impact of antipatterns on class change and fault proneness,” Empirical Software Engineering, 2012. Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns Example of design smells: Anti-patterns 6
  • 7. • Blob: where one class monopolizes the processing, and a set of related classes save the data. Thus, features are implemented in just one class. • SpaghettiCode: if a class contains or implies a procedural structure (instead of an object-oriented structure): A limited number of classes with large methods and that includes a single, multistage process flow. • Anti-patterns make the software system very difficult to update or to reuse, and thus, increases the maintenance cost. Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 7 Example of design smells: Anti-patterns
  • 8. Smells interference • It was not clear from previous work if the interference of these smells could increase or decrease the risk of faults. • An empirical study to analyze the resulting impact of the interference of these code smells on fault-proneness. • Provide empirical evidences of co-occurrences of two different smells indicating two different problems: duplicating code and poor design. • RQ1: What is the percentage of classes participating in anti-patterns and clones? quantitative data on the number of cases with which anti-patterns and clones occur and co-occur in the releases of the studied systems. • RQ2: What is the impact on fault-proneness for a class that participates in anti-patterns and clones? co-occurrence of anti-patterns and clones is related to higher or lower fault-proneness? Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 8
  • 9. Approach Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 9
  • 10. What is the percentage of classes participating in anti-patterns and clones? Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 10
  • 11. 1. Having clones and anti-patterns is a very frequent observation: at least, more than 52% of anti-pattern classes have clones, while 59% to 78% of classes with clones are participating in anti-patterns. 2. No evidences of a relationship between the sizes of software systems and the proportion of clones and anti-patterns detected in their source codes. 3. Clones represent more than 50% of Azureus, Eclipse, and JHotDraw. This confirms the observation of Baker and Ducasse: clones exist at rates of over 50% of Cobol and C systems. 4. We notice that the anti-patterns that are large by default, i.e., Blob, LongMethod, LongParameterList, and LargeClass do not have a much larger percentage of internal clones. 5. Contrary to intuition, anti-patterns resulting in large classes are not the most affected by clones. Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 11 What is the percentage of classes participating in anti-patterns and clones?
  • 12. What is the impact on fault-proneness for a class that participates in anti-patterns and clones? Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 12
  • 13. Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 13 1. Classes having clones and anti-patterns are significantly more fault-prone than other classes. 2. In Eclipse, we observed that the risk for a class to be fault-prone if it has a co- occurrence of clone and anti-pattern is at least 7 times higher than a class that hasn’t neither a co-occurrence of clone and anti-pattern. 3. Moreover, this risk is higher than a class that has just an occurrence of an anti-pattern and higher than a class that has just an occurrence of a clone. 4. Cloned code are only co-changed with a set of classes that involve their clones or with a set of classes without their clones in the system, but never with both of sets. What is the impact on fault-proneness for a class that participates in anti-patterns and clones?
  • 14. Conclusion and future work Fehmi Jaafar: On the Analysis of Co-occurrence of Anti-patterns 14 • Having clones and anti-patterns is a very frequent observation in software systems. • Classes having clones and anti-patterns are significantly more fault- prone than other classes. • Other observations open the door for further investigations to predict changes, inconsistent changes, and late prorogation changes among clones, and by consequence, avoid fault induction during the maintenance of software systems.