Skip to main content
Log in

SP-J48: a novel optimization and machine-learning-based approach for solving complex problems: special application in software engineering for detecting code smells

  • Original Article
  • Published:
Neural Computing and Applications Aims and scope Submit manuscript

Abstract

This paper presents a novel hybrid algorithm based on optimization and machine-learning approaches for solving real-life complex problems. The optimization algorithm is inspired from the searching and attacking behaviors of sandpipers, called as Sandpiper Optimization Algorithm (SPOA). These two behaviors are modeled and implemented computationally to emphasize intensification and diversification in the search space. A comparison of the proposed SPOA algorithm is performed with nine competing optimization algorithms over 23 benchmark test functions. The proposed SPOA is further hybridized with B-J48 pruned machine-learning approach for efficiently detecting the code smells from the data set. The results reveal that the proposed technique is able to solve challenging problems and outperforms the other well-known approaches.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3

Similar content being viewed by others

Notes

  1. B-J48 pruned is the pruned variant of J48 algorithm. However, algorithm with a “B-” prefix is termed as boosted algorithm.

References

  1. Singh P, Dhiman G (2018) A hybrid fuzzy time series forecasting model based on granular computing and bio-inspired optimization approaches. J Comput Sci 27:370–385

    Article  Google Scholar 

  2. Dhiman G, Kumar V (2018) Emperor penguin optimizer: a bio-inspired algorithm for engineering problems. Knowl Based Syst 159:20–50

    Article  Google Scholar 

  3. Singh P, Dhiman G (2018) Uncertainty representation using fuzzy-entropy approach: special application in remotely sensed high-resolution satellite images (rshrsis). Appl Soft Comput 72:121–139

    Article  Google Scholar 

  4. Dhiman G, Kaur A (2018) Optimizing the design of airfoil and optical buffer problems using spotted hyena optimizer. Designs 2(3):28

    Article  Google Scholar 

  5. Gaurav D, Vijay K (2018) Seagull optimization algorithm: theory and its applications for large-scale industrial engineering problems. Knowl Based Syst 165:169

    Google Scholar 

  6. Gaurav D, Vijay K (2019) KnRVEA: a hybrid evolutionary algorithm based on knee points and reference vector adaptation strategies for many-objective optimization. Appl Intell 1:1–27

    Google Scholar 

  7. Kennedy J, Eberhart RC (1995) Particle swarm optimization. In Proceedings of IEEE international conference on neural networks, pp 1942–1948

  8. Alba E, Dorronsoro B (2005) The exploration/exploitation tradeoff in dynamic cellular genetic algorithms. IEEE Trans Evolut Comput 9(2):126–142

    Article  Google Scholar 

  9. Lozano M, Garcia-Martinez C (2010) Hybrid metaheuristics with evolutionary algorithms specializing in intensification and diversification: overview and progress report. Comput Oper Res 37(3):481–497

    Article  MathSciNet  MATH  Google Scholar 

  10. Wolpert DH, Macready WG (1997) No free lunch theorems for optimization. IEEE Trans Evolut Comput 1(1):67–82

    Article  Google Scholar 

  11. Kirkpatrick S, Gelatt CD, Vecchi MP (1983) Optimization by simulated annealing. Science 220(4598):671–680

    Article  MathSciNet  MATH  Google Scholar 

  12. Rashedi E, Nezamabadi-pour H, Saryazdi S (2009) GSA: a gravitational search algorithm. Inform Sci 179(13):2232–2248

    Article  MATH  Google Scholar 

  13. Kaveh A, Talatahari S (2010) A novel heuristic optimization method: charged system search. Acta Mech 213(3):267–289

    Article  MATH  Google Scholar 

  14. Erol OK, Eksin I (2006) A new optimization method: big bang-big crunch. Adv Eng Softw 37(2):106–111

    Article  Google Scholar 

  15. Kaveh A, Khayatazad M (2012) A new meta-heuristic method: ray optimization. Comput Struct 112–113:283–294

    Article  Google Scholar 

  16. Hatamlou A (2013) Black hole: a new heuristic optimization approach for data clustering. Inf Sci 222:175–184

    Article  MathSciNet  Google Scholar 

  17. Formato RA (2009) Central force optimization: a new deterministic gradient-like optimization metaheuristic. Opsearch 46(1):25–51

    Article  MathSciNet  MATH  Google Scholar 

  18. Holland John H (1992) Genetic algorithms. Sci Am 267(1):66–72

    Article  Google Scholar 

  19. Storn R, Price K (1997) Differential evolution—a simple and efficient heuristic for global optimization over continuous spaces. J Glob Optim 11(4):341–359

    Article  MathSciNet  MATH  Google Scholar 

  20. Beyer H-G, Schwefel H-P (2002) Evolution strategies—a comprehensive introduction. Nat Comput 1(1):3–52

    Article  MathSciNet  MATH  Google Scholar 

  21. Koza JR (1992) Genetic programming: on the programming of computers by means of natural selection. MIT Press, London

    MATH  Google Scholar 

  22. Simon D (2008) Biogeography-based optimization. IEEE Trans Evolut Comput 12(6):702–713

    Article  Google Scholar 

  23. Slowik A, Kwasnicka H (2017) Nature inspired methods and their industry applications—swarm intelligence algorithms. IEEE Trans Ind Inform 45(99):1–1

    Google Scholar 

  24. Dorigo M, Birattari M, Stutzle T (2006) Ant colony optimization—artificial ants as a computational intelligence technique. IEEE Comput Intell Mag 1:28–39

    Article  Google Scholar 

  25. Yang X-S (2010) A new metaheuristic bat-inspired algorithm. Springer, Berlin, pp 65–74

    MATH  Google Scholar 

  26. Karaboga D, Basturk B (2007) Artificial bee colony (ABC) optimization algorithm for solving constrained optimization problems. Springer, Berlin, pp 789–798

    MATH  Google Scholar 

  27. Dhiman G, Kumar V (2017) Spotted hyena optimizer: a novel bio-inspired based metaheuristic technique for engineering applications. Adv Eng Softw 114:48–70

    Article  Google Scholar 

  28. Yang XS, Deb S (2009) Cuckoo search via levy flights. In: World congress on nature biologically inspired computing, pp 210–214

  29. Dhiman G, Kumar V (2018) Multi-objective spotted hyena optimizer: a multi-objective optimization algorithm for engineering problems. Knowl Based Syst 150:175–197

    Article  Google Scholar 

  30. Dhiman G, Kumar V (2019) Spotted hyena optimizer for solving complex and non-linear constrained engineering problems. In: Harmony search and nature inspired optimization algorithms. Springer, pp 857–867

  31. Dhiman G, Kaur A (2017) Spotted hyena optimizer for solving engineering design problems. In: 2017 international conference on machine learning and data science (MLDS), pp 114–119

  32. Seyedali M, Mohammad MS, Andrew L (2014) Grey wolf optimizer. Adv Eng Softw 69:46–61

    Article  Google Scholar 

  33. Mirjalili S (2015) Moth-flame optimization algorithm: a novel nature-inspired heuristic paradigm. Knowl Based Syst 89:228–249

    Article  Google Scholar 

  34. Mirjalili S, Mirjalili SM, Hatamlou A (2016) Multi-verse optimizer: a nature-inspired algorithm for global optimization. Neural Comput Appl 27(2):495–513

    Article  Google Scholar 

  35. Mirjalili S (2016) SCA: a sine cosine algorithm for solving optimization problems. Knowl Based Syst 96:120–133

    Article  Google Scholar 

  36. Bonabeau E, Dorigo M, Theraulaz G (1999) Swarm intelligence: from natural to artificial systems. Oxford University Press, Inc., Oxford

    MATH  Google Scholar 

  37. Wilcoxon F (1945) Individual comparisons by ranking methods. Biom Bull 1(6):80–83

    Article  Google Scholar 

  38. Chen Q, Liu B, Zhang Q, Liang J, Suganthan P, Qu BY (2014) Problem definitions and evaluation criteria for CEC 2015 special session on bound constrained single-objective computationally expensive numerical optimization. Technical Report, Nanyang Technological University

  39. Korting TS (2006) C4. 5 algorithm and multivariate decision trees. Image Processing Division, National Institute for Space Research-INPE, Sao Jose dos Campos

    Google Scholar 

  40. Arcelli FF, Pietro B, Marco Z (2012) Automatic detection of bad smells in code: an experimental assessment. J Object Technol 11(2):1–5

    Google Scholar 

  41. Abdelmoez W, Kosba E, Iesa AF (2014) Risk-based code smells detection tool. In: The international conference on computing technology and information management (ICCTIM2014)

  42. Rasool G, Arshad Z (2015) A review of code smell mining techniques. J Softw Evolut Process 27(11):867–895

    Article  Google Scholar 

  43. Brown WH, Malveau RC, McCormick HW, Mowbray TJ (1998) AntiPatterns: refactoring software, architectures, and projects in crisis. Wiley, New York

    Google Scholar 

  44. Pressman RS (2005) Software engineering: a practitioner’s approach. Palgrave Macmillan, London

    MATH  Google Scholar 

  45. Travassos G, Shull F, Fredericks M, Basili VR (1999) Detecting defects in object-oriented designs: using reading techniques to increase software quality. In: ACM sigplan notices, vol 34, pp 47–56. ACM

    Article  Google Scholar 

  46. Kaur A, Dhiman G (2019) A review on search-based tools and techniques to identify bad code smells in object-oriented systems. In: Harmony search and nature inspired optimization algorithms, pp 909–921

    Google Scholar 

  47. Kaur A, Jain S, Goel S (2017) A support vector machine based approach for code smell detection. In: 2017 international conference on machine learning and data science (MLDS), IEEE, pp 9–14

  48. Ghannem A, El Boussaidi G, Kessentini M (2016) On the use of design defect examples to detect model refactoring opportunities. Softw Qual J 24(4):947–965

    Article  Google Scholar 

  49. Mansoor U, Kessentini M, Maxim BR, Deb K (2017) Multi-objective code-smells detection using good and bad design examples. Softw Qual J 25(2):529–552

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Amandeep Kaur.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix: Unimodal, multimodal, and fixed-dimension multimodal benchmark test functions

