CSE/ISE 308
Fall 2001
Stony Brook
Software Engineering
Annie Liu
Homework 8
Handout H8
Oct. 30, 2001
Due Nov. 13

Group Project Programming and Optimization; What I Did and a Bonus Problem

This assignment has two parts, worth 90% and 60% of the grade, respectively---Yes, that is 150%---the bonus problem is worth 50% extra credit, equivalent to 10 points in the midterm. Printed/written copies of both parts are due in class on Tuesday Nov. 13. Each group should hand in one copy for Part I, and each person should hand in individually Part II.

Part I. Group Project Programming and Optimization.

Each group is asked to build a complete system by completing the coding task and to write a report about the coding task and the code.

First, try to generate as much code as possible from the class diagrams; if you need to add or change information in the classes, do them in the class diagrams as much as possible before you generate code.

Second, try to reuse as much code as possible from existing code in other related systems you've found. Document precisely which portion was used; otherwise, it is called plagiarism.

Complete the rest of the code for the body of all operations. Try to progress by adding functionalities incrementally, so that you always have a working system to test and to show.

Your report should include all information that you think is important, including but not restricted to the following:

Characterize the portion of the code that are generated automatically from the class diagrams in Rose. For example, how many classes, how many fields/operations in each/some/all classes, and how many lines of code were generated?

Characterize the portion of the generated code that was originally reverse engineered by Rose. For example, how many of your classes were reversed engineered? how many fields/operations were in them? how many lines of code did each/some/all operations originally have? how many lines of code were generated?

Characterize other portion of the code that was reused in other ways. In particular, what are they? how many classes, operations, and/or lines of code were used? how are they reused or modified for reuse?

Characterize the portion of the code that you wrote manually. In particular, how many lines of code did you write, for how many operations, and how many classes? Whether the code is evenly distributed in all operations and all classes, or some particular interesting operation(s) needed 30% of all code?

To summarize, how many lines of code total does your system have? and what are they composed of?

Show and explain the most interesting parts of your code. You could include complete code also.

If you used incremental and iterative development in deciding which portion to code first and which ones next, document it.

If you used incremental and iterative computation principle in optimizing any portion of code, document it. If you still have portions that you think can be made more efficient or more succinct, but you don't know how, explain it also.

Part II. What I did and a Bonus Problem.

1. Describe what you did for the course this week, as in Part III of Homework 1.

2. Will be given here after tomorrow's lecture. ... Here it is (given on 11/06/01)

Sequence local average problem: given a sequence of numbers, say in a[0]..a[n-1], and a window width k, we want to compute, for each index, say called i, ranging from 0 to n-k, the average of the k numbers from i forward. The following program computes this.

    input a[0..n-1];
    input k;

    declare s;
    declare ave[0..n-k];

    for i := 0 to n-k do {
      s := 0;
      for j := i to i+k-1 do
	s := s+a[j];
      ave[i] := s/k;
    }

    output ave[0..n-k];
This problem has many applications, for example, in computing, say, 50-day stock average. It is also used often in sampling data sequences in general.

How many arithmetic operations does this program do? How would you make it computer faster? How many arithmetic operations does your optimized program do?

A Bonus Problem.

As in the Bonus part of Homework 1.