ASE2022
Towards a Live Environment for Code Refactoring
Sara Fernandes
被引用 2 次
摘要
Refactoring enhances the design of existing code while maintaining its original functionality, improving its quality while decreasing maintenance costs. Practitioners do not always refactor despite the advantages, especially if unaware of refactoring opportunities. Moreover, if the developer is not comfortable with the process, it can cause considerable slowdowns and dirty code, ultimately decreasing productivity. Live Software Development is an idea that aims to improve the liveness of SDLC 1 activities, for example, by making the development environment more informative, responsive, and immediate. Live Refactoring, concretely, incentivizes practitioners to refactor more often by automating the environment's refactoring capabilities, providing feedback on quality attribute enhancements, code previews, and automatic suggestions. Currently, IDEs 2 only support the most popular refactorings. Specific organizations or frameworks might have their own refactoring needs and processes, which can also benefit from the liveness. While IDEs usually provide refactoring extensibility APIs 3 , creating a new refactoring plugin has a very steep learning curve, potentially translating into significant time investments. Additionally, multiple refactorings might have patterns in common, and replicating the same behaviors over different refactorings is counterproductive and may introduce bugs. This dissertation aims to improve development environments by making the refactoring plugin creation processes more automatic and reusable. Refactoring plugins are built by selecting the desired, auto-generated behavior modules featuring Live Refactoring capabilities. The user can focus on orchestrating modules instead of writing low-value boilerplate code. An internal DSL 4 was created to allow the development of said tools, which was validated by performing a set of controlled experiments with programmers of varying maturity. Ultimately, this work intends to improve the refactoring plugin creation experience and assess if the proposed solution can help novice and experienced practitioners enhance their development experience and productivity, leading to fewer bugs, time savings, and better code quality. 1 Software Development Life-Cycle 2 Integrated Development Environment 3 Application Programming Interface 4 Domain-Specific Language i First, I would like to thank my supervisor, professor Ademar Aguiar. It really was a pleasure working with you to create this dissertation, which actually began half a year before the start of this academic year. Since our initial brainstorming meetings you were always supportive, enlightening, and reachable. Moreover, your cheerfulness made it much easier to finish this project. Thank you for trusting in me, for welcoming me as your supervisee, and for all you have taught me. My acknowledgements also go to DevScope, the company that welcomed and supported this idea. More concretely, I would like to thank José António Silva for trusting in me and giving me the chance to work at such a great company. Additionally, I want to thank David Mota for all the support, knowledge, and discussions on life, the universe and everything. I am also tremendously thankful to my parents, Carlos and Margarida, and my two closest aunts, Helena and Isabel. You have raised me and supported me since the day I was born, during good and bad times. Without you, this would not have been possible. I am truly privileged to have you by my side. From the bottom of my heart, thank you for your love. And Lena, never lose your faith and hope. As St. John of the Cross once said: "The endurance of darkness is the preparation for great light". To my friends Zé and Bárbara: thank you for never letting our friendship fade away. You have been my closest friends since we met at University of Minho in 2016, and I am forever grateful to have you in my life. You are truly special. I must also thank my dear friend "Broas". You are not here, but the truth is that you have never left. Your will and character have helped shape me into the person I am today. I plan to keep our promise. Thank you for your friendship. May your light keep shining over us all, and may God bless you. To all others who have helped me along the way, thank you.