Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Release date: Wednesday, 02.07.14 - Due date: Sunday, 06.07.14, 23:59
20 = 4+7+5+4 points |
---|
The lecture has now made its way from the “Requirements Engineering” to the “Implementation”.
So, let's compare the Analysis Model
with our actual implementation:
a) List for the three use cases that are to a larger part implemented on the client the following information:
b) Look out for differences and similarities and list them as well:
c) Review as well the sequence diagram:
d) Let us assume that this software and the models would now be handed over to another team. Of course the next team would be happy to get understandable software and models from you. So let us assume you had a few days to make some corrections. Add to each of the differences you found a remark, whether you
We'd like to get one short sentence per difference. You don't need to do the changes. We just want to learn from you, whether the differences are there for systematic reasons or whether they could be removed in a more perfect system.
10 [+ 2] points |
---|
We have an implementation of a class Rectangle that stores its coordinates in two instances of the class Interval, one for the horizontal and one for the vertical extension of the Rectangle.
You can find the source code for this task (with a JUnit-test) as well in your repository in the project A12T47_Refactoring
.
package gui; import model.Rectangle; public class View { public Rectangle rectangle; public void redraw() { System.out.println(rectangle); } }
package model; import static java.lang.Math.*; import gui.View; public class Rectangle { private Interval horizontal; private Interval vertical; private View view; public Rectangle(View view, int startX, int startY, int endX, int endY) { if ((startX > endX) || (startY > endY)) throw new IllegalArgumentException("Parameters in wrong order."); this.horizontal = new Interval(startX, endX); this.vertical = new Interval(startY, endY); this.view = view; view.rectangle = this; } /** * Create an empty Rectangle with no location. */ public Rectangle(View view) { this.horizontal = null; this.vertical = null; this.view = view; view.rectangle = this; } public Vertex getCenter() { if (horizontal == null) return null; return new Vertex((horizontal.start + horizontal.end) / 2, (vertical.start + vertical.end) / 2); } public boolean contains(Rectangle parameter) { if (parameter.horizontal == null) return false; if (horizontal == null) return false; // check whether the horizontal interval // contains the horizontal interval // in the other rectangle // AND // check whether the vertical interval // contains the vertical interval // in the other rectangle return ((horizontal.start <= parameter.horizontal.start) && (parameter.horizontal.end <= horizontal.end)) && ((vertical.start <= parameter.vertical.start) && (parameter.vertical.end <= vertical.end)); } /** * Enlarge the Rectangle just enough so that it contains the other * Rectangle. If the Rectangle was empty it gets the same extension * as the other Rectangle. */ public void accommodate(Rectangle other) { if ((other == null) || (other.horizontal == null)) return; if (horizontal == null) { horizontal = new Interval(other.horizontal); vertical = new Interval(other.vertical); return; } horizontal.start = min(other.horizontal.start, horizontal.start); horizontal.end = max(other.horizontal.end, horizontal.end); vertical.start = min(other.vertical.start, vertical.start); vertical.end = max(other.vertical.end, vertical.end); view.redraw(); } public boolean equals(Object obj) { if (!(obj instanceof Rectangle)) return false; Rectangle other = (Rectangle) obj; if (horizontal == null) return (other.horizontal == null); return (horizontal.equals(other.horizontal)) && (vertical.equals(other.vertical)); } public String toString() { return "Rectangle(" + horizontal + " x " + vertical + ")"; } }
Tip: The automated refactorings in Eclipse are more effective if you use some tricks:
[12 + 3 points] |
---|
Do you still remember your software vision? Fly over the (slides of the) lecture and describe in one or two sentences ideas from the lecture that you would use in your implementation (idea?/why?/how?). You get 0,5 points for each reasonable idea. We will count not more than three ideas per slide set and not more than 24 ideas (12 points) in total.
You may as well list up to three questions that the lecture did not answer for you.
4 points |
---|
Tell us in the following table how many test cases it needs to cover all statements, all branches, all paths or all basic paths:
Evaluation: 1 point for each coverage criterion for which you gave all numbers correct.
0 points |
---|