Abstract
Software development is a continuous process that usually starts with analyzing the system requirements and proceeds with design, implementation, testing, and maintenance. Regardless of how good an initial design was achieved, quality of source code tends to decay throughout the development process as software evolves. One of the main contributing factors to this degradation of initial quality can be considered as maintenance operations, for instance to enhance performance or other attributes of the system or to fix newly discovered bugs. For such large software systems, development process also requires reusing existing components which may have been implemented by others. Hence, a comprehensible piece of source code, e.g. one that conveys its message about what it is trying to do easily with understandable and modular implementation, significantly reduces time and effort not only for the implementation phase of the development lifecycle; but also for testing and maintenance phases. In other words, while software decay is inevitable, software comprehension plays a determining role in the total cost and effectiveness of both implementation phase and maintenance phase. Therefore, developers should strive to create software components with modular structure and clearer implementation to reduce the development cost. In this paper, we are interested in finding ways to successfully decompose long methods (those with poor initial implementation and/or decayed overtime) into smaller, more comprehensible and readable ones. This decomposition process is known as extract method refactoring and helps to reduce the overall cost of development. Most of the existing refactoring tools require users to select the code fragments that need to be extracted. We introduce a novel technique for this refactoring. This technique seeks refactoring opportunities based on variable declarations and uses confining fully extractable code regions without any user intervention. We implemented this technique as an analysis and visualization tool to help a user identify candidate code fragments to be extracted as separate methods. With this automation tool, developers do not have to manually inspect a foreign code base to select code fragments for refactoring. Through the visual representations we provide, one can observe all suggested refactoring effectively on large scale software systems and decide whether a particular refactoring should be applied. To show the effectiveness of our techniques, we also provide some case studies conducted using this tool and technique both on our own project’s source code and other open-source projects.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
More From: International Journal of Software Engineering and Knowledge Engineering
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.