Asst: Unit Testing

This assignment will give you practice in writing unit tests in the *Unit style. For this assignent you will be working with some very old code that I developed for my CS330 Object-Orietned Programming class. The code implements a spreadsheet and illustrates OO design principles, multi-threaded GUIs, and the MVC pattern of UI design.

You may either choose to work in Java or C++. Both versions of the spreadsheet separate the core spreadsheet functionality (the mode) from the UI (view and control). The C++ version of the spreadsheet actually has two separate user interfaces. One is pure C++, using the Unix curses library to do a pure text-only interface. The other demonstrates the design of a Java/C++ hybrid, using a Java program to provide a GUI that interfaces with the C++ spreadsheet code.

  1. From the ~zeil/courses/cs795SD/assts directory, get either javaSpreadsheet.zip or cppSpreadsheet.zip. Unpack into a convenient working directory. Create an Eclipse project using that directory. Demonstrate for yourself that you can build and run the spreadsheet.
  2. Create a unit test for one (or more, if you are feeling ambitious) of the following components of the spreadsheet model:

    If you are working with C++, you may use either the Google or Boost test frameworks. If you are working with Java, use JUnit 4.

    For the best score on this assignment, use mock classes to isolate the class under test from the larger subsystems within the model (to my mind, the major subsystems are the Value class hierarchy, the Expression class hierarchy, the parser, and the Spreadsheet/Cell structures).

  3. Submit your unit tests using the button below.