Information Technology Reference
In-Depth Information
IB can be built by means of explicit insertions, deletions and updates and/or by
means of the occurrence of domain events. For the purposes of the analysis of the
test coverage criteria of complete conceptual schemas we impose that the state of
the IB has been achieved by means of the occurrence of domain events, starting
from an empty IB. The example of Fig. 3 satisfies this condition.
Check that the constraints of the event are satisfied. The verdict is Fai l if any of
the event constraints is not satisfied.
Execute the method of the corresponding effect() operation.
Check that the new IB state is consistent. The verdict is Fai l if any of the
constraints is not satisfied.
Check that the event postconditions are satisfied. The verdict is Fai l if any of
the postconditions is not satisfied; otherwise the verdict of the whole assertion is
Pass.
It is often useful to include in a test case an assertion on the current state of
the IB. The purpose may be to check that one or more derivation rules derive the
expected results, or that a navigational expression yields the expected results or that
the effect of one or more domain events implies an expected result in the IB. In
CSTL, to assert that the current state of the IB satisfies a boolean condition defined
in OCL, the conceptual modeler writes the following statement:
assert true booleanExpression;
where booleanExpression is an OCL expression over the types of the IB and the
variables of the test case. The verdict of the assertion is Error if the current state is
inconsistent. The verdict is Pass if booleanExpression is true and Fai l otherwise.
The test program of Fig. 3 contains several examples of assertions about the
state of the IB. For example, the statement “ assert equals oc.createdOrder.total
105 ” asserts that the total price of the created order in the current state of the IB
is 105. The verdict is Pass if the valid occurrence of the event OrderConfirmation
correctly creates the order and the derivation rules of the schema derive its total as
expected.
Additionally, CSTL includes the following similar assertions:
assert false booleanExpression;
assert equals valueExpression1 valueExpression2;
assert not equals valueExpression1 valueExpression2;
3 Testing Satisfiability
In this section, we show how we can check the satisfiability of schema elements by
means of testing. We analyze first the satisfiability of base entity and relationship
types, then that of derived base and relationships types, and finally that of domain
event types.
Search WWH ::




Custom Search