SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Assignment 12: Review and Refactoring

Release date: Wednesday, 02.07.14 - Due date: Sunday, 06.07.14, 23:59


Task 46: Analysis Model vs Implementation

20 = 4+7+5+4 points

The lecture has now made its way from the “Requirements Engineering” to the “Implementation”. 8-)

So, let's compare the Analysis Model

with our actual implementation:

    • Remark 1: To keep the task feasible we concentrate our effort on the customer application.
    • Remark 2: You might want to check out the project into your workspace.

a) List for the three use cases that are to a larger part implemented on the client the following information:

  • Use Case Name
  • Analysis Objects in the Analysis Object Model that realize this Use Case
  • Implementation classes that correspond to this Analysis Objects.

b) Look out for differences and similarities and list them as well:

  • Are there classes in the implementation that have no counterpart in the model?
  • Are there classes in the model that have no counterpart in the implementation?
  • Are there other differences, e.g. in the naming?
  • Compare as well the dependencies in the model to the dependencies in the implementation!
    • Tip: Check out the imports of the Java files.

c) Review as well the sequence diagram:

  • What are the differences and the similarities between the flow in the implementation and the model:
    • Remark: You can restrict your discussion to the part of the sequence diagram that takes place in the customer application.
    • Tip: You might want to start from the controller object. Which methods are called by the controller? Which methods of the controller are called by whom?

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

  • would keep the difference, or
  • would change or correct the model, or
  • would change or correct the implementation.

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.


Task 47: Refactoring

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.

  1. Review the code below. Give us six ideas how to improve it. If you can name a bad smell somewhere, do it. Which refactorings would you apply? We won't count the suggestion to introduce getter-methods. (Maybe you understand later why (see 3)).
  2. Give us for four cases the code that we would get after your refactoring.
  3. (Optional) Reviewing your code after executing the refactorings, could you imagine why we suggest being reluctant concerning the introduction of getter-methods?

You can find the source code for this task (with a JUnit-test) as well in your repository in the project A12T47_Refactoring.

View.java

Rectangle.java

Tip: The automated refactorings in Eclipse are more effective if you use some tricks:

  • Before extracting a method extract those expression you want to become parameters into local variables.
  • Before moving a part of a method to another class, you should extract this part into an own method in the current class.
  • If you need more tips: Ask on the mailing list! :-)

Task 48: Lecture Review (optional)

[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.


Task 49: White-Box Testing, Coverage

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:

Control Flow 1 Control Flow 2 Control Flow 3 Control Flow 4
Statements
Branches
Paths
Basis Paths

Evaluation: 1 point for each coverage criterion for which you gave all numbers correct.


Task 50: The future starts here

0 points
  • Prepare questions for the final lectures and tutorials, so that we may clarify what had not become clear till now.
  • In the future, make best use of what you learned in the lecture. Challenge the ideas. Develop them further. Change them, if necessary. Reconsider them, if you are missing an answer to a problem, the lecture might have touched.
  • No more advice here. Others have advice, like wearing sunscreen. Could be a useful tip these days.
teaching/lectures/oosc/2014/assignment_12.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024