PHASE 3: 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 phase 3, the program is testing the "prefix-super-sub" and the "suffix-sub-super" rules as in phase 2. Also, the edge wrapper rule "prefix-edge-suffix" is tested. This rule says that the before wrapper of the construction edge is performed immediately before the edge is traversed and that the after wrapper is performed after the edge is traversed. This phase allows for more complex testing by supporting any number of inheritance levels and any number of occurrences at each inheritance level. This phase also makes other improvements in the code found in phase 2. The program tests the rules in the following steps. The program reads in the first input file and creates a structure of Classes in which each may or may not contain SubClasses. The progam then calls a traversal function that traverses through each parent_of construction edge to *. 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 the generated get_className host method rather than the slot_name method created in the first two phases. After the first Vector list is completed, the program reads in a second input that should be the expected result of the first input. It creates a second Vector out of the input by parsing it as an Expected object 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!". The Names method print_names, is called on each vector so that first the actual resulting vector is displayed and then the expected vector is displayed. ...................................................................... phase3.input format: "(" ")" are placed all classes containing subclasses "<" ">" are placed around classes that have no subclasses Sample: (A(B(C))) expected format: - "b" is placed before Ident where before wrapper is expected - "b_CE" is placed where before edge wrapper is expected - "a" is placed before Ident where after wrapper is expected - "a_CE" is placed where after edge wrapper is expected expected (of sample above): (bA, b_CE, bB, b_CE, bC, b_CE, bD, aD, a_CE, aC, a_CE, aB, a_CE, aA)