Figure 5: Fitness value evolution (Lower values are better).
4.2 Approach Accuracy
We manually investigated the obtained design to
judge if the proposed refactorings are accurate and we
have found that the best solution produced by the GA
contains 9 components (Figure 6).
Figure 6: System design after applying refactorings.
We notice that in the original design 6 components
were severly suffering from bad smells (colored in
grey in Fig. 4). However, 8 components have been
refactored into 5 new ones (colored in blue in Fig. 6)
and the 4 remaining components stayed untouched.
Among these 8 components only 2 ones were not af-
fected by bad smells. This gives us a false positives
value of 16.66%(2/12). This low value indicates that
our approach is very accurate on detecting and cor-
recting bad smells.
5 CONCLUSION
In this paper, we have addressed automated refactor-
ing of component-based software systems. To tackle
this problem, we have proposed detection rules for the
recently proposed component-relevant bad smells as
well as a catalogue of component-relevant refactor-
ings. Then, we relied on these two elements to pro-
pose a genetic algorithm to find the best sequence of
refactorings to perform. We have experimented our
approach on a medium-sized software and evaluated
it in terms of efficiency and accuracy.
To the best of our knowledge, our approach is the
first attempt to automated refactoring of component-
based applications. We believe that we can further im-
prove it in the future. In the short term, we plan to ex-
tend our extraction engine to support more component
models. In the long term, we plan to use component-
relevant quality metrics to improve the exploration of
the solution space.
REFERENCES
Bavota, G., Di Penta, M., and Oliveto, R. (2014). Search
based software maintenance: Methods and tools. In
Evolving Software Systems, pages 103–137. Springer.
Bieman, J. M. and Kang, B.-K. (1995). Cohesion and reuse
in an object-oriented system. In ACM SIGSOFT Soft-
ware Engineering Notes, volume 20, pages 259–262.
ACM.
Fowler, M., Beck, K., Brant, J., Opdyke, W., and Roberts,
D. (1999). Refactoring: Improving the design of ex-
isting programs.
Garcia, J., Popescu, D., Edwards, G., and Medvidovic,
N. (2009). Toward a catalogue of architectural bad
smells. In Architectures for adaptive software systems,
pages 146–162. Springer.
Macia, I., Garcia, A., Chavez, C., and von Staa, A.
(2013). Enhancing the detection of code anoma-
lies with architecture-sensitive strategies. In Software
Maintenance and Reengineering (CSMR), 2013 17th
European Conference on, pages 177–186. IEEE.
O’Keeffe, M. and Cinn´eide, M. O. (2006). Search-based
software maintenance. In Software Maintenance and
Reengineering, 2006. CSMR 2006. Proceedings of the
10th European Conference on, pages 10–pp. IEEE.
Romano, D., Raemaekers, S., and Pinzger, M. (2014).
Refactoring fat interfaces using a genetic algorithm. In
Software Maintenance and Evolution (ICSME), 2014
IEEE International Conference on, pages 351–360.
IEEE.
Seng, O., Stammel, J., and Burkhart, D. (2006). Search-
based determination of refactorings for improving the
class structure of object-oriented systems. In Proceed-
ings of the 8th annual conference on Genetic and evo-
lutionary computation, pages 1909–1916. ACM.
Vale, T., Crnkovic, I., de Almeida, E. S., Neto, P. A. d.
M. S., Cavalcanti, Y. C., and de Lemos Meira, S. R.
(2016). Twenty-eight years of component-based soft-
ware engineering. Journal of Systems and Software,
111:128–148.