Addis Ababa Science and Technology University
Addis Ababa Science and Technology University
UNIVERSITY
COLLEGE OF ENGINEERING
DEPARTMENT OF SOFTWARE ENGINEERING
Group Member ID
1. Selihom Demeke Ets1159/13
2. Yihun Shikuri Ets1317/13
3. Yodahe Ketema Ets1328/13
4. Yordanos Seyoum Ets1371/13
5. Yordanos Yirgu Ets1374/13
1.Introduction to Refactoring
Refactoring is the process of systematically improving the internal structure of existing code
without changing its external behavior. It enhances code readability, maintainability, and
adaptability, making it easier to modify and extend while reducing the risk of introducing
defects. Over the past 30 years, refactoring has evolved beyond simple code transformations
to encompass architectural, model, and requirement-level improvements. This expansion
reflects the growing complexity of software systems and the need for structured approaches to
ensure long-term software quality.
According to Abid et al., refactoring research has focused on key areas such as determining
optimal refactoring timing, recommending appropriate refactoring techniques, detecting
opportunities for code improvement, and validating refactored code. Despite significant
progress, the field remains fragmented across different domains, making it difficult to
establish a unified framework. Their systematic literature review, which analyzes over 3,000
studies, highlights current trends and gaps in refactoring research, emphasizing the need for
further exploration to enhance automation, scalability, and best practices in software
maintenance.
Definition: Involves breaking down a long method into smaller, more manageable methods to
enhance readability and maintainability.
Characteristics:
Improves code modularity
Enhances readability and reusability
Reduces code duplication
Example: Splitting a method that performs multiple tasks into separate methods that handle
each task individually [2].
Definition: Replaces a method call with the method’s content when the method is too simple
and does not add clarity.
Characteristics:
Simplifies code when unnecessary method abstraction exists
Reduces method call overhead
Enhances code comprehensibility
Example: Removing an unnecessary function and directly implementing its logic where called
[3].
Example: Shifting a method from a utility class to a domain-specific class where it is more
relevant [4].
Definition:
Pull-up: Moves a method to a superclass to eliminate redundancy.
Push-down: Moves a method to a subclass when it is only relevant there.
Characteristics:
Increases code reuse
Strengthens class hierarchies
Reduces duplication
Increased Development Time: Frequent refactoring can delay new feature implementation.
Risk of Introducing Bugs: Without proper testing, refactoring may lead to unintended
functionality changes.
The best refactoring technique depends on the software context. Extract Method is widely
used due to its ability to improve modularity and maintainability, whereas Move Method is
essential for reducing class dependencies. Automated refactoring tools and deep learning-
based techniques are emerging to improve refactoring efficiency and accuracy [8].
6. Conclusion
References
[2] Y. Zhao, W. Wu, and Y. Fei, "An Architecture Refactoring Approach to Reducing
Software Hierarchy Complexity," J. Softw. Evol. Process, vol. 35, no. 5, pp. 1-15,
2023.
[4] A. Nandini, R. Singh, and A. Rathee, "Code Smells and Refactoring: A Tertiary
Systematic Literature Review," Int. J. Syst. Eng., vol. 14, no. 1, pp. 45-62, 2024.
[8] "A Systematic Review of Machine Learning Techniques for Code Refactoring
Recommendation," J. Syst. Softw., vol. 192, no. 4, pp. 1-25, 2022.