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

User Tools

Site Tools

"Benchmark" OOSC Refactoring Exercise "Rectangle"

The code is written for teaching purposes and very short. It is so short that practitioners might not consider the presented smells as problems. Still it demonstrates basic ideas within this very few lines. As Cultivate is rather meant for mid size projects, we are ok with not finding some of the problems.

Cultivate 1.0

  • Smell: Feature envy → Extract + Move Method
    • :-( Not detected.
      • Reason: ATFD counts the number of foreign attributes not the number of accesses.
      • Next steps: Experiment with counting all accesses.
    • [:-\ Warning: Eclipse's Move Method seems to be broken in Eclipse 3.6.]
  • Smell: Comments (in method body telling the “what” not the “why”) → Extract method
    • :-| Not detected. No intention to do so by now.
      • Reason: We don't analyze comments.
  • Smell: Code duplication → Extract method
    • :-| Not detected. No intention yet to do so.
      • Reason: We don't check for code duplication by now.
      • Next steps: Look out for a free tool that checks for code duplication.
      • Future steps: Invent and integrate a new code duplication algorithm.
  • Smell: Dependency cycle → Extract Interface & Use Supertype Where Possible (& use Mock in the test)
    • :-) Detected.
      • See Package Dependency diagram.
        • This is an ADP violation.
        • :-( Unfortunately the dependency we suggest to keep (view –> model) is a SDP violation, while the other doesn't violate any principle.
          • Reason: It's in the definition of the principles.
          • Next step: Invent and experiment with alternative principles. (E.g. minimize size of the Interface to extract. Although this wouldn't help here either.)
          • Workaround: Define an architecture (view –> model) and fix the violations.
      • Both packages have “improved abstractness” 1.0 (which is too high) and “rcm abstractness” 0.0 (which could be higher for the model).
      • Bug: DIP uses our “improved abstractness”, while the “RC Martin square” uses the original metric.
      • Bug: abstractness(model) should be 0.25 or 0.20 (if we count the test) but not 0.0
research/cultivate/benchmark_refactoring_exercise_rectangle.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024