helloworld : a wysiwyl case study analysis document · helloworld is a very simple system dedicated...
Post on 18-Jul-2020
20 Views
Preview:
TRANSCRIPT
HelloWorld : A WYSIWYL Case Study
Messir Analysis Document
- v 1.4.0 -
(Report type: Specification)
Laboratory for Advanced Software Systems
University of Luxembourg
Tuesday 20th February, 2018 - 18:48
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Purpose and recipients of the document . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Application Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Definitions, acronyms and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Document structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Domain Stakeholders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Creator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 System’s Actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Use Cases Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.1 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.2 Use Case Instance(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Environment Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 Local view 01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Actors and Interfaces Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 actMsrCreator Actor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 actYou Actor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Concept Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1 PrimaryTypes-Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.1 Local view 01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.2 Global view 01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Concept Model Types Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.1 Primary types - Class types descriptions . . . . . . . . . . . . . . . . . . . . 17
4.2.2 Primary types - Datatypes types descriptions . . . . . . . . . . . . . . . . . 19
4.2.3 Primary types - Association types descriptions . . . . . . . . . . . . . . . . . 19
4.2.4 Primary types - Aggregation types descriptions . . . . . . . . . . . . . . . . 19
4.2.5 Secondary types - Class types descriptions . . . . . . . . . . . . . . . . . . . 19
4.2.6 Secondary types - Datatypes types descriptions . . . . . . . . . . . . . . . . 19
4.2.7 Secondary types - Association types descriptions . . . . . . . . . . . . . . . . 19
4.2.8 Secondary types - Aggregation types descriptions . . . . . . . . . . . . . . . 19
4.2.9 Secondary types - Composition types descriptions . . . . . . . . . . . . . . . 19
5 Operation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1 Environment - Out Interface Operation Scheme for actMsrCreator . . . . . . . . . . . 21
5.1.1 Operation Model for oeCreateSystemAndEnvironment . . . . . . . . . . . . . 21
2
CONTENTS 3
5.2 Environment - Out Interface Operation Scheme for actYou . . . . . . . . . . . . . . 225.2.1 Operation Model for oeHelloWorld . . . . . . . . . . . . . . . . . . . . . . . 22
5.3 Environment - Actor Operation Scheme for actYou . . . . . . . . . . . . . . . . . . 235.3.1 Operation Model for init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.4 Primary Types - Operation Schemes for Class ctState . . . . . . . . . . . . . . . . . 245.4.1 Operation Model for init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.5 Primary Types - Operation Schemes for Datatypes . . . . . . . . . . . . . . . . . . . 255.6 Primary Types - Operation Schemes for Enumerations . . . . . . . . . . . . . . . . . 255.7 Secondary Types - Operation Schemes for Classes . . . . . . . . . . . . . . . . . . . 255.8 Secondary Types - Operation Schemes for Datatypes . . . . . . . . . . . . . . . . . 255.9 Secondary Types - Operation Schemes for Enumerations . . . . . . . . . . . . . . . 26
6 Test Model(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.1 Test Model for tc01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.1.1 Test Steps Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.1.2 Test Case Instance - instance01 . . . . . . . . . . . . . . . . . . . . . . . . . 29
7 Additional Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
A Messir Specification Files Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33A.1 File /src-gen/messir-spec/.views.msr . . . . . . . . . . . . . . . . . . . . . . . . . . . 33A.2 File /src-gen/messir-spec/concepts/concept.msr . . . . . . . . . . . . . . . . . . . . 33A.3 File /src-gen/messir-spec/environment/environment.msr . . . . . . . . . . . . . . . 34A.4 File /src-gen/messir-spec/test/instance.msr . . . . . . . . . . . . . . . . . . . . . . . 35A.5 File /src-gen/messir-spec/test/test.msr . . . . . . . . . . . . . . . . . . . . . . . . . 36A.6 File /src-gen/messir-spec/usecases/usecases.msr . . . . . . . . . . . . . . . . . . . . 37
List of Figures
2.1 lu.uni.lassy.excalibur.examples.helloworld Use Case Diagram: uc-ugHelloWorld . . . . . 112.2 lu.uni.lassy.excalibur.examples.helloworld Use Case Diagram: uc-oeCreateSystemAndEnvironment 122.3 lu.uni.lassy.excalibur.examples.helloworld Use Case Diagram: uc-oeHelloWorld . . . . . 142.4 lu.uni.lassy.excalibur.examples.helloworld Sequence Diagram: uci-ugHelloWorld-uciSimpleAndComplete
3.1 Environment Model - Local View 01 - HelloWorld actors with their interfa . . . . . . . 15
4.1 Concept Model - PrimaryTypes-Classes local view 01 - The ctState class . . . . . . . . 174.2 Concept Model - PrimaryTypes-Classes global view 01 - The ctState class and its relation 18
6.1 lu.uni.lassy.excalibur.examples.helloworld Sequence Diagram: tci-testcase01-instance01 29
4
Listings
5.1 Messir (MCL-oriented) specification of the operation oeCreateSystemAndEnvironment. 225.2 Messir (MCL-oriented) specification of the operation oeHelloWorld. . . . . . . . . . 235.3 Messir (MCL-oriented) specification of the operation init. . . . . . . . . . . . . . . 245.4 Messir (MCL-oriented) specification of the operation init. . . . . . . . . . . . . . . 256.1 Messir (MCL-oriented) specification of the test step tc01-ts01SystemCreation. . . . 276.2 Messir (MCL-oriented) specification of the test step tc01-ts02AskForHelloMessage. 28A.1 Messir Spec. file .views.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33A.2 Messir Spec. file concept.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33A.3 Messir Spec. file environment.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34A.4 Messir Spec. file instance.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35A.5 Messir Spec. file test.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36A.6 Messir Spec. file usecases.msr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5
6 LISTINGS
Chapter 1
Introduction
1.1 Overview
HelloWorld is a very simple system dedicated to any person who wants to receive an hello worldmessage. The HelloWorld system has for only objective to send on request an hello world message.
1.2 Purpose and recipients of the document
This document is an analysis document complying with the Messir methodology [1]. Its intentis to provide a first HelloWorld like WYSIWYL 1 example of a precise specification of the functionalproperties of the HelloWorld system. The graphical models and textual specification are made using
the Messir tool called Ex alibur and presented in [2].
The recipients of this document are:
• the Messir learners: this document is used as a contractual document jointly with any otherdocument considered as useful (as requirement elicitation document, . . . ) in order to have ahigher degree of precision in requirement description. It is also used as a basis document for theHelloWorld system validation using specification based testing.
• the HelloWorld system developers will use this document as the basis for development (mainlydesign, implementation, maintenance). It is also used for verification and validation usingtest plans defined using the analysis models described in this document and according to theMessir methodology.
1.3 Application Domain
The HelloWorld system belongs to the toy and academic systems domain. Its only objective is toillustrate the Messir method and tools for learning purpose.
1.4 Definitions, acronyms and abbreviations
N.A.
1What You See Is What You’ll Learn.
7
8 CHAPTER 1. INTRODUCTION
1.5 Document structure
The document structure is designed to be coherent with the Messir methodology [1]. Section 2provides a general description of the system purpose, its users, its environment and some general nonfunctional requirements. If applicable, a more detailed description of the non functional requirementsrelated to dependability are provided in Section 7. The system operations triggered by inputevents sent by the external actors belonging to the environment are described in Section 3. TheHelloWorld system concepts used to represent any persistent or transient information are defined inSection 4. The precise specification of the system operations in terms of system’s state changes, eventssent together with the constraints on the allowed sequences of system operations is described in Section5.
Chapter 2
General Description
2.1 Domain Stakeholders
All stakeholders of the system are detailed in this section. After a brief description of a stakeholder,its objectives are first stated. Thereafter, the responsibilities of the stakeholder are detailed whichhelp to achieve the stakeholder objectives to a certain degree. While the objectives characterize thegeneral problems addressed by the HelloWorld system, the responsibilities describe concrete actionsthat are expected from a stakeholder. Some of these responsibilities can be traced looking at the usecase described in Section 2, and hence must be supported by the HelloWorld system. All stakeholderslisted in this section have an interest in the system or are affected by the system in some way, butonly a subset of the stakeholders are directly involved in the use cases described. Let us remind thatuse case diagrams or descriptions are not Messir analysis phase mandatory outputs. They areproposed as informal means to help understanding the semantics of the system specification made ofthe mandatory analysis models which provide a complete executable specification.
2.1.1 You
You represents any person that has the capacity to send a message to the HelloWorld system. Theobjectives of You are:
• to send a message to the HelloWorld system in order to receive back an Hello World message.
In order to achieve these objectives, the responsibilities of You are:
• to be fully available and reliable.
2.1.2 Creator
A Creator1 is a technician that is installing the HelloWorld system on the infrastructure of thehosting company. The objectives of a Creator are:
• to install the HelloWorld system
• to define the values for the initial system’s state
• to define the values for the initial system’s environment
• to ensure the integration of the HelloWorld system with its initial environment
1InMessir each system has a creator stakeholder that is different from a technical system administrator. Althoughthose two roles can be fulfilled by the same person.
9
10 CHAPTER 2. GENERAL DESCRIPTION
In order to achieve these objectives, the responsibilities of a Creator are:
• provide the necessary data to the HelloWorld system for its initialization.
2.2 System’s Actors
The objective of this section is not to provide the full requirement elicitation document in this sectionbut to reuse a part of this document to provide a informal introduction to the Messir specificationof the system under development. The use case model is made of a use case diagrams modellingabstractly and informally the actors and their use cases together with a set of use cases descriptions.In addition, those diagrams and description tables are adapted to the Messir specification sinceactor and messages names together with parameters are partly adapted to be consistent with thespecification identifiers (see [1] for more details).
Among all the stakeholders presented in the previous section, we can determine two types ofdirect actors2:
• actYou: for you.
• actMsrCreator: for the Creator stakeholder.
2.3 Use Cases Model
This section contains the use cases elicited during the requirements elicitation phase. The use casesare textually described as suggested by the Messir method and inspired by the standard Cokburntemplate [3].
2.3.1 Use Cases
2.3.1.1 usergoal-ugHelloWorld
The goal is to install the HelloWorld system on its infrastructure and to exploit its capacities relatedto the simple display of an hello world message to make things happier !
Use-Case Description
Name ugHelloWorldScope systemLevel usergoal
Primary actor(s)
1 actYou[active]
Secondary actor(s)
1 actMsrCreator[active]
Goal(s) description
The goal is to install the HelloWorld system on its infrastructure and to exploit its capacities relatedto the simple display of an hello world message to make things happier !Reuse
1 oeCreateSystemAndEnvironment [1..1]
2 oeHelloWorld [1..*]
continues in next page . . .2The naming conventions in Messir propose to start each type name by lowercase letters indicating the meta
model type used (i.e. act for actors, ct for class type, . . . ). This convention eases the reading and also makes thetranslational semantics into Prolog code more straightforward.
2.3. USE CASES MODEL 11
. . . Use-Case Description table continuation
Protocol condition(s)
1 the HelloWorld system has never been deployed and used.
Pre-condition(s)
1 none
Main post-condition(s)
1 HelloWorld system has been created and has handled the request for an hello world messagefrom you.
Main Steps
a the actor actMsrCreator executes the oeCreateSystemAndEnvironment use caseb the actor actYou executes the oeHelloWorld use case
Steps Ordering Constraints
1 at least a2 if b then previously a
Figure 2.1 ugHelloWorld - user goal use case diagram
Figure 2.1: ugHelloWorld - user-goal use case diagram
2.3.1.2 subfunction-oeCreateSystemAndEnvironment
a subfunction representing a simple business process made of one activity dedicated to the systeminitialization
Use-Case Description
Name oeCreateSystemAndEnvironmentScope systemLevel subfunction
continues in next page . . .
12 CHAPTER 2. GENERAL DESCRIPTION
. . . Use-Case Description table continuation
Primary actor(s)
1 actMsrCreator[active]
Goal(s) description
a subfunction representing a simple business process made of one activity dedicated to the systeminitializationProtocol condition(s)
1 none
Pre-condition(s)
1 none
Main post-condition(s)
1 the HelloWorld system should exist and its coonected environment should include anactor of type actYou
Additional Information
none
Figure 2.2 shows the diagram for the oeCreateSystemAndEnvironment subfunction use case.
Figure 2.2: oeCreateSystemAndEnvironment - subfunction use case diagram
2.3.1.3 subfunction-oeHelloWorld
main sub function use case illustrating the trigerring of the hellow world functionality.
Use-Case Description
Name oeHelloWorldScope systemLevel subfunction
Primary actor(s)
1 actYou[active]
Goal(s) description
continues in next page . . .
2.3. USE CASES MODEL 13
. . . Use-Case Description table continuation
main sub function use case illustrating the trigerring of the hellow world functionality.
Protocol condition(s)
1 none
Pre-condition(s)
1 none
Main post-condition(s)
1 the system is expected to send an HelloWorld message to the trigerring actor.
Figure 2.3 shows the diagram for the oeHelloWorld subfunction use case.
14 CHAPTER 2. GENERAL DESCRIPTION
Figure 2.3: oeHelloWorld - subfunction use case diagram
2.3.2 Use Case Instance(s)
2.3.2.1 Use-Case Instance - uciSimpleAndComplete:ugHelloWorld
Simple and complete illustration of the HelloWorld user goal use case execution.
usergoal Use-Case Instance
Instantiated Use CaseugHelloWorld
Instance IDuciSimpleAndComplete
Remarks
a the first step is executed by the unique and always existing actMsrCreator actor instance(named here theCreator) requests the initialization of the system and its environment.The environment is made of two actor instances (one for each actor type).
b the second step request the system to answer by sending an Hello message.
Figure 2.4 shows the sequence diagram representing the a simple and complete use case instancefor the ugHelloWorld user goal use case.
Figure 2.4: uciSimpleAndComplete: a ugHelloWorld use case instance
Chapter 3
Environment Model
We provide below the view(s) defined for the Messir environment model (cf. [1]) of the system.
3.1 Local view 01
Figure 3.1 shows all the HelloWorld actors with their input and output interfaces. It is a "local"view because all the elements shown belong to the set of elements defining the system environment.
Figure 3.1: Environment Model - Local View 01. HelloWorld actors with their interfaces..
15
16 CHAPTER 3. ENVIRONMENT MODEL
3.2 Actors and Interfaces Descriptions
We provide for the given views the description of the actors together with their associated input andoutput interface descriptions.
3.2.1 actMsrCreator Actor
Actor
actMsrCreatorthe default Messir creator actor who is the first to initiate the system. The actMsrCreator
class introduces an init operation as all actor class type.This operation is necessary for instancecreation and initialization. the actMsrCreator input interface has no input message. This is oftenthe case since it is a logical actor of the Messir method that is mainly sending the first message inthe system’s history.OutputInterfaces
OUT 1 oeCreateSystemAndEnvironment():ptBoolean
is sent to initiate the system’s state class instance and to create the environment elements(e.g. actYou actor and and its interfaces).
3.2.2 actYou Actor
Actor
actYouIs representing any person that would like to receive an hello world message from the system.
OutputInterfaces
OUT 1 oeHelloWorld():ptBoolean
is sent to request the system to send back a kind hello message !.
InputInterfaces
IN 1 ieHelloWorld(AMessage:ptString):ptBoolean
the system sends a string message as an hello world welcome message.
Chapter 4
Concept Model
4.1 PrimaryTypes-Classes
4.1.1 Local view 01
Figure 4.1 shows all the classes belonging to the primary types. In this trivial example, there are nospecific classes. Thus only the default Messir ctState class belongs to this type category for theconcept model.
Figure 4.1: Concept Model - PrimaryTypes-Classes local view 01. The ctState class.
4.1.2 Global view 01
Figure 4.2 shows the only primary type class type Messir ctState class together with theenvironment elements. This view is global since it shows the Messir relationships between the classtypes of primary type and the environment.
4.2 Concept Model Types Descriptions
This section provides the textual descriptions of all the types defined in the concept model and thatcan be part of the graphical views provided.
4.2.1 Primary types - Class types descriptions
The table below is providing comments on the graphical views given for the class types of the primarytypes. Type logical operations are precisely specified in the operation model.
17
18 CHAPTER 4. CONCEPT MODEL
Figure 4.2: Concept Model - PrimaryTypes-Classes global view 01. The ctState class and itsrelationships with actors.
4.2. CONCEPT MODEL TYPES DESCRIPTIONS 19
Classes
ctStateused to represent HelloWorld global state variables.
attribute vpStarted: ptBoolean
The instance of a ctState is defined as a singleton of one value representing a protocolvariable indicating if the system is started or not. After system creation, there is alwaysonly one instance of this class.
operation init(AvpStarted:ptBoolean):ptBoolean
the ctState class introduces an operation for instance creation and initialization (thisis imposed for all primary class types by the Messir method [1]).
4.2.2 Primary types - Datatypes types descriptions
There are no elements in this category in the system analysed.
4.2.3 Primary types - Association types descriptions
There are no association types for the primary types.
4.2.4 Primary types - Aggregation types descriptions
There are no aggregation types for the primary types.
4.2.4.1 Primary types - Composition types descriptions
There are no composition types for the primary types.
4.2.5 Secondary types - Class types descriptions
There are no elements in this category in the system analysed.
4.2.6 Secondary types - Datatypes types descriptions
There are no elements in this category in the system analysed.
4.2.7 Secondary types - Association types descriptions
There are no association types for the secondary types.
4.2.8 Secondary types - Aggregation types descriptions
There are no aggregation types for the secondary types.
4.2.9 Secondary types - Composition types descriptions
There are no composition types for the secondary types.
20 CHAPTER 4. CONCEPT MODEL
Chapter 5
Operation Model
This section contains the operation schemes of each operation defined in either an actor, its outputinterface, in a primary or secondary type (class, datatype or enumeration types). The Messir OCLcode listing is joined to the comment table.
5.1 Environment - Out Interface Operation Scheme foractMsrCreator
5.1.1 Operation Model for oeCreateSystemAndEnvironment
The oeCreateSystemAndEnvironment operation has the following properties:
Operation
oeCreateSystemAndEnvironmentThis is an operation that creates the initial state for the system under development (i.e. SUD) and itsenvironment. This corresponds to all the actor instances, their input and output interfaces, and theirassociations with the system state elements. It has to be specified and be the first to be satisfied forany simulation (cf. simulation section of [1]).Return type
ptBoolean
Pre-Condition (protocol)
PreP 1 no additional condition is possible because the only available system element is one instanceof the outactMsrCreator !
Pre-Condition (functional)
PreF 1 Since oeCreateSystemAndEnvironment is a special Messir operation no pre-condition can beadded on system’s state. Only additional conditions could be put on input parameters, ifany.
Post-Condition (functional)
PostF 1 there exists a new initialized instance of the ctState class.PostF 2 the environment is made of one new and inistialized instance of the actYou class.PostF 3 there exists a new initialized instance of the actMsrCreator class. We see here the
limitations of the OCL specification of this special operation since this actor should be theone sending through its output interface this current operation !
Post-Condition (protocol)
continues in next page . . .
21
22 CHAPTER 5. OPERATION MODEL
. . . Operation table continuation
PostP 1 the system protocol’s boolean variable vpStarted must be equal to true to define thestatus from which all other operations might be allowed to be called. In our case, it isuseless of course since no operation is using it.
The listing 5.1 provides the Messir (MCL-oriented) specification of the operation.
1
2 /* Pre Protocol:*/
3 preP{true}
4
5 /* Pre Functional:*/
6 preF{true}
7
8 /* Post Functional:*/
9 postF{let TheState:ctState in
10 let AactMsrCreator:actMsrCreator in
11
12 /* Post Functional:*/
13 /* PostF01 */
14 TheState.init(true)
15
16 /* PostF02 */
17 and TheState.rnactYou->size() = 1
18 and TheState.rnactYou
19 ->forAll(cca:actYou | cca.init())
20
21 /* PostF03 */
22 and AactMsrCreator.init()}
23
24 /* Post Protocol:*/
25 postP{ /* Post Protocol:*/
26 /* PostP01 */
27 let TheState:ctState in
28 TheState.vpStarted = true}
Listing 5.1: Messir (MCL-oriented) specification of the operation oeCreateSystemAndEnvironment.
5.2 Environment - Out Interface Operation Scheme for actYou
5.2.1 Operation Model for oeHelloWorld
The oeHelloWorld operation has the following properties:
Operation
oeHelloWorldThis system operation is triggered by the YouAsActor actor (sending the corresponding output messagethrough its output interface) and has for objective to make the system send to this same actor an hellomessage.Return type
ptBoolean
Pre-Condition (protocol)
PreP 1 The system should be started. This is represented by the fact that the boolean protocolvariable vpStarted (part of the ctState only instance attribute value) is equal to true.
continues in next page . . .
5.3. ENVIRONMENT - ACTOR OPERATION SCHEME FOR ACTYOU 23
. . . Operation table continuation
Pre-Condition (functional)
PreF 1 Always true. Thus, no restriction for this simple operation.
Post-Condition (functional)
PostF 1 a ’hello world’ message is sent to the calling actor through its input interface accesible bynavigation from the current output interface.
Post-Condition (protocol)
PostP 1 The system stays in the same life cycle state, so no modification of the protocol statevariables.
The listing 5.2 provides the Messir (MCL-oriented) specification of the operation.
1
2 /* Pre Protocol:*/
3 preP{/* Pre Protocol:*/
4 /* PreP01 */
5 let AvpStarted: ptBoolean in
6 self.rnActor.rnSystem.vpStarted = AvpStarted
7 and AvpStarted = true}
8
9 /* Pre Functional:*/
10 preF{true}
11
12 /* Post Functional:*/
13 postF{let TheactYou:actYou in
14 let AptString:ptString in
15 /* Post Functional:*/
16 /* PostF01 */
17 AptString = 'Hello World !'
18 and self.rnActor.InterfaceIN = TheactYou
19 and TheactYou.rnInterfaceIN^ieHelloWorld(AptString)}
20
21 /* Post Protocol:*/
22 postP{ true}
Listing 5.2: Messir (MCL-oriented) specification of the operation oeHelloWorld.
5.3 Environment - Actor Operation Scheme for actYou
5.3.1 Operation Model for init
The init operation has the following properties:
Operation
initOperation used for the initialization of actor instance of class actYou. The specification of thoseoperations is optional since there are default specifications for them. Anyhow, in some advancedsystems it might be necessary to have a specific semantics for them. In this simple example, you canfind the default specification.Return type
ptBoolean
Pre-Condition (protocol)
continues in next page . . .
24 CHAPTER 5. OPERATION MODEL
. . . Operation table continuation
PreP 1 since logical operations are not system operations triggered by actor’s output messages, theycannot be constraigned by protocol variables. They do not participate in the system’s lifecycle.
Pre-Condition (functional)
PreF 1 no pre-functional condition ! true as pre functional condition which means that this booleanoperation should be total over its domain made of the system state values and inputparameter values.
Post-Condition (functional)
PostF 1 The current actYou instance should be a new instance in the post state of the system.PostF 2 It should also exist in the post state one input interface and one output interface for this
actor that should be associated to this actor instance. As a boolean operation it shouldreturn true when the complete post condition is satified and false if not.
Post-Condition (protocol)
PostP 1 creating a actYou instance has no impact on the system’s life cycle.
The listing 5.3 provides the Messir (MCL-oriented) specification of the operation.
1
2 /* Post Functional:*/
3 postF{if (
4 /* Post Functional:*/
5 /* Post F01 */
6 (Self.oclIsNew and self = Self)
7 /* Post F02 */
8 and self.InterfaceIN.oclIsNew()
9 and self.InterfaceOUT.oclIsNew()
10 )
11 then (result = true)
12 else (result = false)
13 endif}
Listing 5.3: Messir (MCL-oriented) specification of the operation init.
5.4 Primary Types - Operation Schemes for Class ctState
5.4.1 Operation Model for init
The init operation has the following properties:
Operation
initSpecify the initialization of an instance of class ctState.
Parameters
1 AvpStarted: ptBooleanthe initial value for the protocol variable
Return type
ptBoolean
Pre-Condition (protocol)
continues in next page . . .
5.5. PRIMARY TYPES - OPERATION SCHEMES FOR DATATYPES 25
. . . Operation table continuation
PreP 1 Since logicial operations are not system operations triggered by actor output messages, theycannot be constrained by protocol variables. They do not participate to the system’s lifecycle.
Pre-Condition (functional)
PreF 1 No pre-functional condition ! true as pre functional condition, which means that thisboolean operation should be total over its domain made of the system state values andinput parameter values.
Post-Condition (functional)
PostF 1 The current actYou instance should be a new instance in the post state of the system whoseattribute value should be equal to the value given as parameter. As a boolean operation itshould be return true when the complete post condition is satified, or false otherwise.
Post-Condition (protocol)
PostP 1 creating a ctState isntance has no impact on the system’s life cycle.
The listing 5.4 provides the Messir (MCL-oriented) specification of the operation.
1
2 /* Post Functional:*/
3 postF{if
4 (
5 /* Post Functional:*/
6 /* Post F01 */
7 self.vpStarted = AvpStarted
8 and (Self.oclIsNew and self = Self)
9 )
10 then (result = true)
11 else (result = false)
12 endif}
Listing 5.4: Messir (MCL-oriented) specification of the operation init.
5.5 Primary Types - Operation Schemes for Datatypes
There are no elements in this category in the system analysed.
5.6 Primary Types - Operation Schemes for Enumerations
There are no elements in this category in the system analysed.
5.7 Secondary Types - Operation Schemes for Classes
There are no elements in this category in the system analysed.
5.8 Secondary Types - Operation Schemes for Datatypes
There are no elements in this category in the system analysed.
26 CHAPTER 5. OPERATION MODEL
5.9 Secondary Types - Operation Schemes for Enumerations
There are no elements in this category in the system analysed.
Chapter 6
Test Model(s)
6.1 Test Model for tc01
A complete test case that covers all the system operations and output messages defined for the system.
6.1.1 Test Steps Specification
6.1.1.1 tc01-ts01SystemCreation-actMsrCreator.outactMsrCreator.oeCreateSystemAndEnvironment
The tc01-ts01SystemCreation-actMsrCreator.outactMsrCreator.oeCreateSystemAndEnvironment
has the following properties:
Test Step
ts01SystemCreationtest of the initialization of the system and its environment.
Test Sent Message
TSM 1out:Creator
sends to system
actMsrCreator.outactMsrCreator.oeCreateSystemAndEnvironment ()
The listing 6.1 provides the Messir (MCL-oriented) specification of the test step.
1
2 variables{
3 Creator:actMsrCreator
4 }
5
6 constraints{
7 true
8 }
9
10 oracle{
11 constraints{
12 true
13 }
27
28 CHAPTER 6. TEST MODEL(S)
14 }
Listing 6.1: Messir (MCL-oriented) specification of the test step tc01-ts01SystemCreation.
6.1.1.2 tc01-ts02AskForHelloMessage-actYou.outactYou.oeHelloWorld
The tc01-ts02AskForHelloMessage-actYou.outactYou.oeHelloWorld has the followingproperties:
Test Step
ts02AskForHelloMessageHello message request by the user.
Test Sent Message
TSM 1out:TheActor
sends to system
actYou.outactYou.oeHelloWorld ()
Variables
V 1 TheActor:lu.uni.lassy.excalibur.examples.helloworld.environment.actYouit is a actYou actor who sends the message.
V 2 AMessage:lu.uni.lassy.messir.libraries.primitives.ptStringthe message sent to the actYou actor as a reaction to his message request.
Constraints
C 1 TheActor is any actYou instance existing in the environment. It is thus expected thatthere exists at least one.
Oracle Variables
OV 1 AMessage:lu.uni.lassy.messir.libraries.primitives.ptStringthe message sent to the actYou actor as a reaction to his message request.
Oracle Constraints
OC 1 the AMessage value is equal to the primitive string ’HelloWorld !OC 2 this message is received by the calling actor as a reaction to the triggering.
The listing 6.2 provides the Messir (MCL-oriented) specification of the test step.
1
2 variables{
3 TheActor:actYou
4 }
5
6 constraints{
7 TheActor=TheSystem.rnactYou->any2(true)
8 }
9
10 oracle{
11 variables{
12 AMessage: ptString
13 }
14 constraints{
15 AMessage = 'HelloWorld !'
6.1. TEST MODEL FOR TC01 29
16 TheActor.actYou.inactYou.ieHelloWorld(AMessage)
17 }
18 }
Listing 6.2: Messir (MCL-oriented) specification of the test step tc01-ts02AskForHelloMessage.
6.1.2 Test Case Instance - instance01
Figure 6.1 shows the sequence diagram illustrating a simple and complete test case instance execution.
Figure 6.1: Simple and complete test case instance execution diagram
30 CHAPTER 6. TEST MODEL(S)
Chapter 7
Additional Constraints
This section of this standard document is here to allow to include the necessary constraints that cannotbe expressed using the Messir models. Nevertheless, since HelloWorld case study is a toy casestudy, we do not provide any additional constraints. Thus, we leave this section empty.
31
32 CHAPTER 7. ADDITIONAL CONSTRAINTS
Appendix A
Messir Specification Files Listing
A.1 File ./src-gen/messir-spec/.views.msr
1 //
2 //DON'T TOUCH THIS FILE !!!
3 //
4 package uuid7d1dd70863d942f1ac69c7f02dac9e6f {
5 Concept Model {}
6 }
Listing A.1: Messir Spec. file .views.msr.
A.2 File ./src-gen/messir-spec/concepts/concept.msr
1 package lu.uni.lassy.excalibur.examples.helloworld.concepts{
2
3 import lu.uni.lassy.messir.libraries.primitives
4
5 Concept Model {
6
7 Primary Types {
8
9 state class ctState {
10 attribute vpStarted: ptBoolean
11 operation init(AvpStarted:ptBoolean) : ptBoolean
12
13 }
14
15 }
16 }
17
18 Operation Model {
19
20 operation: ctState.init(AvpStarted:ptBoolean):ptBoolean
21 {postF{
22 if
23 (
24 /* Post Functional:*/
25 /* Post F01 */
26 self.vpStarted = AvpStarted
27 and (Self.oclIsNew and self = Self)
28 )
29 then (result = true)
30 else (result = false)
31 endif }
32
33 prolog {"src/Operations/Concepts/PrimaryTypesClasses/PrimaryTypesClasses-ctState-init.pl"}
34 }
35 }
33
34 APPENDIX A. MESSIR SPECIFICATION FILES LISTING
36 }
Listing A.2: Messir Spec. file concept.msr.
A.3 File ./src-gen/messir-spec/environment/environment.msr
1 package lu.uni.lassy.excalibur.examples.helloworld.environment {
2
3 import lu.uni.lassy.messir.libraries.primitives
4 import lu.uni.lassy.excalibur.examples.helloworld.concepts
5
6 /******************************************************/
7 /********* ENVIRONMENT MODEL **********************/
8 /******************************************************/
9
10 Environment Model {
11
12 actor actYou role rnactYou cardinality [0..*]{
13
14 operation init():ptBoolean
15
16 output interface outactYou{
17 operation oeHelloWorld():ptBoolean
18 }
19
20 input interface inactYou{
21 operation ieHelloWorld(AMessage:ptString):ptBoolean
22 }
23 }
24
25 actor actMsrCreator role rnactMsrCreator cardinality [1..1] {
26
27 output interface outactMsrCreator {
28 operation oeCreateSystemAndEnvironment():ptBoolean
29 }
30
31 input interface inactMsrCreator {
32 }
33 }
34 }
35
36 /******************************************************/
37 /********* OPERATION(S) - SYSTEM **********************/
38 /******************************************************/
39
40 Operation Model {
41
42 operation: actYou.outactYou.oeHelloWorld():ptBoolean
43 {
44 preP{
45 /* Pre Protocol:*/
46 /* PreP01 */
47 let AvpStarted: ptBoolean in
48 self.rnActor.rnSystem.vpStarted = AvpStarted
49 and AvpStarted = true
50 }
51 preF{true}
52
53 postF{
54 let TheactYou:actYou in
55 let AptString:ptString in
56 /* Post Functional:*/
57 /* PostF01 */
58 AptString = 'Hello World !'
59 and self.rnActor.InterfaceIN = TheactYou
60 and TheactYou.rnInterfaceIN^ieHelloWorld(AptString)
61 }
62 postP{true}
63
A.4. FILE /SRC-GEN/MESSIR-SPEC/TEST/INSTANCE.MSR 35
64 prolog{"src/Operations/Environment/OUT/ctYouAsActorOutputInterface-oeHelloWorld.pl"}
65 }
66 /******************************************************/
67
68 operation: actMsrCreator.outactMsrCreator.oeCreateSystemAndEnvironment():ptBoolean
69 {preP{true}
70 preF{true}
71
72 postF{
73 let TheState:ctState in
74 let AactMsrCreator:actMsrCreator in
75
76 /* Post Functional:*/
77 /* PostF01 */
78 TheState.init(true)
79
80 /* PostF02 */
81 and TheState.rnactYou->size() = 1
82 and TheState.rnactYou
83 ->forAll(cca:actYou | cca.init())
84
85 /* PostF03 */
86 and AactMsrCreator.init()
87 }
88 postP{
89 /* Post Protocol:*/
90 /* PostP01 */
91 let TheState:ctState in
92 TheState.vpStarted = true
93 }
94 prolog{"src/Operations/Environment/OUT/ctMsrCreatorOutputInterface-oeCreateSystemAndEnvironment.pl"
}}
95 /******************************************************/
96 /********* OPERATION(S) - ACTOR **********************/
97 /******************************************************/
98
99 operation: actYou.init():ptBoolean
100 {
101 postF{
102 if (
103 /* Post Functional:*/
104 /* Post F01 */
105 (Self.oclIsNew and self = Self)
106 /* Post F02 */
107 and self.InterfaceIN.oclIsNew()
108 and self.InterfaceOUT.oclIsNew()
109 )
110 then (result = true)
111 else (result = false)
112 endif
113 }
114 }
115 }
116 }
Listing A.3: Messir Spec. file environment.msr.
A.4 File ./src-gen/messir-spec/test/instance.msr
1 package lu.uni.lassy.excalibur.examples.helloworld.tests.instances {
2
3 import lu.uni.lassy.messir.libraries.primitives
4 import lu.uni.lassy.excalibur.examples.helloworld.environment
5 import lu.uni.lassy.excalibur.examples.helloworld.concepts
6 import lu.uni.lassy.excalibur.examples.helloworld.tests
7
8 Test Model {
9
10 test case instance instance01:tc01{
36 APPENDIX A. MESSIR SPECIFICATION FILES LISTING
11
12 test step instance tsi01:tc01.ts01SystemCreation {
13 variables {
14 Creator: tc01.ts01SystemCreation.Creator = "theCreator"
15 }
16 oracle {
17 satisfaction = "true"
18 }
19 test results { pre-protocol = "true"
20 pre-functional = "true"
21 post-functional = "true"
22 }
23 }
24 test step instance tsi02:tc01.ts02AskForHelloMessage {
25 variables {
26 you: tc01.ts02AskForHelloMessage.TheActor = "you"
27 }
28 oracle {
29 satisfaction = "true"
30 received message {
31 AMessage : tc01.ts02AskForHelloMessage.AMessage = 'HelloWorld !'
32 tsi02.you received from system actYou.inactYou.ieHelloWorld(AMessage)
33 }
34 }
35 test results { pre-protocol = "true"
36 pre-functional = "true"
37 post-functional = "true"
38 }
39 }
40
41 }
42 }
43 }
Listing A.4: Messir Spec. file instance.msr.
A.5 File ./src-gen/messir-spec/test/test.msr
1 package lu.uni.lassy.excalibur.examples.helloworld.tests {
2
3 import lu.uni.lassy.messir.libraries.primitives
4 import lu.uni.lassy.excalibur.examples.helloworld.environment
5 import lu.uni.lassy.excalibur.examples.helloworld.concepts
6
7 Test Model{
8 test case tc01 order 01{
9 //---------------------------------------------------------------------
10 test step ts01SystemCreation order 01 {
11 variables{
12 Creator:actMsrCreator
13 }
14 constraints{true}
15 test message{
16 out: Creator sends to system
17 actMsrCreator.outactMsrCreator.oeCreateSystemAndEnvironment()
18 }
19 oracle{
20 constraints{
21 true
22 }
23 }
24 }
25 //---------------------------------------------------------------------
26 test step ts02AskForHelloMessage order 02 {
27 variables{
28 TheActor:actYou
29 }
30 constraints{
31 TheActor=TheSystem.rnactYou->any2(true)
A.6. FILE /SRC-GEN/MESSIR-SPEC/USECASES/USECASES.MSR 37
32 }
33 test message{
34 out:TheActor sends to system actYou.outactYou.oeHelloWorld()
35 }
36 oracle{
37 variables{
38 AMessage: ptString
39 }
40 constraints{
41 AMessage = 'HelloWorld !'
42 TheActor.actYou.inactYou.ieHelloWorld(AMessage)
43 }
44 }
45 }
46 //---------------------------------------------------------------------
47 }
48 }
49 }
Listing A.5: Messir Spec. file test.msr.
A.6 File ./src-gen/messir-spec/usecases/usecases.msr
1 package lu.uni.lassy.excalibur.examples.helloworld.usecases {
2
3 import lu.uni.lassy.messir.libraries.primitives
4 import lu.uni.lassy.excalibur.examples.helloworld.environment
5
6 Use Case Model {
7
8 use case system subfunction oeCreateSystemAndEnvironment() {
9 actor actMsrCreator[primary,active]
10 }
11
12 use case system subfunction oeHelloWorld() {
13 actor actYou[primary,active]
14 returned messages {
15 ieHelloWorld(AMessage) returned to actYou
16 }
17
18 }
19 use case system usergoal ugHelloWorld() {
20 actor actYou[primary,active]
21 actor actMsrCreator[secondary,active]
22 reuse oeCreateSystemAndEnvironment[1..1]
23 reuse oeHelloWorld[1..*]
24
25 step a: actMsrCreator
26 executes oeCreateSystemAndEnvironment()
27
28 step b: actYou
29 executes oeHelloWorld
30
31 ordering constraint "at least a"
32 ordering constraint "if b then previously a"
33 }
34
35 use case instance uciSimpleAndComplete : ugHelloWorld {
36 actors {
37 theCreator : actMsrCreator
38 you : actYou
39 }
40 use case steps {
41 theCreator executed instanceof subfunction oeCreateSystemAndEnvironment{
42 }
43 you executed instanceof subfunction oeHelloWorld{
44 oeHelloWorld('HelloWorld !') returned to you
45 }
46 }
38 APPENDIX A. MESSIR SPECIFICATION FILES LISTING
47 }
48
49 // use case instance uciSimpleAndComplete : ugHelloWorld {
50 // related test case instance lu.uni.lassy.excalibur.examples.helloworld.tests.instances.
instance01
51 }
52 }
Listing A.6: Messir Spec. file usecases.msr.
A.6. FILE /SRC-GEN/MESSIR-SPEC/USECASES/USECASES.MSR 39
40 APPENDIX A. MESSIR SPECIFICATION FILES LISTING
Bibliography
[1] Guelfi, N.: Messir: A Scientific Method for the Software Engineer. to be published (2017)
[2] Capozucca, A., Ries, B.: Excalibur - Model-Driven Tools for Domain-Specific Languages andMethods. to be published (2017)
[3] Armour, F., Miller, G.: Advanced Use Case Modeling: Software Systems. Addison-Wesley (2001)
41
top related