Relacionando Refactorings e Métricas de Código Fonte - Um Primeiro Passo para Detecção Automática de Oportunidades de Refactoring

  • Glauco de Figueiredo Carneiro Universidade Salvador / Empresa Brasileira de Correios e Telégrafos
  • Manoel Gomes de Mendonça Neto Universidade Salvador

Abstract


Software refactoring - improving the internal structure of the software without changing its observable behavior - is an important action towards avoiding software quality decay. Key to this activity is the identification of portions of the source code that offers opportunities for refactoring - the so called "code bad smells". This work presents an approach to help on the detection of code bad smells through source code measurement on focuses on a first step towards the implementation of this approach. It presents a study relating metrics, refactorings, and bad smells. The study is broken into two parts. The first - top-down - part is based on the analytical application of the Goal-Question-Metric (GQM) method to define metrics to detect code bad smells. The second - bottom-up - part is an empirical study on the relationship between well-known source code metrics, refactorings and code bad smells.

Keywords: refactoring, software metrics, GQM method, empirical study

References

Astels, D. Refactoring with UML. Disponível em [link]. Acesso em 02 de agosto de 2002.

Basili, V. R., Rombach, H. D. The TAME Project: Towards Improvement-Oriented Software Environments. IEEE Transactions on Software Eng., vol. 14. no 6, pp. 758-773, June 1988.

Basili, V., Weiss, D. A methodology for collecting valid software engineering data. IEEE Transactions on Software Eng., November 1984.

Beck, K. Extreme Programming Explained: Embrace Change. Addison Wesley, 1999.

Briand, L. Measurement and Quality Modelling of OO Systems.The Sixth International Symposium on Software Metrics. November 4-6, 1999. Boca Raton, Florida, USA.

Carneiro, G. F., Mendonça Neto, M.G. Usando Medição de Código Fonte para Refactoring. In 2nd Ibero-American Symposium on Software Engineering and Knowledge Engineering. Oct, 2002. Salvador, Bahia, Brazil.

Carneiro, G. F. Usando Medição de Código Fonte para Refactoring. Dissertação de Mestrado. Universidade Salvador. Abril, 2003. Salvador, Bahia, Brazil.

Demeyer, S., Ducasse, S., Nierstrasz, O. Finding Refactorings via Change Metrics. Proceedings OOPSLA'2000, ACM Press.

Ernst, M. D., Cockrell J., Griswold, W. G., David Notkin. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions on Software Engineering, 27(2):1-25, February 2001.

Fenton, N. and Pleeger S. Software Metrics: A Rigorous and Pratical Approach. Second Edition, PWS Publishing Company, 1997.

Fowler, M. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 2000.

Fowler, M. Capítulo 15 não publicado no livro Refactoring: Improving the Design of Existing Code. Addison-Wesley, 2000, mas disponibilizado pelo autor em http://www.refactoring.com/rejectedExample.pdf. Documento acessado em 20/03/2002.

Kataoka, Y., Ernst, M., Griswold, W., Notkin, D.. Automated Support for Program Refactoring using Invariants. In ICSM'01, Proceedings of the International Conference on Software Maintenance, (Florence, Italy), November 6-10, 2001, pp. 736-743.

Mendonça, M., Basili, V.. Validation of an Approach for Improving Existing Measurement Frameworks. IEEE Transactions on Software Engineering, v.26, n.6, p.484- 499, 2000.

Opdyke, W. Refactoring Object-Oriented Frameworks. Ph.D. Thesis. University of Illinois at Urbana-Champaign, 1992.

Roberts, D. Practical Analysis for Refactoring. PhD Thesis. University of Illinois at Urbana-Champaign, 1999.

TogetherControlCenter. Acesso em 03 de julho de 2002. Disponível em http://www.togethersoft.com/products/controlcenter/index.jsp.

Tourwé, T., Brichau, J., Mens, T. Using Declarative Metaprogramming to Detect Possible Refactorings. ASE 2002. Acesso em 6 de setembro de 2002. Disponível em [link].
Published
2003-10-08
CARNEIRO, Glauco de Figueiredo; MENDONÇA NETO, Manoel Gomes de. Relacionando Refactorings e Métricas de Código Fonte - Um Primeiro Passo para Detecção Automática de Oportunidades de Refactoring. In: BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING (SBES), 17. , 2003, Manaus/AM. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2003 . p. 47-62. ISSN 2833-0633. DOI: https://doi.org/10.5753/sbes.2003.23852.