[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2975945.2975950acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Refactoring verification using model transformation

Published: 04 September 2016 Publication History

Abstract

Software refactoring is an effective way for dealing with technical debt accumulated in a software system; however, regression risk prevents developers from refactoring their code. Herein, we propose an approach to check the equivalence of source code before and after refactoring using the AST-based model extracted from source code. In order to detect unintended changes to the program structure, our approach first transforms the model from the refactored code in accordance with the refactoring pattern so that the refactoring is cancelled, and then compares it with the model from the code before refactoring. We also built a tool named POM/EQ based on the Eclipse Modeling Framework for checking C/C++ source code. As a result of the case study using the tool, we successfully checked 56 % of the refactoring changes that are performed on an industrial product.

References

[1]
P. Bille. A survey on tree edit distance and related problems. Theoretical Computer Science, 337(1–3):217 – 239, 2005.
[2]
D. Binkley. Source code analysis: A road map. In Future of Softw. Eng. (FOSE) 2007, pages 104–119, 2007.
[3]
J. Ferrante, K. J. Ottenstein, and J. D. Warren. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst., 9(3):319–349, July 1987.
[4]
M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
[5]
X. Ge and E. Murphy-Hill. Manual refactoring changes with automated refactoring validation. In Proc. the 36th Int’l Conf. on Softw. Eng. (ICSE 2014), pages 1095–1105, New York, NY, USA, 2014. ACM.
[6]
R. C. Gronback. Eclipse Modeling Project. Addison-Wesley, 2009.
[7]
M. Hafiz and J. Overbey. Refactoring myths. IEEE Softw., 32(6):39–43, Nov 2015.
[8]
M. Ichii, T. Myojin, Y. Nakagawa, M. Chikahisa, and H. Ogawa. A rule-based automated approach for extracting models from source code. In Proc. the 19th Working Conf. on Reverse Eng. (WCRE 2012), pages 308–317, 2012.
[9]
J. Kerievsky. Refactoring to Patterns. Prentice Hall, 2004.
[10]
J. C. King. Symbolic execution and program testing. Commun. of the ACM, 19(7):385–394, July 1976.
[11]
T. Mens, S. Demeyer, and D. Janssens. Formalising behaviour preserving program transformations. In Proc. the First International Conference on Graph Transformation (ICGT ’02), pages 286–301, 2002.
[12]
E. Murphy-Hill, C. Parnin, and A. P. Black. How we refactor, and how we know it. IEEE Trans. Softw. Eng., 38(1):5–18, 2012.
[13]
J. L. Overbey and R. E. Johnson. Differential precondition checking: A lightweight, reusable analysis for refactoring tools. In Proc. the 26th IEEE/ACM Int’l Conf. on Automated Softw. Eng. (ASE 2011), pages 303–312, 2011.
[14]
S. Person, M. B. Dwyer, S. Elbaum, and C. S. Pˇ asˇ areanu. Differential symbolic execution. In Proc. the 16th ACM SIGSOFT Int’l Symposium on Foundations of Softw. Eng.(FSE 2008), pages 226–237, 2008.
[15]
T. T. H. Phan, D. Shimbara, S. Sakaida, and H. Ogawa. POM/JLEC: An automatic program equivalence checker for java enterprise systems. SIGSOFT Softw. Eng. Notes, 40(6):1–5, Nov. 2015.
[16]
C. S. Păsăreanu and W. Visser. A survey of new trends in symbolic execution for software testing and analysis. Int’l J. Softw. Tools for Technol. Transfer, 11:339–353, 2009.
[17]
G. Soares, R. Gheyi, D. Serey, and T. Massoni. Making program refactoring safer. IEEE Softw., 27(4):52–57, 2010.
[18]
D. Steinberg, F. Budinsky, M. Paternostro, and E. Merks. EMF Eclipse Modeling Framework. Addison-Wesley, second edition edition, 2008.
[19]
The Object Management Group. Meta object facility (MOF) core specification, 2006.
[20]
The Object Management Group. Meta object facility (MOF) 2.0 query/view/transformation specification, 2008.
[21]
The Object Management Group. Architecture-driven modernization: Knowledge discovery meta-model (KDM), 2011.
[22]
K. Zhang and D. Shasha. Simple fast algorithms for the editing distance between trees and related problems. SIAM J. Comput., 18(6):1245–1262, 1989.

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
IWoR 2016: Proceedings of the 1st International Workshop on Software Refactoring
September 2016
40 pages
ISBN:9781450345095
DOI:10.1145/2975945
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 September 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Equivalence checking
  2. Refactoring
  3. Source code analysis

Qualifiers

  • Research-article

Conference

ASE'16
Sponsor:

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 153
    Total Downloads
  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media