Assignment 3: Reverse  Engineer a Software Package

final version as of Oct 15

Problem Statement:

Jim had the task of developing the first version of a wrapper tool for wrapping existing services into a CHAIMS compliant megamodule. He thought it would be no big deal and did most of the work at the end of the term. To his credit, most of the wrapper worked. Unfortunately he did not get around to implement all the primitives that should be understood by the wrapper. He managed to hack together a test-routine (to be found in the class CPAMInterface), and documented how a user would use this wrapper template to wrap existing computational code. He did not write any maintenance documentation.
John has to take over the project and of course the first thing for him is to understand the software. Jim is gone, so John cannot ask him any more questions, and has to live with what little overview documentation and code comments are available.

The code and documentation that Jim wrote is here or as compressed tar-file (use  uncompress and tar xvf to unpackage the files) or as zip-file (just double click the file on Windows). If you want, you can download it, unzip it, and run it on Windows or Solaris with: java Test. You have to use a machine where Java 1.2 (=Java 2.0) is installed, and you might have to undefine the environment variable CLASSPATH. Possible entries for methods are: concat, mult and fast. The method concat takes the two parameters s1 and s2, and returns s2 (all strings).The method mult takes the two parameters m1 and m2, and returns res (all integers). For more information look at the description in the file TestModule1.java. For this assignment you do not have to care about how to start up and register a server, you do not have to wrap legacy code yourself (the class TestModule1.java is an example of a very simple piece of wrapped code). You can also ignore the class RMI_CPAM_V2_0 because when running Test.test you do not access the wrapper remotely but just communicate with it locally. Running the wrapper example is not really necessary for solving this assignment, but it might you help to understand what it is about.

Jim generated some documentation with Javadoc, to view it load the file Doc/index.html into your browser.
I added some comments to some of the variables, methods and classes, in order to make the assignment easier. I also provided for you a crisp description of what this is about so you have a starting point: CHAIMS allows to access remote and distributed megamodules over a specific high-level protocol. This protocol consists of a set of primitives. These primitives allow to:

Of course, several connections can be made in parallel, and, within each connection different or the same methods can be invoked several times in parallel.


You are free to use any kind of tool for the diagrams, or to write them by hand. If diagrams are hand written, all other documentation inclusive the lists of attributes and operations should be made in some text tool. You are free to add the non-diagram documentation directly to the code and to use Javadoc (http://java.sun.com/products/jdk/javadoc/ or http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/javadoc.html or http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/javadoc.html) to generate the documentation. Javadoc even allows you to write an overview web-page and to link in graphics generated by some graphical tool. The use of Javadoc is optional but might be of special interest for all those developing Java applications.

Hand in the assignment in paper form. In case you use Javadoc, you can also mail me (cs446@db)  the URL that points to wherever I can view the documentation with a normal web-browser.


In contrast to the previous assignments you are expected to work on this assignment on your own. Of course you may discuss technical Java question with whomever you want.