Re Engineering slides
Re Engineering slides
By
4
Concepts and Definitions
Outline
Code smells detection techniques
Evaluation of technique
Conclusion
Code Smells
Deadline Pressure
Inexperience of developers
• These are Classes that have fields, getting and setting methods and
nothing else
• Is just acting as a data holder
• Can indicate the design is really procedural
• Detection rules will be as:
üIf the class contains public attributes and no methods the smell is detected;
üIf the class contains only get and set methods the smell is detected
Duplicate Code
• Percentage of duplicate code lines in the systems
• Duplicate methods in subclasses
• Duplicate expressions in same class
• Duplicate expressions in different classes
Example:
sqrt(pow(loc1.getX() - loc2.getX(), 2)+
pow(loc1.getY() - loc2.getY(), 2))
sqrt(square(loc1.getX() - loc2.getX())+
square(loc1.getY() - loc2.getY()))
double square(double d) {
return pow(d, 2);
}
19
Types of Clones
Due to large body of knowledge, there are many published surveys, mapping
studies and systematic review studies on the topic
Zakeri-Nasrabadi, Morteza, et al. "A systematic literature review on the code smells datasets and validation
mechanisms." ACM Computing Surveys 55.13s (2023): 1-48.
Zakeri-Nasrabadi,
Morteza, et al. "A
systematic literature
review on the code
smells datasets and
validation
mechanisms." ACM
Computing
Surveys 55.13s (2023):
1-48.
Research in Code Smells
Pereira dos Reis, José, et al. "Code smells detection and visualization: a systematic literature
review." Archives of Computational Methods in Engineering 29.1 (2022): 47-94.
26
J.A COMSATS Uni
Research in Code Smells
27
Programming languages and number of
studies that use them
28
Conclusion
Software Refactoring and Maintenance is heavily based on the detection of Code
Smells.
Detection tools for the detection of different Code Smells from multiple
languages is missing.
Any Question?
Email me on : [email protected] 30