Information Technology Reference
In-Depth Information
Entity and relationship types may be base or derived. The population of the
base entity and relationship types is explicitly represented in the Information Base
(IB). If they are derived, there is a formal derivation rule in OCL that defines their
population in terms of the population of other types.
Figure 1 includes as an example the specification of two OCL integrity con-
straints ( Product::nameIsUnique and Session::CustomerCartWhenLoggedIn ) and
also of the derivation rule of the attribute Order::total . See [ 25] for the whole set of
constraints and derivation rules.
The behavioral schema consists of a set of event types. We take the view that an
event can be modeled as a special kind of entity, which we call event entity [ 12] . An
event entity is an instance of an event type.
Event types have characteristics, constraints and effects. The characteristics of
an event are the set of relationships (attributes or associations) in which it partici-
pates. The constraints are the conditions that events must satisfy in order to occur.
An event constraint involves the characteristics and the state of the IB before the
event occurrence. An event may occur in the state S of the IB if S satisfies all con-
straints and the event satisfies its event constraints. Each event type has an operation
called effect() that gives the effect of an event occurrence. The effect is declaratively
defined by the postcondition of the operation. We define both the event constraints
and the postcondition in OCL.
For domain event types, the postcondition defines the state of the IB after the
event occurrence. It is assumed that the state of the IB after the event occurrence
also satisfies all constraints defined over the IB. We deal with executable concep-
tual schemas, and therefore we need a procedural specification of the method of the
effect () operation. A method is correctly specified if the IB state after its execution
satisfies the postcondition and the IB constraints. UML does not include any par-
ticular language for writing methods [ 2] . In the work reported here, we write those
methods using a subset of the testing language.
The example used throughout this chapter uses the minimal subset of
domain events necessary to place an order in the osCommerce system:
NewCustomer, NewSession, NewProduct, NewSpecial, NewDownloadableProduct ,
NewDownloadableSpecial, AddProductToShoppingCart,
LogIn
and Order
Confirmation.
Their detailed specification can be found in [ 25] . AddProductToShoppingCart
adds a quantity of a product in the shopping cart of a session (the shopping cart
is created if it does not exist yet in the context of the session). Given a shop-
ping cart , OrderConfirmation creates the corresponding Order . Figure 2 shows the
complete specification of the domain event NewProduct including its constraint
( productDoesNotExist) , its postcondition and the method of its effect() operation.
2.2 The Testing Language
Without loss of generality, in this chapter we will use the testing language called
CSTL (Conceptual Schema Testing Language) [26] . A test set of a conceptual
schema is a set of one or more CSTL programs. A CSTL program consists of a
Search WWH ::




Custom Search