A static reference flow analysis to understand design pattern behavior

Design patterns are actively used by developers expecting that they provide the design with good quality such as flexibility and reusability. However, according to industrial reports on the use of design patterns, the expectation is not always realized . Especially, points out two causes of inappropriately applied patterns from a case study on a large commercial project: developers inexperienced in design patterns and no connection with project requirement. Wrong decisions on the use of design patterns make the program difficult to understand, and refactoring the program to improve the underlying structure, especially without documentation, can be very tricky. To eliminate wrongly applied patterns or document important decisions automatically, design pattern recovery is important for not only the development phase but also the maintenance phase. Many design pattern recovery approaches focus on structural characteristics and do not touch set-up behavior that configures links between participants and precedes pattern behavior. To detect design patterns implemented in program code more precisely and to show their behavior, we analyze program at expression level. Our approach is based on statically approximating run time behavior among pattern participants. For this, a static program analysis technique is used. Many static analysis techniques for object-oriented languages exist mainly for optimizing compiler in program analysis area.