Managing Software Development CSG 110 Spring 2005 Karl Lieberherr Due date: March 24, 2005 Homework 7: ERE Controllable Law of Demeter (LoD) Checker ========================================================= The purpose of this homework is three fold: 1. Learn how to manage the reuse of an AspectJ program written by a previous class. (issues: learning the theory behind the program. does the program still work with the current AspectJ compiler.) 2. As a manager of a software development project you want to make sure that the software developers follow style rules. You will learn how to enforce style rules using AspectJ. 3. Learning about the commonalities between seemingly different concepts: AspectJ pointcuts, enhanced regular expressions (from hw 4) and traversal strategies. Our goal is to write a Law of Demeter checker whose scope we can control by writing an extended regular expression. For example, we only want to check the Law of Demeter for all calls between the foo() call and the bar() call (see homework 4): (. call (void foo()) (* anyl any) anyl call (void bar())) Turn in the first phase of your project on March 24. It is important to practice incremental development using a spiral model. The LoD checker is basically given to you. For the ERE part reuse your work from hw 4. Googling for the relevant keywords will give you the information about existing LoD checkers. Here are some useful ones: LoD checker design document: http://www.ccs.neu.edu/home/lieber/com3205/f02/solutions/com3205/hw01/Requirements_2.pdf AOSD 2003 paper explaining LoD checking: http://www.ccs.neu.edu/research/demeter/papers/law-of-demeter/checker/AspectJ-LoD-aosd-2003.pdf http://www.ccs.neu.edu/research/demeter/biblio/LoD-Checkers-2002.html LoD checker sources: http://www.ccs.neu.edu/home/lieber/com3205/f02/solutions/com3205/hw04/part3_code_solution.zip http://www.ccs.neu.edu/research/demeter/demeter-method/LawOfDemeter/AspectJCheckers/PaperObjectForm/ The class that did the LoD checker: http://www.ccs.neu.edu/home/lieber/com3205/f02/f02.html (Paul Freeman was the TA) It is optional to use Eclipse for your project. The previous class used Eclipse but it is a significant effort to learn the API of Eclipse so that you can write a plug-in. Intro to LoD: http://www.ccs.neu.edu/home/lieber/courses/csg110/sp05/lectures/BasicIntroLoD.ppt Thoughts on ERE implementation: With the concatenation . and star * operators and anyl and any you can express interesting path sets (see the example above). You need to find a way to select the desired join points using AspectJ. =============== Refinement 1: =============== An important task in managing software development is to deal with tool evolution. When you use tool X to develop product Y and the vendor of X releases X' it is likely that you have to adapt Y. In our case, Y = LoD checker and X = AspectJ. As part of this homework, update the LoD checker so that it works with the latest version of AspectJ. Turn in the updated LoD checker code. While updating the code, make very sure that you don't introduce any bugs. http://www.ccs.neu.edu/home/lieber/com3205/f02/project/testcases/ contains test cases. There is already a place for your revised checker in: http://www.ccs.neu.edu/research/demeter/biblio/LoD-Checkers-2002.html