Appendix: Unimodal, multimodal, and fixed-dimension multimodal benchmark test functions

1.1 Unimodal benchmark test functions

1.1.1 Sphere model

$$\begin{aligned} F_1(z) \,=\, & {} \sum _{i=1}^{30} z_i^2\\ -100\le & {} z_i \le 100, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.2 Schwefel’s Problem 2.22

$$\begin{aligned}&F_2(z)= \sum _{i=1}^{30} |z_i| + \prod _{i=1}^{30} |z_i|\\&-10 \le z_i \le 10, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.3 Schwefel’s Problem 1.2

$$\begin{aligned}&F_3(z)= \sum _{i=1}^{30} \Big (\sum _{j=1}^i z_j\Big )^2\\&-100 \le z_i \le 100, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.4 Schwefel’s Problem 2.21

$$\begin{aligned}&F_4(z)= \max _i\{|z_i|, 1 \le i \le 30\}\\&-100 \le z_i \le 100, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.5 Generalized Rosenbrock’s function

$$\begin{aligned}&F_5(z)= \sum _{i=1}^{29}\left[ 100\left( z_{i+1} - z_i^2\right) ^2 + (z_i - 1)^2\right] \\&-30 \le z_i \le 30, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.6 Step function

$$\begin{aligned}&F_6(z)= \sum _{i=1}^{30}(\lfloor {z_i + 0.5}\rfloor )^2\\&-100 \le z_i \le 100, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.1.7 Quartic function

