Journal Article

·2017

Metric based detection of refused bequest code smell

Baydaa M. Merzah YTU , Yunus Emre Selçuk YTU

Abstract

The concept of code smell was introduced as a signs of internal design flaws within the software. Code smells detection has become a mandatory technique to detect code issues that may affect negatively on the software quality by causing problems for further development and maintenance. Accordingly, the consensus is that all types of code smells need to be refactored to deny or diminish such issues. The refactoring techniques can get rid of particular design flaws or principle violations, and restore the code fragment that present a smell, to an acceptable quality level. In the context of object-oriented systems, the concept of inheritance has been known as a key feature proposed to increase the amount of software reusability. However, using inheritance is not always the best solution, particularly if it is utilized in improper cases where other types of relationships would be more appropriate. One of the particular issues that violate inheritance principles is the Refused Bequest code smell. It is related to an inheritance hierarchy where a subclass does not obligate the interface inherited from its parent class. Some studies, mentioned in Section 2, had been made to detect the Refused Bequest smell. In this paper we present a new detection strategy by computing the similarity between common methods of the base class with the overridden methods of the sub-class, and then by calculating the average of these values for the given sub-class. That average value is defined as a new metric in our detection mechanism.

Keywords

Bequest Metric (unit) Code smell Computer science Code (set theory) Artificial intelligence Computer vision Programming language Economics

Subject Areas

Software Engineering Research ·Information Systems ·Physical Sciences
Advanced Malware Detection Techniques ·Signal Processing ·Physical Sciences
Software Testing and Debugging Techniques ·Software ·Physical Sciences

Citations by Year

OpenAlex SDG Match

SDGs auto-classified by OpenAlex (score ≥ 0.4 shown).

Peace, Justice and strong institutions 60%