Abstract
As part of the reengineering process, the identification of design patterns offers important information to the designer. In fact, the identification of implemented design patterns could be useful for the comprehension of an existing design and provides the grounds for further code/design improvements. However, existing pattern detection approaches generally have problems in detecting patterns in an optimal manner. They either detect exact pattern instantiations or have no guidelines in deciding which pattern to look for first amongst the various patterns. To overcome these two limitations, we propose to optimize any pattern detection approach by preceding it by a preliminary "sniffing" step that detects the potential existence of patterns and orders the candidate patterns in terms of their degree of resemblance to design fragments. Our approach uses design metrics to characterize the structure and semantics of the various design patterns.