PHASE 2: Team members of the testing 2 group: Han H. Li (hanl@ccs.neu.edu) Mike Kalpas (kalpas@ccs.neu.edu) ...................................................................... Project: The purpose of this project is to develop code which can be used to test that Demeter/Java follows the rules defined for the TRAVERSE interpreter described in Ch.9, pages 256 to 258 of "Adaptive Object-Oriented Software -- The Demeter Method". ...................................................................... Directory: /proj/demsys/com1205/w97/kalpas/project/phase* contains all the files for all phases of the project. ...................................................................... To run our program: 1) copy these four files into a directory phase*.beh phase*.cd phase*.input expected 2) use the command j-gen-make to ceate a GNUmakefile 3) edit the GNUmakefile, locate program and change to phase* 4) execute the command make to compile the program 5) to run the file after the compilation type: java Main phase*.input expected ...................................................................... What the program is doing in this phase: In this phase, the program is testing the "prefix-super-sub" and the "suffix-sub-super" rules. These rules involve the order in which wrapper funcions are traversed. The "prefix-super-sub" rule says that the before wrapper of the immediate class is performed prior to that of any subclasses. The "suffix-sub-super" rule says that the after wrapper of the subclass is executed prior to that of of its inheritance successor. The program tests these rules in the following steps. The program reads in the first input and creates a RootClass with SubClasses to 3 levels of inheritance. The progam then calls a traversal function that goes from the Root to each SubClass. A visitor passed in the traversal function executes before and after wrapper functions at each non-empty class it finds. These wrapper functions add the host class' className to a Vector by calling a host method slot_name. After the first Vector list is completed, the program reads in a second input that should be the expected result of the first input, creates a second Vector out of the input by parsing it as Expected object (now defined separately in cd), and then calls a function to compare the two vectors. If they are equal, the program returns "Success!", and if they are different, the program returns "Failure!". An added method defined in the Names class, print_names, is called on each vector so that first the actual resulting vector is displayed and then the expected vector is displayed. ...................................................................... phase2.input format: Brackets "[" "]" are placed around the root. Braces "{" "}" are placed around the first subclass. Parentheses "(" ")" are placed around the second subclass. Asterisks "*" "*" are placed around the third subclass. Sample: [A{B(C*D*)}] Limitations: -Only one class at each level -Cannot go beyond third subclass level expected format(of sample above): (A < B < C < D < D < C < B < A) ...................................................................... What to expect in phase3: In phase 3 we will enhance the program from this phase to also check that the edge wrappers are traversed in the correct order as well. We will also allow for deeper subclassing and lists of subclasses rather than one subclass per class.