|
CSE/ISE 308 Fall 2004 Stony Brook |
Software Engineering
Annie Liu Assignment 8 |
Handout A8 Nov. 2, 2004 Due Nov. 16 |
This assignment has two parts. Please note that there are extra bonus problems.
Part 1. Group Project Coding and Optimization
Each group is asked to build a working 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 bodies of all operations. Please refer to Chapter 10 of the textbook for basic transformations and mappings. Please note you should proceed by adding functionalities incrementally, so that you always have a working system to test and to show.
Your report should include information from the following effort and any other information that you think is relevant and important:
Note that reuse, forward and reverse engineering using tools, and incremental and iterative development are all parts of the requirements. If you did not do any of them, you need to show sufficient effort and justify carefully to not to loose points.
Finally, you are asked to continue using the CVS server set up for the course. Make sure that you check in all your code as well as your documents.
Part 2. What I did
Describe what you did for the course this week, as in Part 3 of Assignment 1.
Bonus
1. As in the Bonus part of Assignment 1. In particular, if you find any UML tools for forward or reverse engineering that are better than Rose, please describe it and your experience with it for extra credits.
2. Will be given here after Thursday's lecture. ... Here it is (given on 11/04/04)
2.1. 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 compute faster? How many arithmetic operations does your optimized program do?
2.2. Rectangle partial sum problem: given an array
a[0..n-1,0..n-1] of numbers, we want to compute, for each
row i and each column j, the sum of the
numbers in the rectangle a[0..i-1,0..j-1]. The following
program computes this.
input a[0..n-1,0..n-1];
declare sum[0..n-1,0..n-1];
for i := 0 to n-1 do
for j := 0 to n-1 do {
sum[i,j] := 0;
for k := 0 to i do
for l := 0 to j do
sum[i,j] := sum[i,j]+a[k,l];
}
output sum[0..n-1,0..n-1];
How many arithmetic operations does this program do? How would you make it compute faster? How many arithmetic operations does your optimized program do?
Handins
For Part 1, each group is asked to hand in a printout in class. For Part 2 and the Bonus part, each person is asked to hand in a separate printout in class.
Grading
This assignment is worth about 4% of the course grade. Each of the two parts is worth 90% and 10% of the grade, respectively. The Bonus problem 2 is worth 80% extra credit, equivalent to about 15 points in the midterm.