Abstract

Identifying design patterns from source code is one of the most promising methods for improving software maintainability, reusing experience and facilitating software refactoring In the process of design pattern application, different methods of instantiation usually lead to generation of pattern variants. The detection of these variants from source code is a key point and a challenge of reverse engineering. In this paper, we propose an approach of detecting design pattern variants from source code based on constraints. More specifically, we first propose the method to describe the design pattern variants based on constraints, input the constraint conditions of design patterns into the library of pattern features, conduct static analysis on source code including analysis of control flow and data flow to obtain representations of pattern participants in the source code, conduct matching with the predicate matching tool, and then merge the instances by clustering analysis and obtain the final collection of pattern instances. Finally, a tool of extracting design pattern variants from source code is implemented and the feasibility of our approach is verified through the results of running it on three open source software.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call