Hands-on: Clock
The
CLOCK
class is modeling a clock counting seconds, minutes and hours of a
day. The class contains routines to create the clock, set the time,
and increase the time.
- Add a model declaration to define the abstract model.
-
Add a class
invariant
to restrict the attribute values. -
Add a precondition to the creation procedure
make
. You should be able to verifymake
andtest_make
. -
Add the specification to the
set_*
procedures. You should be able to verify theset_*
andtest_set
procedures. -
Add the specification to the
increase_*
procedures. You should be able to verify both classes completely.