Context: Refactoring is the art of modifying the design of a system without altering its behavior. The idea is to reorganize variables, classes and methods to facilitate their future adaptations and comprehension. As the concept of behavior preservation is fundamental for refactoring, several studies, using formal verification, language transformation and dynamic analysis, have been proposed to monitor the execution of refactoring operations and their impact on the program semantics. However, there is no existing study that examines the available behavior preservation strategies for each refactoring operation. Objective: This paper identifies behavior preservation approaches in the research literature. Method: We conduct, in this paper, a systematic mapping study, to capture all existing behavior preservation approaches that we classify based on several criteria including their methodology, applicability, and their degree of automation. Results: The results indicate that several behavior preservation approaches have been proposed in the literature. The approaches vary between using formalisms and techniques, developing automatic refactoring safety tools, and performing a manual analysis of the source code. Conclusion: Our taxonomy reveals that there exist some types of refactoring operations whose behavior preservation is under-researched. Our classification also indicates that several possible strategies can be combined to better detect any violation of the program semantics.
翻译:重构内容: 重构内容是修改系统设计而不会改变其行为方式的艺术, 目的是重组变量、 类别和方法, 便利其未来的适应和理解。 由于行为保护的概念对于再构内容至关重要, 利用正式的核查、 语言转换和动态分析, 提出了几项研究, 以监测再构内容操作的实施及其对程序语义学的影响。 但是, 目前还没有一项研究, 研究每项再构内容操作的现有行为保护策略。 目标: 本文确定了研究文献中的行为保护方法 。 方法: 我们在本文件中进行系统绘图研究, 以捕捉我们根据若干标准分类的所有现有行为保护方法, 包括方法、 适用性和自动化程度 。 结果: 结果表明, 文献中提出了几种行为保护方法。 使用形式主义和技术、 开发自动再构件安全工具, 和对源代码进行手工分析的方法各不相同 。 结论: 我们的分类表明, 有一些类型的再构件操作, 其行为保护正在更好地研究之中。 我们的分类还表明, 某些可能的战略可以用来测量任何侵犯程序 。