Identifying Extract Class and Extract Method Refactoring Opportunities Through Analysis of Variable Declarations and Uses
Date of Award
Doctor of Philosophy (PhD)
Electrical Engineering and Computer Science
James W. Fawcett
Cohesion Metric, Extract Class Refactoring, Extract Method Refactoring, Graph Theory, Software Refactoring
For small software systems, with perhaps a few thousand lines of code, software structure is largely an esthetic issue. When software systems grow large, including perhaps a million or more lines of source code, their structures become much more important.
Developing a large system requires teams of developers working in concert to provide a finished product in a reasonable amount of time. That means that many people will read each component to use, test or modify towards accomplishing new features.
In the software development life cycle, the maintenance phase is a dominant stage that impacts production cost of the system dramatically. This is mainly because, for a successful system, the maintenance phase lasts until the system's retirement and includes crucial operations such as enhancing performance, fixing newly discovered bugs and adopting/expending the software to meet new user requirements. Moreover, a software component may be modified or fixed by someone who is not the original author of that component. In this case, all the operations conducted during maintenance or initial development may lead to insertion of code into a unit that may be unrelated to the original design concept of that unit.
As software systems become large and complex they grow too long to read and understand completely by a single person. After their initial implementations, maintenance operations tend to make the system even less maintainable, increasing the time and effort needed for future maintenance.
In this research, we are interested in finding ways to successfully detect code defects and propose solutions to increase the overall maintainability of software systems that are larger than any one person can completely comprehend from its code alone. This process of refactoring software impacts the total production cost of the system positively by improving the quality of software code such as its comprehensibility and readability.
To reduce the total development cost for a system, we suggest three main re-factorings. These novel forms of refactoring techniques aim to eliminate code defects such as large classes and long methods. The main goal of these re-factorings is to create smaller and cohesive software units with clear intentions to improve the maintainability of software.
We provide analysis and visualization tools to help a user identify candidate code fragments to be extracted as separate unites. With these automation tools, developers do not have to manually inspect a foreign code base to detect possible refactoring opportunities. Through the visual representations we provide, one can observe all suggested re-factorings effectively on large scale software systems and decide whether a particular refactoring needs to be applied. To show the effectiveness of our techniques, we also provide some experiments conducted using these tools and techniques both on our own project's source code and other open-source projects.
Kaya, Mehmet, "Identifying Extract Class and Extract Method Refactoring Opportunities Through Analysis of Variable Declarations and Uses" (2014). Dissertations - ALL. 53.