$$\begin{aligned}&F_7(z)= \sum _{i=1}^{30} iz_i^4 + {\mathrm{random}}[0,1]\\&-1.28 \le z_i \le 1.28, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.2 Multimodal benchmark test functions

1.2.1 Generalized Schwefel’s Problem 2.26

$$\begin{aligned}&F_8(z)= \sum _{i=1}^{30} - z_i \sin (\sqrt{|z_i|})\\&-500 \le z_i \le 500, \quad f_{\min } = -12569.5, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.2.2 Generalized Rastrigin’s function

$$\begin{aligned}&F_9(z)= \sum _{i=1}^{30} [z_i^2 - 10\cos (2\pi z_i) + 10]\\&-5.12 \le z_i \le 5.12, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.2.3 Ackley’s function

$$\begin{aligned}F_{10}(z)&= -20\exp \bigg (-0.2\sqrt{\dfrac{1}{30}\sum \nolimits _{i=1}^{30} z_i^2}\bigg ) \\&\quad - \exp \bigg (\dfrac{1}{30}\sum _{i=1}^{30} \cos (2\pi z_i)\bigg ) +20 +e\\&\quad -32 \le z_i \le 32, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.2.4 Generalized Griewank function

$$\begin{aligned}&F_{11}(z)\\&= \dfrac{1}{4000} \sum _{i=1}^{30} z_i^2 - \prod _{i=1}^{30} \cos \bigg (\dfrac{z_i}{\sqrt{i}}\bigg ) + 1\\&-600 \le z_i \le 600, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

