[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.ocl] OCL Debugging ?

Christian,
thanks for the answers. I meant "debugging" at the level of evaluating the expressions. In the mean time I got used to validate smaller portions of a complex OCL statement if it does not work immediately.


Contributing a debugger: I'm afraid that would be far more than I can do, both time-wise and also programming-wise. But I'd be definitely interested to test it out if someone wants to engage in that endeavor :-)

Another area that I think could benefit is the area of writing test cases against OCL statements. I tend to have only a small number of test models which I modify to only once or so cause my (profile based) OCL statements to fire, and once that is validated, I leave the models in a state where the OCL statements do not fire, because otherwise there are too many problem messages around. That approach obviously does not allow for regression testing.

Also, in case someone feels inclined to start an "OCL documentation project", I'd be willing to spend time and contribute.

Andy

Christian W. Damus wrote:
Hi, Andy,

That depends on what you mean by debugging.  :-)

If the error messages provided by the parser aren't sufficiently clear to
indicate what the cause of a parsing problem is, then please raise bugs.

If you have complex OCL expressions that parse but compute the wrong
results, and you need to find out why, then I'm afraid that there isn't any
debug support at the OCL level of abstraction.  You will have to debug the
Java code evaluating your expression (the evaluation visitor) to see:

  - what the AST looks like; this often can indicate what the problem is
    by seeing how the results of sub-expressions are incorporated into
    the larger expressions

  - what values are actually computed for each sub-expression

One tip that may help is to visualize your OCL expression in the tree-based
editor.  Generate an OCL editor from the OCL.ecore model, save your parsed
OCLExpression in an XMI document, then load it up in the editor.  You can
then browse the AST to see exactly what the parser thinks your expression
meant.

An OCL debug UI would, of course, be very cool.  Would you be interested in
contributing one?

HTH,

Christian


Andreas Maier wrote:

Is there some way to debug OCL ?

Andy