Abstract

Software developers find it difficult to select the specific detection rules for different smell types. A set of metrics, thresholds and labels constitutes a code smells detection rule. The generated rules must be optimized efficiently to ensure successful rule selection. The objective is to identify how rules are generated from the labeled data set and selected using bio-inspired algorithms. The goals are met by employing the C4.5 and RIPPER algorithms to generate rules then, optimized using two bio-inspired algorithms, the Salp Swarm Algorithm (SSA) and Cockroach Swarm Optimization (CSO). The optimized sets of rules are evaluated using the similarity metrics which are computed with the help of expected and the detected code smells. The common rule subsets from SSA and CSO are merged to produce the optimal rule subset which can be used for code smell detection. The proposed work has been experimented on Xerces-J, Log4J, Gantt Project and JFreeChart dataset. The work detected code smells with an accuracy of 91.7% for Xerces-J, 96.7% for JFreeChart, 88.6% for Gantt Project and 98% for Log4J. The findings will be useful for both theory and research since the proposed framework allows focusing on rule selection.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call