Code Smell Detection Using Whale Optimization Algorithm
Source abstract
Abstract
Software systems have been employed in many fields as a means to reduce human efforts; consequently, stakeholders are interested in more updates of their capabilities. Code smells arise as one of the obstacles in the software industry. They are characteristics of software source code that indicate a deeper problem in design. These smells appear not only in the design but also in software implementation. Code smells introduce bugs, affect software maintainability, and lead to higher maintenance costs. Uncovering code smells can be formulated as an optimization problem of finding the best detection rules. Although researchers have recommended different techniques to improve the accuracy of code smell detection, these methods are still unstable and need to be improved. Previous research has sought only to discover a few at a time (three or five types) and did not set rules for detecting their types. Our research improves code smell detection by applying a search-based technique; we use the Whale Optimization Algorithm as a classifier to find ideal detection rules. Applying this algorithm, the Fisher criterion is utilized as a fitness function to maximize the between-class distance over the within-class variance. The proposed framework adopts if-then detection rules during the software development life cycle. Those rules identify the types for both medium and large projects. Experiments are conducted on five open-source software projects to discover nine smell types that mostly appear in codes. The proposed detection framework has an average of 94.24% precision and 93.4% recall. These accurate values are better than other search-based algorithms of the same field. The proposed framework improves code smell detection, which increases software quality while minimizing maintenance effort, time, and cost. Additionally, the resulting classification rules are analyzed to find the software metrics that differentiate the nine code smells.
Source: openalex_inverted_index · Quality: baseline
Research context
OpenAlex topics: Software Engineering Research · Software Reliability and Analysis Research · Software Engineering Techniques and Practices
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
References (61)
Show source-provided references
1. Evolution of software in automated production systems: Challenges and research directions10.1016/j.jss.2015.08.026 ↗
2. Application of machine learning algorithms for code smell prediction using object-oriented software metrics
3. Code smells and refactoring: A tertiary systematic review of challenges and observations10.1016/j.jss.2020.110610 ↗
4. A study on bad code smell
5. Fowler · Refactoring: Improving the Design of Existing Code · 2018 · 75
6. The smell of fear: On the relation between test smells and flaky tests10.1007/s10664-019-09683-z ↗
7. Comparing heuristic and machine learning approaches for metric-based code smell detection
8. Multi-objective code smells detection using good and bad design examples10.1007/s11219-016-9309-7 ↗
9. Decor: A method for the specification and detection of code and design smells10.1109/TSE.2009.50 ↗
10. Smurf: A svm-based incremental anti-pattern detection approach
11. Identifying refactoring opportunities in object-oriented code: A systematic literature review10.1016/j.infsof.2014.08.002 ↗
12. Code smell detection as a bilevel problem10.1145/2675067 ↗
13. Do they really smell bad? A study on developers’ perception of bad code smells
14. Search based software engineering: Trends, techniques and applications10.1145/2379776.2379787 ↗
15. The whale optimization algorithm10.1016/j.advengsoft.2016.01.008 ↗
16. Feature generation using genetic programming based on fisher criterion
17. Machine learning techniques for code smell detection: A systematic literature review and meta-analysis10.1016/j.infsof.2018.12.009 ↗
18. Detecting defects in object-oriented designs: Using reading techniques to increase software quality10.1145/320385.320389 ↗
19. Automatic detection of design problems in object-oriented reengineering
20. Continuous quality assessment with in code10.1016/j.scico.2015.02.007 ↗
21. Detection and refactoring of bad smell caused by large scale10.5121/ijsea.2013.4501 ↗
22. R. Naveen, “Jsmell: A bad smell detection tool for java systems,” M.S. Thesis. Maharishi Dayanand University, Rohtak, India, 2009.
23. Detection of bad smells in source code according to object oriented metrics
24. From a domain analysis to the specification and detection of code and design smells10.1007/s00165-009-0115-x ↗
25. N. Mathur, “Java smell detector,” M.S. Thesis. San Jose State University, San Jose, California, USA, 2011.
26. Metrics based refactoring
27. An interactive ambient visualization for code smells
28. Code smell prediction employing machine learning meets emerging java language constructs10.1007/978-3-030-34706-2_8 ↗
29. Code smell detection using multi-label classification approach10.1007/s11219-020-09498-y ↗
30. Assessment of code smell for predicting class change proneness using machine learning10.1109/ACCESS.2019.2905133 ↗
31. Search based design defects detection by example
32. Maintainability defects detection and correction: A multi-objective approach10.1007/s10515-011-0098-8 ↗
33. Competitive coevolutionary code smells detection
34. JDeodorant, “Eclipse marketplace,” 2020. [Online]. Available: http://marketplace.eclipse.org/content/ jdeodor.
35. Code smell detection and refactoring using AST visitor
36. Mathew · 17th SC@ RUG 2020 · 2020 · 57
37. Reducing redundancy of test cases generation using code smell detection and refactoring10.1016/j.jksuci.2018.06.005 ↗
38. Search based software engineering10.1016/S0950-5849(01)00189-6 ↗
39. Search based data sensitivity analysis applied to requirement engineering
40. Comparing and experimenting machine learning techniques for code smell detection10.1007/s10664-015-9378-4 ↗
41. Lanza · Object-Oriented Metrics in Practice · 2006 · 45
42. ArgoUML, “ArgoUML-tigris,” 2020. [Online]. Available: http://argouml.tigris.org/.
43. Azure, “Vuze bittorrent client,” 2020. [Online]. Available: http://vuze.com.
44. Gantt, “Gantt project,” 2020. [Online]. Available: www.ganttproject.biz.
45. Log4j, “Log4j,” 2020. [Online]. Available: http://logging.apache.org/log4j/2.x/.
46. Xerces-J, “Xerces java parser,” 2020. [Online]. Available: http://xerces.apache.org/xerces-j/.
47. RapidMiner Studio, “RapidMiner,” 2020. [Online]. Available: https://rapidminer.com/get-started/.
48. The evolutionary pre-processor: Automatic feature extraction for supervised classification using genetic programming
49. Emergence of feature extraction function using genetic programming
50. Enhanced whale optimization algorithm for sizing optimization of skeletal structures10.1080/15397734.2016.1213639 ↗
51. A novel global MPP tracking of photovoltaic system based on whale optimization algorithm10.14710/ijred.5.3.225-232 ↗
52. Study of the economic dispatch problem on ieee 30-bus system using whale optimization algorithm10.15282/ijets.5.2016.1.2.1041 ↗
53. Whale optimization algorithm and moth-flame optimization for multilevel thresholding image segmentation10.1016/j.eswa.2017.04.023 ↗
54. Particle swarm optimization of deep neural networks architectures for image classification10.1016/j.swevo.2019.05.010 ↗
55. A new genetic algorithm for solving optimization problems10.1016/j.engappai.2013.09.013 ↗
56. NetBeans IDE, “NetBeans IDE,” 2020. [Online]. Available: https://netbeans.org/downloads/8.2/rc/.
57. Java Development Kit, “Java development kit,” 2020. [Online]. Available: https://www.oracle.com/java/ technologies/javase-jdk11-downloads.html.
58. Java Excel API Jar, “Java excel api,” 2020. [Online]. Available: http://www.java2s.com/Code/Jar/j/ Downloadjxl26jar.htm.
59. Apache Poi, “Apache poi,” 2020. [Online]. Available: http://poi.apache.org/download.html.
60. Multiobjective immune algorithm with nondominated neighbor-based selection10.1162/evco.2008.16.2.225 ↗
61. Goldberg · Genetic Algorithms in Search, Optimization and Machine Learning · 1989 · 217