The object-oriented approach to software development facilitates and encourages programming practices that increase reusability, correctness and maintainability in code. This is achieved in Java by providing mechanisms for inheritance, abstraction and encapsulation. By measuring properties that indicate to what extent these mechanisms are utilised we can determine to a large extent how good a design is. However, because these properties often conflict with other goals such as high cohesion and low coupling it can be difficult for a programmer to recognise the best compromise.We propose the novel approach of treating object-oriented design as a combinatorial optimisation problem, where the goal is maximisation of a set of design metrics. With a view to developing a fully automated design improvement tool we have developed a prototype that uses a small metrics suite combined with automated refactorings to move methods to their optimum positions in the class hierarchy. The action of this simulated annealing system produces a new design that is superior in terms of the metrics used and when judged on object-oriented principles.
[1]
Mel O Cinn eide.
Automated application of design patterns: a refactoring approach
,
2001
.
[2]
Eduardo Casais,et al.
An Incremental Class Reorganization Approach
,
1992,
ECOOP.
[3]
Martin Fowler,et al.
Refactoring - Improving the Design of Existing Code
,
1999,
Addison Wesley object technology series.
[4]
David Abramson,et al.
Simulated Annealing Cooling Schedules for the School Timetabling Problem
,
1999
.
[5]
Leon Moonen,et al.
Java quality assurance by detecting code smells
,
2002,
Ninth Working Conference on Reverse Engineering, 2002. Proceedings..
[6]
Giovanni Righini,et al.
Heuristics from Nature for Hard Combinatorial Optimization Problems
,
1996
.
[7]
Mr. Larry,et al.
Applying and Interpreting Object Oriented Metrics
,
1998
.