To: honors Subject: honors project Honors Assignment 3: ==================== Due: November 26. Students may work in groups of 2 or 3. Build your own teams. This project replaces the "regular" project for honors students. Automating The Testing of a Law of Demeter Checker Software testing is a very important stage in software development. Automating of the testing process helps improve the quality of the software. Assume you are a software tester for a Law of Demeter checker project whose objective is to develop a program to check if a Java program follows the object form of the Law of Demeter. The checker program has been implemented in AspectJ (www.aspectj.org) and if you compile the checker program with the program that is being checked (base program) using the AspectJ compiler and run the main class of the base program, then there is an output from the checker program to state for each method call, if it is a legal call in terms of the Law of Demeter. If yes, then the checker program should give the reasons why it is a legal call (e.g., the target is an immediate part of 'this' object, or an argument object or a newly constructed object in the context of the method execution or a return value from a method call on 'this' object); otherwise, it should report a violation. For all method calls, the checker program should also report the line number and in what .java file. For example, the following is an output from the checker program. Legal call at Foo.java:10; Reasons: Argument,Immediate Part,Newly Constructed Object. Legal call at Foo.java:11; Reasons: Immediate Part. Violation Found at Foo.java:12. Violation Found at Foo.java:13. Legal call at Foo.java:14; Reasons:Immediate Part,Return Value. Legal call at Foo.java:15; Reasons:Immediate Part,Return Value. You are responsible to write a DemeterJ/DJ program to make the testing process automated, i.e, you have an input file of expected output and you run the checker program and check if the output of the checker program is the 'same' as the one expected, if yes, then the checker has passed the test case; otherwise, there is something wrong. The 'same' here does not mean literally the same; you should allow some flexiblity in the format. For example, you should view the following lines to be the 'same': Legal call at Foo.java:10; Reasons:Argument,Immediate Part,Newly Constructed Object. Legal call at Foo.java :10 ; Reasons : Immediate Part, Argument,Newly Constructed Object. The spaces are irrelevant and should not be used to decide if two outputs are the same. In the reasons section of 'Legal call', the order of the reasons is not important and what is important is only the number of reasons and the actual reasons. You can view 'Legal call','at', 'Reasons','Argument','Immediate Part','Newly Constructed Object','Return Value' and 'Violation Found' as keywords and ':','.' should be viewed as reserved delimiter. If it is a 'Legal call', then the 'Reasons' section must appear after the filename and line number as shown earlier. Basically, you need to write a class dictionary to define the language of output reports and construct a report object r1 from a file stating the expected output and you run the checker program to get a report object r2 from it. Then you traverse the report objects r1 and r2 to check if they 'match' each other. Try to make your testing process as automated as much as you can. Hints: Use the LoD checker in directory LoD-checker. File LoD-checker/README explains how to use it. http://www.ccs.neu.edu/home/lieber/com3205/f02/hw/4/hw4-SE.txt Part 3 and also Part 2 describes what it does. Be ready for new releases of the testing software as you work on your automated testing tool. There are wrinkles in the program as it is now. Does your testing retrieve them? You may change the output of the Law of Demeter Checker in any way you deem necessary. Synchronize the output with your class dictionary design. You may use DJ for expressing the behavior. But using DemeterJ only would produce a faster result. Any questions to: com1205-grader which reaches Pengcheng and me.