[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [henshin-dev] Migration and tests (+ slight model change suggestion)
|
Recursing own thoughts revealed leak: Emulating true or false makes it
reasonable to use empty units :)
I have no objections to incrementing the lowerBound of
IndependentUnit.subUnits, though.
Am 23.01.2012 16:59, schrieb Gregor Bonifer:
Hi Felix,
1) The Rhino scriptengine returns a Double when an expression
evaluates to a number. I do not expect Double.toString() to change.
But I don't know how other implementations of the interface
ScriptEngine might behave since the API just specifies Object as
return
type(http://docs.oracle.com/javase/7/docs/api/javax/script/ScriptEngine.html).
Perhaps you find further specifications here:
- http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/
- http://jcp.org/aboutJava/communityprocess/pr/jsr223/index.html
2) Although it might not be reasonable to use a unit that way, it is
not wrong. So why forbid it? After all, this is the easiest way to
define units with constant outcome. Emulating true and false with
these units is more efficient than using rules.
Regards,
Gregor
Am 23.01.2012 15:48, schrieb Riegerf@xxxxxxxxxxxxxxxxxxxxxxx:
Hi Gregor,
Quoting Gregor Bonifer <gregor.bonifer@xxxxxx>:
1) a floating-point literal is fine.
For correctly implementing a test, I'll need to know whether the user
can rely on a certain representation that won't change during
subsequent versions (i.e. floating-point literals, integer literals,
etc.) or whether this should be ensured manually. In the former case,
the specific representation will be tested, whereas in the latter
case, I will only test that the result can be converted to some
number representation.
2) Well, PriorityUnits are existentially quantified, while
SequentialUnits are universally quantified, meaning that for a
PriorityUnit there must exist an applicable subUnit and for a
SequentialUnit all subUnits must be applicable. [...]
Think of an IndependentUnit as a randomizing proxy. [...] A proxy
without a target is simply invalid. So there has to be at least one.
This sounds sensible, so why isn't this encoded in the model? If we
change the model accordingly and require PriorityUnits and
IndependentUnits to have at least one subunit, this will be much more
obvious to the user. The current tests can then be replaced by more
relevant tests.
Felix
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev