Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL parsing invariants
OCL parsing invariants [message #61929] Fri, 05 September 2008 12:29 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey all,

for my last university paper before the master thesis, i want to develope a
way for extracting adequate test data (e.g. equivalency classes etc.) from
an UML model, where the relevant test values (attributes) are annotated with
ocl invariants inside of an UML class model. I have a solid theoretical
knowledge about ocl but no practical experiences.

I think, first of all, i have to parse the OCL statements, that are
mentioned in the model. Afterwards, these invariants had to be evaluated in
some way, which i currently not know. In the end, for example an equivalency
class for the given invariant

inv: self.a < 6 and self.a > 0

might be any integer value between 1 and 5. On this result, an algorithm may
pic up a concrete random value, let's say 4. Four boundary value testing, it
should be exactly 1 and 5... and so on.

Before i start my paper, i want you OCL guys to ask, whether this scenario,
especially concerning the OCL stuff like parsing and mapping, can be
realized with the Eclipse OCL parser.

Any commet will be appreciated.

Thx
Timothy
Re: OCL parsing invariants [message #62005 is a reply to message #61929] Mon, 08 September 2008 18:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Timothy,

I don't think I quite understand exactly what it is that you are trying
to do, but that probably does not matter.

The OCL Abstract Syntax Model (OCLExpression and its various
specializations, plus the definition of the various OCL-specific
classifiers) should suffice for any kind of reasoning that you need to
do on the constraints.

I have had some success with model-to-model transformation of OCL
expressions written against one metamodel (a reuse/specialization of
various bits of the UML metamodel) to another (plain UML extended by
profiles). So, I suspect that you should find all that you need in the
AST generated by the parser.

The "switch" classes generated by EMF for the OCL AST, in combination
with the org.eclipse.ocl.utilities.AbstractVisitor class, should provide
a basis for building your analysis algorithms.

HTH,

Christian


Timothy Marc wrote:
> Hey all,
>
> for my last university paper before the master thesis, i want to develope a
> way for extracting adequate test data (e.g. equivalency classes etc.) from
> an UML model, where the relevant test values (attributes) are annotated with
> ocl invariants inside of an UML class model. I have a solid theoretical
> knowledge about ocl but no practical experiences.
>
> I think, first of all, i have to parse the OCL statements, that are
> mentioned in the model. Afterwards, these invariants had to be evaluated in
> some way, which i currently not know. In the end, for example an equivalency
> class for the given invariant
>
> inv: self.a < 6 and self.a > 0
>
> might be any integer value between 1 and 5. On this result, an algorithm may
> pic up a concrete random value, let's say 4. Four boundary value testing, it
> should be exactly 1 and 5... and so on.
>
> Before i start my paper, i want you OCL guys to ask, whether this scenario,
> especially concerning the OCL stuff like parsing and mapping, can be
> realized with the Eclipse OCL parser.
>
> Any commet will be appreciated.
>
> Thx
> Timothy
>
>
Re: OCL parsing invariants [message #62026 is a reply to message #62005] Tue, 09 September 2008 10:35 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey Christian,

thanks fpr your reply. Actually, i even didn't know, what exactly to do
:) I thik about some kind of automatic test data und test oracle values
from given abstract test models, by annotating the relevant properties
with OCL invariants.

So, i think i will have a deeper look inside the OCL AST.

Thx
Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> I don't think I quite understand exactly what it is that you are trying
> to do, but that probably does not matter.
>
> The OCL Abstract Syntax Model (OCLExpression and its various
> specializations, plus the definition of the various OCL-specific
> classifiers) should suffice for any kind of reasoning that you need to
> do on the constraints.
>
> I have had some success with model-to-model transformation of OCL
> expressions written against one metamodel (a reuse/specialization of
> various bits of the UML metamodel) to another (plain UML extended by
> profiles). So, I suspect that you should find all that you need in the
> AST generated by the parser.
>
> The "switch" classes generated by EMF for the OCL AST, in combination
> with the org.eclipse.ocl.utilities.AbstractVisitor class, should provide
> a basis for building your analysis algorithms.
>
> HTH,
>
> Christian
>
>
> Timothy Marc wrote:
>> Hey all,
>>
>> for my last university paper before the master thesis, i want to
>> develope a way for extracting adequate test data (e.g. equivalency
>> classes etc.) from an UML model, where the relevant test values
>> (attributes) are annotated with ocl invariants inside of an UML class
>> model. I have a solid theoretical knowledge about ocl but no practical
>> experiences.
>>
>> I think, first of all, i have to parse the OCL statements, that are
>> mentioned in the model. Afterwards, these invariants had to be
>> evaluated in some way, which i currently not know. In the end, for
>> example an equivalency class for the given invariant
>>
>> inv: self.a < 6 and self.a > 0
>>
>> might be any integer value between 1 and 5. On this result, an
>> algorithm may pic up a concrete random value, let's say 4. Four
>> boundary value testing, it should be exactly 1 and 5... and so on.
>>
>> Before i start my paper, i want you OCL guys to ask, whether this
>> scenario, especially concerning the OCL stuff like parsing and
>> mapping, can be realized with the Eclipse OCL parser.
>>
>> Any commet will be appreciated.
>>
>> Thx
>> Timothy
>>
Previous Topic:Getting type of Property by reflection
Next Topic:OCL validation example violates extension point schema
Goto Forum:
  


Current Time: Sat Nov 22 03:02:18 GMT 2014

Powered by FUDForum. Page generated in 0.04179 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software