Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard.

Similar presentations


Presentation on theme: "1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard."— Presentation transcript:

1 1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard for constructors already there?  Do comment lines tend to surround poorly written code?  What savings can be made through refactoring? Kerievsky’s Catalog of Refactoring to Patterns  ‘Replace Multiple Constructors with Creation Methods’ Eliminates code duplication inside constructors Makes the class more maintainable because the methods are named more appropriately

2 2 What did we do? Manually collected all classes with three or more constructors from 10 systems (five Java and five C++ of different application domains)  140 identified from the five Java systems  For each class, simulated the removal of constructors and lines of code saved as a result  Counted the number of comment lines removed as a result Results:

3 3 ~ 400 lines of duplicated code removed across three of the Java systems ~ 1250 lines of comments removed from the same three systems (incidentally, were the worst written systems) Two of the Java systems showed little or no opportunity for refactoring (the best written systems) Improved comprehensibility of the classes involved(?) C++ systems virtually no opportunity for the same refactoring (friends? No interfaces?)

4 4 Thanks for listening!


Download ppt "1 Kerievsky’s Constructor Refactoring – An Empirical Study Research questions:  Do developers add constructors to OO classes Willy-nilly without any regard."

Similar presentations


Ads by Google