RE: Re: Octopus



RE: Re: Octopus

From: Jordi Cabot Sagrera ^lt;jcabot@uoc.edu>
Date: Tue 31 Jan 2006 - 08:56:18 GMT
Message-ID: <3285618.1138697805187.JavaMail.root@panama>

Dear all,

In fact, the problem of "when" it is required to check a given invariant is a common problem to almost all tools that generate code form OCL constraints.

As Jos says, checking the invariants “always” is really inefficient, so we should check them only after changes (creation of new objects or links, update of attributes,...) that can induce a constraint violation.

Besides, this is not the only problem we must take into account.  Even if we know that a constraint needs to be verified, we should not verify the constraint over all instances of the context type, but only over those instances affected by the changes.

You may find interesting to read the following papers, explaining in detail the above ideas:

Jordi Cabot, Ernest Teniente: Computing the Relevant Instances That May Violate an OCL Constraint. CAiSE 2005, LNCS 3520, pp. 48-62. 

Jordi Cabot, Ernest Teniente: Determining the Structural Events That May Violate an Integrity Constraint. UML 2004, LNCS 3273, pp. 320-334.

Do not hesitate to contact me for further information.

Regards,

Jordi Cabot Sagrera
Universitat Oberta de Catalunya
jcabot@uoc.edu
www.lsi.upc.edu/~jcabot

#Andrea,
#For each invariant an operation is generated that checks
#the invariant.
#The tiome and place where you want to

#call this invariant operation is up to yourself. Since we
#cannot check
#invariants "always". we have chosen that

#the checking strategy has to be chosen y the developer.

#To allow testing your invariants the user interface
#generated by
#Octopus (Eclipse RCP) has buttons to perform

#checking invariants for either a single object or for all
#objects in
#the system. These buttons simply call the

#invariant operations.

#

#Init expressions, derivation rules for derived attributes
#and body
#expressions for query operations are all generated

#and always used inside the Java code.

#

#Octopus does not generate test cases, although this might
#be an
#interesting extension.

#

#Hope this helps to clarify things,

#

#Jos

#

#Andrea Baruzzo wrote:
#

# cite="mid5db912070601300225u31b0ac2cs85963739222349ad@mail
#.gmail.com"
# type="cite">
#
Dear Jos,

#thank you for your reply. In fact at present I am able only
#to load
#the model in xmi and the ocl specifications, performing a
#static
#checking of their syntactical correctness. I am not able to
#generate
#any code.
#Aside from these issues, I am interested to better
#understand which
#type of checks Octopus is able to perform. For example, the
#Octopus
#web site states:
#
#1. Octopus is able to statically check OCL expressions. It
#checks the
#syntax, as well as the expression types, and the correct
#use of model
#elements like association roles and attributes.
#2. Octopus is able to transform the UML model, including
#the OCL
#expressions, into Java code.
#
#Does Octopus verify the invariants, preconditions and
#postconditions
#in the model for every possible scenario? If so, this check
#is static
#(without requiring to generate any test case and test
#scenario), or it
#is dynamic, based upon a specific test execution?
#
#
#Thanks in advice for any further infromation about these
#concerns.
#
#Cordially,
#
#Andrea
#
Received on Tue Jan 31 08:57:18 2006