1.2.5 Generalized penalized functions

  • $$\begin{aligned}&F_{12}(z)= \dfrac{\pi }{30}\{10\sin (\pi x_1) + \sum _{i=1}^{29}(x_i - 1)^2[1 + 10\sin ^2(\pi x_{i+1})] \\&\quad + \,(x_n - 1)^2 \} + \sum _{i=1}^{30}u(z_i, 10, 100, 4)\\&\quad -\,50 \le z_i \le 50, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \\ \end{aligned}$$
  • $$\begin{aligned}&F_{13}(z)= 0.1\{\sin ^2(3\pi z_1) + \sum _{i=1}^{29}(z_i - 1)^2[1 + \sin ^2(3\pi z_i + 1)]\\&\quad + \,(z_n - 1)^2[1 + \sin ^2(2\pi z_{30})]\} + \sum _{i=1}^Nu(z_i, 5, 100, 4)\\&\quad -50 \le z_i \le 50, \quad f_{\min } = 0, \quad {\mathrm{Dim}} = 30 \end{aligned}$$

where \(x_i = 1 + \dfrac{z_i+1}{4}\)

$$\begin{aligned} u(z_i, a, k, m) = {\left\{ \begin{array}{ll} k(z_i - a)^m &{} \quad z_i > a\\ 0 &{} \quad -a<z_i<a\\ k(-z_i - a)^m &{} \quad z_i<-a \end{array}\right. } \end{aligned}$$

1.3 Fixed-dimension multimodal benchmark test functions

1.3.1 Shekel’s Foxholes function

See Table 10.

$$\begin{aligned}F_{14}(z)=& \bigg (\dfrac{1}{500} + \sum _{j=1}^{25}\dfrac{1}{j+\sum _{i=1}^2(z_i - a_{ij})^6}\bigg )^{-1}\\&-65.536 \le z_i \le 65.536, \quad f_{\min } \approx 1, \quad {\mathrm{Dim}} = 2 \end{aligned}$$
Table 10 Shekel’s Foxholes function \(F_{14}\)

1.3.2 Kowalik’s function

$$\begin{aligned}F_{15}(z)=& \sum _{i=1}^{11}\bigg [a_i - \dfrac{z_1(b_i^2+b_iz_2)}{b_i^2+b_iz_3+z_4}\bigg ]^2\\&\quad -5 \le z_i \le 5, \quad f_{\min } \approx 0.0003075, \quad {\mathrm{Dim}} = 4 \end{aligned}$$

1.3.3 Six-hump camel-back function

$$\begin{aligned}F_{16}(z)&= 4z_1^2 - 2.1z_1^4 + \dfrac{1}{3}z_1^6 + z_1z_2 - 4z_2^2 + 4z_2^4\\&\quad -5 \le z_i \le 5, \quad f_{\min } = -1.0316285, \quad {\mathrm{Dim}} = 2 \end{aligned}$$

1.3.4 Branin function

$$\begin{aligned}F_{17}(z)=& \bigg (z_2 - \dfrac{5.1}{4\pi ^2}z_1^2 + \dfrac{5}{\pi }z_1 - 6 \bigg )^2 \\&\quad +\, 10\bigg (1 - \dfrac{1}{8\pi }\bigg )\cos z_1 + 10\\&\quad -5 \le z_1 \le 10, \quad 0 \le z_2 \le 15, \quad f_{\min } = 0.398, \quad {\mathrm{Dim}} = 2 \end{aligned}$$

1.3.5 Goldstein–Price function

$$\begin{aligned}F_{18}(z)&= [1 + (z_1 + z_2 + 1)^2(19 - 14z_1 + 3z_1^2 \\& \quad - 14z_2 + 6z_1z_2 + 3z_2^2)] \\&\quad \times \,[30 + (2z_1 - 3z_2)^2 \times (18 - 32z_1\\&\quad + \,12z_1^2 + 48z_2 - 36z_1z_2 + 27z_2^2)]\\&\quad -\,2 \le z_i \le 2, \quad f_{\min } = 3, \quad {\mathrm{Dim}} = 2 \end{aligned}$$

1.3.6 Hartman’s family

See Table 11.

  • $$\begin{aligned}&F_{19}(z)= -\sum _{i=1}^4c_i \exp \left( -\sum _{j=1}^3 a_{ij}(z_j - p_{ij})^2\right) \\&0 \le z_j \le 1, \quad f_{\min } = -3.86, \quad {\mathrm{Dim}} = 3 \end{aligned}$$
  • $$\begin{aligned}&F_{20}(z)= -\sum _{i=1}^4c_i \exp \left( -\sum _{j=1}^6 a_{ij}(z_j - p_{ij})^2\right) \\&0 \le z_j \le 1, \quad f_{\min } = -3.32, \quad {\mathrm{Dim}} = 6 \end{aligned}$$
Table 11 Hartman function \(F_{19}\)

1.3.7 Shekel’s Foxholes function

See Tables 12 and 13.

  • $$\begin{aligned}&F_{21}(z)= -\sum _{i=1}^5\left[ (X - a_i)(X - a_i)^{\mathrm{T}} + c_i\right] ^{-1}\\&0 \le z_i \le 10, \quad f_{\min } = -10.1532, \quad {\mathrm{Dim}} = 4 \end{aligned}$$
  • $$\begin{aligned}&F_{22}(z)= -\sum _{i=1}^7\left[ (X - a_i)(X - a_i)^{\mathrm{T}} + c_i\right] ^{-1}\\&0 \le z_i \le 10, \quad f_{\min } = -10.4028, \quad {\mathrm{Dim}} = 4 \end{aligned}$$
  • $$\begin{aligned}&F_{23}(z)= -\sum _{i=1}^{10}\left[ (X - a_i)(X - a_i)^{\mathrm{T}} + c_i\right] ^{-1}\\&0 \le z_i \le 10, \quad f_{\min } = -10.536, \quad {\mathrm{Dim}} = 4 \end{aligned}$$
Table 12 Shekel Foxholes functions \(F_{21}, F_{22}, F_{23}\)
Table 13 Hartman function \(F_{20}\)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kaur, A., Jain, S. & Goel, S. SP-J48: a novel optimization and machine-learning-based approach for solving complex problems: special application in software engineering for detecting code smells. Neural Comput & Applic 32, 7009–7027 (2020). https://doi.org/10.1007/s00521-019-04175-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00521-019-04175-z

Keywords

Navigation