Design patterns solve recurring design problems. One of the best practices, to solve a whole problem in a specific context, is to apply patterns in the form of a collection of related patterns, ie, a pattern language (PL). However, with the rapid growth of the number of patterns and their interrelationships in PLs and because manual verification of the applied PLs is a tedious and error‐prone task, when designing in PL‐based fashion, there is a need for tool support to verify the applied PLs. In our previous work, aimed at automating the development process of PL verification tools, a PL formalism was presented. This paper, based on the presented formalism, describes a framework called Pattern Language Verifier Generator (PLVGen) that automatically generates a pattern language verifier (PLV) for any given PL assuming its constituent patterns are represented in the Unified Modeling Language (UML). Using a modelware approach, two metamodels named pattern language specification language (PLSL) and pattern specification language (PSL) are developed to model the given PL and its patterns, respectively. By getting the models of a PL and its patterns, PLVGen automatically generates an epsilon validation language (EVL) module representing the expected PLV. By launching PLV, the applied PL on a UML model will be verified. To evaluate the applicability of PLVGen in practice, we automatically generated three PLVs. The statistics regarding the generated PLVs, as case studies, illustrate the scalability of PLVGen. Compared with similar tools, the generated PLVs are more portable, transparent, and free of ambiguities.
Context: Software patterns are solutions to recurring design problems. Patterns behave socially in the forms of Pattern Languages (PLs) to resolve problems. In a simple statement, a PL is a network of related patterns which provides a step-by-step process to solve a given problem in a specific context. Despite the popularity of applying PLs in practice, lack of formal basis on the patterns’ inter-relationships in general, and PLs in particular, makes development of supporting tools difficult.
Objective: Based on the algebra of design patterns, we aimed at presenting a new formalism for patterns and PLs.
Method: We revised and extended the Graphic extension of EBNF (GEBNF) and applied it to model Unified Modeling Language (UML) class and sequence diagrams which are required to model the popular design patterns. Also, we presented the formal semantics of commonly used patterns’ inter-relationships which pave the way for presenting our PL formalism. To show the applicability of our presented formalism on patterns and PLs, we presented the formal model of the Broker PL as a case study.
Results: Use of the presented formalism to model patterns and PLs will make them more expressive, readable, and understandable as well.
Conclusion: We have proposed a formalism for defining a PL in a more accurate manner. This formalism facilitates formal verification of patterns and PLs, particularly when it is intended to build a tool for such verification.