Research Article IntelligentMiningofAssociationRulesBasedonNanopatternsfor CodeSmellsDetection D.JulietThessalonica , 1 H.KhannaNehemiah , 1 S.Sreejith, 1 andA.Kannan 2 1 Ramanujan Computing Centre, Anna University, Chennai 600025, India 2 School of Computer Science and Engineering, Vellore Institute of Technology, Vellore, India Correspondence should be addressed to H. Khanna Nehemiah; nehemiah@annauniv.edu Received 14 May 2022; Revised 17 December 2022; Accepted 31 January 2023; Published 13 April 2023 Academic Editor: Danilo Pianini Copyright © 2023 D. Juliet Tessalonica et al. Tis is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Software maintenance is an imperative step in software development. Code smells can arise as a result of poor design as well as frequent code changes due to changing needs. Early detection of code smells during software development can help with software maintenance. Tis work focuses on identifying code smells on Java software using nanopatterns. Nanopatterns are method•level code structures that refect the presence of code smells. Nanopatterns are extracted using a command•line interface based on the ASM bytecode analysis. Class labels are extracted using three tools, namely inFusion, JDeodorant, and iPlasma. Rules are extracted from nanopatterns using the Apriori algorithm and mapped with the extracted class labels. Best rules are selected using the Border Collie Optimization (BCO) algorithm with the accuracy of the k•NN classifer as the ftness function. Te selected rules are stored in the rule base to detect code smells. Te objective is to detect a maximum number of code smells with a minimum number of rules. Experiments are carried out on Java software, namely jEdit, Nutch, Lucene, and Rhino. Te proposed work detects code smells, namely data class, blob, spaghetti code, functional decomposition, and feature envy, with 98.78% accuracy for jEdit, 97.45% for Nutch, 95.58% for Lucene, and 96.34% for Rhino. Te performance of the proposed work is competitive with other well•known methods of detecting code smells. 1.Introduction Software maintenance is an important stage of the software development life cycle. Te purpose of maintenance is to add functionality to the software system while maintaining its original functioning. Tese changes may appear as new requirements or previously planned but not implemented. Such changes afect either the algorithmic level or the specifcation level. Correcting faults, adapting to changing user requirements over time, updating hardware/software specifcations, altering the components to remove unde• sirable side efects, and optimizing the code to execute more quickly are all the maintenance tasks necessary to ensure that the system continues to meet user needs. Te imperativeness of software maintenance is to update and enhance the software after deployment to improve system performance. Maintenance begins after the software is built and made available to end users. Maintenance includes strengthening existing capabilities, correcting errors, evaluating, and amending software to satisfy changing requirements 1]. Corrective, adaptive, perfective, and preventative maintenance are the four diferent categories of software maintenance. Corrective software maintenance addresses the bugs and faults in software applications that can infuence the design, logic, and code. Adaptive software maintenance addresses software modifcations that occur as a result of a change in the operating environment. Perfective software maintenance allows updating the software to improve its value according to user demands. Preventive software maintenance is a change in the software that detects and corrects latent faults before it becomes efective faults. Tese maintenance activities are hindered by code smells. Hindawi Scientific Programming Volume 2023, Article ID 2973250, 18 pages https://doi.org/10.1155/2023/2973250