The following diagram shows a refined class diagram of the entities in our system. We omitted those preliminary entities that will not be persistent. For some subclasses we decided that they could be subsumed under their superclass.
Give a database schema that represents this structure. You know from the lecture that there are different ways to map inheritance to a database schema. Give a reason for you choice.
The schema should contain all required table names, colum names, column types, primary indexes, and foreign indexes. You could use SQL for this (simplified grammar from the MySQL Reference Manual):
CREATE TABLE tbl_name
(create_definition,...)
create_definition:
col_name data_type
| PRIMARY KEY (col_name,...)
| FOREIGN KEY (col_name,...) REFERENCES tbl_name [(col_name,...)]
data_type:
INT[(length)]
| FLOAT[(length,decimals)]
| CHAR(length)
To allow for more sophisticated recipes we bought a well tested class for handling intervals with boundaries of type float. Unfortunately we lost the class and only the test for the class is left. As a first step we created the skeleton of the class FloatInterval again, so that the FloatIntervalTest can be executed. Of course all tests are still failing now. Your task is to turn red into green, i.e. to implement the details of the class FloatInterval so that the test succeeds. If you feel that the test still is not precise enough you might add further tests, but never delete or change one of the tests that is already there.
You will find the source in the package math in your CoffeMaker2000 project in your teams cvs. For your convenience the code is also available online. We sorted the test methods in FloatIntervalTest from easier to more difficult ones. Just select one by one and make it succeed. See how far you can get.
Does our CoffeMaker2000 work as required? We can create functional tests to check whether the requirements are fulfilled or not. To allow for automated testing without user interaction we created mock implementations for all boundaries. Have look at the source of a test that checks whether scenario I is supported.
Your task is to implement functional tests for the three variants of scenario II or even better select two complete uses cases from the sample solution and implement tests for them.
You will find the mocks, the test fixture, and the ScenarioITest in your cvs. If you did not prepare a CoffeeMaker2000 implementation, you can use the sample solution (team00 cvs) and copy it into your project.