-------------------------------------------------------------------------- Software Design and Development Winter 2001 COM 1205 Prof. Karl Lieberherr --------------------------------------------------------------------------- Project Due dates: First phase: Feb. 26, 2001 --------------------------------------------------------------------------- This description is stored in file $SD/project/projects.txt PROJECT: The project consists of first improving the project cdcheck from last quarter and second, of reusing some of the functionality for checking XML schema. DON't RUN cdcheck on denali.ccs.neu.edu. Each week you will get a detailed assignment along those lines. The rules from the fall project apply: you may work in groups of two students. First we improve the following features of cdcheck: 1. Don't report "primitive" types or classes: The program should list all classes and types that are not defined in the class dictionary, except all Java primitive types: float, int, boolean, etc. and all Java wrapper classes: Float, Integer, Boolean, String, etc. and the classes Ident, Line, Text, Word in package: http://www.ccs.neu.edu/research/demeter/DJ/docs/api/edu/neu/ccs/demeter/package-summary.html 2. The dual of "used but not defined": "defined but not used". Change cdcheck so that it reports each class that is defined, but not used in the class dictionary. For the cd: A = B C. B = . C = . D = . the program should report: The following classes are defined but not used: A, D. 3. Allow parameterized classes. The current cdcheck program does not accept parameterized class definitions. Extend the class dictionary so that it allows parameterized class definitions as input and make sure all checks work correctly for the new enlarged class dictionary. 4. cdcheck reports correct applications of the TBR (Terminal Buffer Rule) incorrectly. Trip = "Trip" "by" Means "departure" Time "arrival" Time "ITINERARY" DayTrips. DayTrips = DayTripList. DayTrip = "day" Integer "stops" Locations. Locations = Location_ArrowList. Location = Ident ["(" Integer ")"]. Time = "time" Integer. Means = "direct train" String. Location_ArrowList ~ Location{ "-->" Location }. DayTripList ~ DayTrip { DayTrip}. *** ERROR: Class Time violates TBR. Class Integer is not the only part class. *** ERROR: Class Means violates TBR. Class String is not the only part class. These two error messages are in error: Classes Time and Means satisfy TBR WHAT YOU NEED TO DO: Your task is to repair all 4 problems in cdcheck AND to find and report one more additional bug in cdcheck. Turn in the modified program and the additional bug report. Information about the program cdcheck is at: http://www.ccs.neu.edu/home/lieber/com1205/w01/previous-project/how-to-use.txt The source code is in: /proj/adaptive3/lieber/com1205-2000/jokelley/cdchecker/ ==================================== FALL 2001 PROJECT You have now gained enough background in adaptive object-oriented software development that you can approach a sizable project. We will use a programming methodology similar to "Extreme Programming" with the following emphasis: www.xprogramming.com Continuous Integration, Relentless Testing, Frequent Releases: This means every week, a growth phase (according to the Growth Plan Pattern) will be released. Internally to your project, you should have more releases. Notice that a growth phase typically tests a group of collaborating classes not only a single class. Refactor Mercilessly If you need similar behavior twice, express it once and reuse it twice. Pair Programming You are encouraged to work in teams of two (but you can also work on your own). Pair programming is done with two people at the PC or workstation simulateneously. One person types, the other watches. Take frequent turns. The code is owned by the team of two. The team size is at most two for this project. The project is a programming tool project and the goal is to improve the current DemeterJ tool by writing a semantic checking tool for it. DemeterJ, in its current form, reports quite late some errors that you make in class dictionaries. The purpose of this project is to report those errors in a separate tool before the code generator and compiler get involved. The goal is to write a complete cd-checker that implements the 5 checks mentioned below. Some of the teams might not implement all 5 checks. Please select your own order in doing the 5 checks. The idea is that when the projects are done, the class as a whole, has written excellent solutions for all 5 tests. The requirements described here might require additional clarification. Please send email to lieber and stelios when you have questions. 1. when you forget to define a class in your class dictionary, the Java compiler might report 14 errors. See $SD/undefined-classes. Instead we would like to have an error message like "Class B is not defined in the cd". Similarly for parameterized classes. See $SD/undefined-param-class. The error message: gen/UniversalVisitor.java:10: cannot resolve symbol symbol : class B location: class UniversalVisitor public void before_b(A source, B dest) { } ^ gen/UniversalVisitor.java:14: cannot resolve symbol ... 14 errors Aborting, compiler exited with error value 1. is not user-friendly. 2. When you have an inheritance cycle in your class dictionary, DemeterJ currently gives you a stack overflow. Instead, we would like to get a message "cyclic inheritance from class A to class B to class C to class A". See $SD/inheritance-cycle. The error message: java.lang.StackOverflowError at java.util.BitSet.unitIndex(BitSet.java:72) ... is not user-friendly. 3. Unique parts. When you define a class that has two parts with the same name (immediate or inherited), the Java compiler complains about a constructor. Instead, we would like to get a message like "part x of class B is not unique". See $SD/unique-parts. The error message: gen/B.java:7: x is already defined in B(X,X) public B(X x, X x) { ^ 1 error Aborting, compiler exited with error value 1. is not user-friendly. 4. Single inheritance. When you have a class dictionary with multiple inheritance, you get an error mesage about incompatible types from the compiler (and an earlier, non-fatal message from the code generator). Instead, we would like to have an error message like "class B has two super classes: A, C". See $SD/single-inh. The error message: Error: class B cannot have more than one parent: C (previous parent: A) gen/Parser.java:67: incompatible types found : B required: C it = _B(); ^ 1 error Aborting, compiler exited with error value 1. is not bad but needs to be improved and result in a fatal error before the compiler gets involved. 5. Terminal Buffer Rule. The current DemeterJ does not give a warning when TBR is violated. Instead, we would like to get a message like: "Class A violates TBR. Class String is not the only part class". The goal of the project is to produce a tool called cd-check that checks for the 5 conditions listed above. 1 to 4 should produce an error and 5 only a warning. The plan is to make your code a part of demeterj, maybe a "demeterj cd-check" option will be used. So your code will have to work with the class dictionary of DemeterJ. http://www.ccs.neu.edu/research/demeter/DemeterJava/use/generate.cd and suitably adapted for the project in: /proj/adaptive2/course/com1205/f00/project/sem-check But you should start with much smaller class dictionaries, such as the one in $SD/project/cd-check-phase1. =========== Change in requirements: Your project needs to work with the class dictionary in: /proj/adaptive2/course/com1205/f00/project/sem-check-full ============ How do you go about doing your project. Hint: http://www.ccs.neu.edu/research/demeter/DemeterJava/use/latest-demjava/generate/inherit.beh contains DemeterJ code for checking for single inheritance. http://www.ccs.neu.edu/research/demeter/DemeterJava/use/latest-demjava/generate/sanity.beh contains less of a page of DemeterJ code that does some uniqe part checking. The class dictionary used is in the same directory in file generate.cd. Study this DemeterJ code and express it un DJ. 1. You get a class dictionary for your input and output objects by using whatever technique is appropriate (copy from my directories, write it yourself). You debug your cd with the parser. 2. You break your task into subtasks and for each task you find a group of collaborating classes which are needed to accomplish the task. This might lead to an extension of your cd, after which you regenerate. You implement the task using traversals and visitors. 3. You write a growth plan and debug your adaptive programs according to your growth plan. o What information do I need on regular basis for on going projects? I would like to be informed about your progress. Especially if you solve problems which are useful to other projects, I would like to be informed. Sometimes, I post your progress to the entire class if I feel that several projects could benefit. o What do you need to hand in at the end of the quarter? What you hand in is all electronic. The description is at the very end. The goal is that the information you hand in will allow other students to build on your projects. You may assume that those students are as educated as you are in object-oriented software development. WHAT TO TURN IN. ================================================ You will almost certainly spend most of your days as a practicing computer professional working in groups. Your effectiveness will depend on your ability to contribute your engineering expertise to those groups. Therefore you had the opportunity in this course (but it was not required) to develop software in groups of two. You learned about how to bring a good member to your group, participating in meetings, partitioning the work etc. To get additional input regarding the grade for your project, I would like you to evaluate your peer. Please answer the following questions in the last week of the quarter, put the answers into an envelope into my mailbox or bring it to class. =============== Project: Your name: Let's assume that the grade for your project is B. Which grade would you give to each of the team members (including yourself)? Why? The evaluation is confidential. It will serve as additional input for assigning a grade. ============= OPEN YOUR FILES FOR READ ACCESS. For the purpose of grading your projects, and saving your assignment code, please use a command such as: chmod -R go+rx xy & for the top directory which contains your project and hw. Make very sure that the top directory itself is accessible to me. --------------------------------------- Include the following information in what you turn in for your project: Put this information into file /proj/adaptive3/lieber/com1205-2000/your-login-name/README-project and mail a copy to com3360-grader and lieber. ---------------------------------------- Your name: Your host: Account Number: Project: (brief description) Directory: (from where we can copy your software for reuse in future projects) It should be in: /proj/adaptive3/lieber/com1205-2000/your-login-name/ Credits: (from where did you reuse some of the software/ideas in your project? reuse is good as long as you give proper credit. Give directory names and name of person from which you used ideas.) Class dictionary which you used. Growth plans which you used. Parts of your project which you would have developed further if you had more time. Include a list of known bugs here. (The more bugs you know, the better you have tested your project!) Names of files where test inputs can be found. Names of files where outputs can be found. Include one interesting input/output pair in this file. (well, if your output is graphical, maybe you have some printed form for the graphical information.) Include one interesting input/output pair where the behavior of your program could be improved. Any information which you think is useful to properly reuse your software. Please answer the following questions: Did you change the generated Java code? If you had the privilege to have one of my Ph.D. students as host or if you had interactions with the teaching assistant, an evaluation of their performance would be welcome. Also mention class members that you found helpful. ======= Definition of phases: The definition of a growth plan is up to you. That is a part of your software design experience: to break the problem into manageable phases. The first phase might be, for example, to do the "unique part" check for class graphs that contain construction classes only. Or it might be to do the "class not defined" check for class graphs that don't contain classes from Java packages. For some of you, phase one might mean to do all of "unique part" check and "class not defined" check" for the class dictionary in http://www.ccs.neu.edu/research/demeter/DemeterJava/use/generate.cd which supports importation of Java packages. You can define the growth phases according to your abilities.