• No results found

The final stage in Software Design Pattern Engineering is that of pattern publication. §9.5 already demonstrated how Frigg can be used to view Freyja encoded pattern documents, an example of which was provided in Listing 9.6. Frigg can also be used to convert the templates into other document-markup formats, for example LATEX, Markdown, and Org-Mode. Appendix A contains the result of converting the patterns in this chapter to the different supported formats. Through automatic generation of the pattern document to multiple documentation formats comes ease of distribution of the pattern to different media.

9.8

Summary

This chapter presented a tutorial demonstrating how the various contributions in this thesis are used for pattern engineering. Specifically, the contributions were used to

engineertwo example patterns for the problem of authentication: Authentication

using Shibboleths and Authentication using ID Cards. Sif was used dur- ing the creation phase to guide development of and machine check a requirements model describing the pattern. The problem description was shared between the two models. Freyja facilitated the encoding of the pattern document and requirements model in a machine readable and checkable format. The resulting pattern document and its encoded information was used by Frigg during the evaluation process. Here 156

9.8. Summary Frigg was used to machine read and check the documents. Combination of these

C

h

a

p

t

e

r

10

NovoGRL: Re-Targeting the GRL

for new Domains

The GRL is an existing GOML that presents a visual modelling language—Chapter 3 §3.2. However, when using a such a language with visual language constructs, a more formal language-driven treatment for DSML creation is harder to produce. This arises due to the disconnect between the notation used for the DSML, and its formalisation and transformation into a host language model instance.

This chapter introduces NovoGRL a language oriented re-engineering of a subset of the GRL. Specifically, this framework facilitates the provisioning of new semantic overlays allowing for the language to be re-targeted for new modelling domains. This framework is used for the construction of DSMLs that are structurally equivalent to the GRL but provide different semantic constructs.

In addition to the description of NovoGRL, two DSMLs are presented as case studies to illustrate how the original GRL can be re-targeted for different domains. The DSMLs presented are: (a) a replication of the GRL itself; and (b) a language used for modelling academic paper writing. NovoGRL and the languages described in this chapter are available online [dMH15e]. Further, the DSML that replicates the GRL was used as the meta-modelling language to which Sif model instances are interpreted to.

10. NovoGRL

10.1

Making the GRL a Language

Goal Graphsare a formal model for describing goal models as directed graphs where each

node represents a goal, and the edges the links between each goal [Gio+03]. Giorgini et al. [Gio+03] provide a formal definition for these goal-graphs.

Definition 12 (Goal Graph). Formally a Goal-Graph is a directed graph described as a pairing〈G,R〉, whereGis a set of goals, andR is a set of goal relations overG. Given the relation({g1, . . . , gn})−→r gin Rwheregi∈G. Nodes to the left of the relation are described as source goals, and the goal on the right is the target goal.

Using these goal-graphs, Amyot et al. [Amy+10] derived a series of evaluation tech- niques to calculate model satisfaction.

The GRL is a graphical modelling language using visual cues to illustrate concepts, and fixates upon the idea that modellers will use a visual means to both construct, view, and reason about theirgoal-graphs. However, these visual cues and language constructs

are harder to reason about formally and also mechanically [MC01]. Furthermore, when using visual modelling languages, the creation of a DSML must be performed through adhoc methods unless the modelling language’s tooling explicitly supports DSML creation. When working with GOMLs, the language syntax and type-system are presented visually and their representation in code buried alongside the evaluation semantics in the tooling.

To address these issues one has to first think of the graphical notation used as an alternative view of the model. Programming languages are comprised of: an abstract syntax to describe language expressions; a type-system to ensure the creation of well- formed expressions; and semantics to ensure the correct execution of expressions. These notions are linked together in the tooling provided for the language. Chapter 4 introduced the idea of theWell-Typed Interpreterand how a DSL can be modelled

as an EDSL within Idris, providing static compile-time correctness by construction

guarantees over the program and language implementation. This approach illustrated how the language’s syntax, typing rules, and interpretation can be formally modelled and implemented within the same system. Further, the Idris language has built in support for tactic style theorem proving and auto implicit argument construction. Use of these abilities further enables compile time checks to be performed for properties of the language that enhances thecorrectness by constructionguarantees made. With a

language-based approach to DSML construction, the GRL can be re-envisaged as a 160

10.1. Making the GRL a Language declarative language (in the style of theWell Typed Interpreter[AC99]) from which

goal-graphsare constructed.

The interest in this thesis, however, is not with the (re)construction of the GRL

per sebut rather its use as a meta-modelling language for constructing DSMLs, and

DSMLs primarily for reasoning about design patterns. Work by Brady and Hammond [BH06] has shown how a verified staged interpreter can be written in a dependently typed language to translate concepts between domains (i.e. languages)andprovide correctness by constructionguarantees for these translations. Such an approach allows for

the structural equivalence between the two languages to be shown more formally, and more importantly enforced during implementation. This approach can be combined with theWell-Typed Interperterapproach to allow for a more formal description of

the re-domaining of the GRL to occur if the interpretation between domains can be specified. GRL PML G? GLang GModel Interp. GExpr Check/Insert Fail GModel Interp. PML

Figure 10.1: Schematic illustrating how DSML relate to, and are interpreted into, No- voGRL goal models.

However, this approach requires that for every DSML constructed, a bespoke interpreter must also be constructed. To reduce the effort in constructing multiple DSMLs, a two-stage interpreter is used. At different stages of interpretation different

10. NovoGRL

properties on the resulting intermediate forms can be checked. Figure 10.1 illustrates this two stage process.

DSMLs are first translated into an intermediate representation that captures lan- guage constructs common to all DSMLs: GExpr. This transformation is achieved using transformation functions unique to the DSML. The resulting intermediate rep- resentation provides the instructions for constructing the GRL goal-graph using an internal modelling language: G?. A goal-graph constructed using G?is evaluated for satisfaction using known techniques [Amy+10]. Interpreting down to a common rep- resentation, allows for the construction of goal-graphs to be reasoned about regardless of the DSMLs original language constructs.

Here DSMLs are defined as a variation of the GRL that uses structurally similar language constructs to the GRL but with semantic constructs unique to the domain of interest. The languages are structurally isomorphic, but semantically dimorphic.. Rather than modelling and constructing a separate evaluator for the DSML, interpret- ation semantics can be presented that map how the constructs from the DSML are translated into those from the GRL.

Note. For this initial attempt a subset of the GRL was chosen to be implemen- ted. The framework does not support the GRL concepts of actors, and dependen- cies between two actors. The evaluation strategy supported is qualitative, quantitative evaluations are not supported.