Java Class File


This file contains the actual Java code for the abstract data type being tested. The class should be in a file named "[classname].java", where [classname] is the name of the class. The class may extend another class, as long as the name of the file containing the parent class is included in the Additional Files file. If the class requires any methods that are members of another local class (besides the contract class), and therefore require an "import" statement, however, Danish is not guaranteed to work correctly. This should not pose much of a problem, since the classes being tested are abstract data types, and as it would be poor programming style for such a class to call a method from, but not extend, another class.

Once the class is written, there may be some additional methods required before Danish can be run. First of all, there must be a method which will test two objects for equality and return a boolean for each object that must be tested by the axia. For instance, the "==" operator can test ints, floats, booleans, and other standard data types, and the "equals()" method can compare strings, but the user will probably have to write a method in the class to compare two instances of the ADT if one doesn't already exist. The user must be sure to compare enough aspects of the data type to be sure the instances are equal if Danish is expected to work correctly.

In the extraordinarily unlikely event of a bug, the user will also have to provide methods that will print out any data type that had to be tested in the previous paragraph. System.out.print() will handle most data types, but again, the user will probably have to provide one for the data type being tested. As long as such a method exists, Danish will be happy, so it is up to the user to decide how much information to put into the printing method. Of course, the more information is displayed, the easier debugging will become.


Goto Previous Topic Goto Next Topic
Created 04/27/98 by preston