Technical debt prioritization: methods, techniques, and a large exploratory study - Pina, Diogo de Jesus (2023)
Software development teams need to prioritize the technical debt items payment to improve the software quality and ensure the new feature and code maintenance development pace. Identification tools can find thousands of technical debt items in a code repository. Thus, it is infeasible to pay off all items because it would take months or even years. Therefore, the team must decide which items should be paid off and when to pay them. We performed a mapping review to identify studies that assist in the technical debt prioritization process. We found papers that conceptualized the process, developed prioritization frameworks, and applied various methods to accomplish prioritization. Despite the efforts, a prioritization method that considers the software development context, works for several programming languages, covers different types of technical debt, and is integrated into a tool to apply it in practice still needs to be developed. Based on the mapping review, our motivation for this research is to understand how developers prioritize technical debt items in real software projects. Furthermore, we also apply machine learning methods to automate the prioritization process. We developed the Sonarlizer Xplorer tool to mine and analyze public projects hosted on GitHub supporting our studies. The result of applying the tool is a list of technical debt items and code metrics for many software projects. We applied a questionnaire to collect data from public Java projects to understand which criteria software developers use to prioritize code technical debt in real projects. We analyzed the data using Straussian Grounded Theory. We grouped the criteria into fifteen categories and divided them into two super-categories related to technical debt payment and three related to non-payment. We have found that when developers decide to pay off a technical debt item, they want to pay it off soon. When they decide not to pay, it is usually because the debt was acquired intentionally and is related to design decisions. When they used similar criteria, the payment priority levels were similar. Finally, we note that each software project needs its specific rules to identify its technical debt items. We also study the application of machine learning methods to prioritize technical debt items in real software projects. We applied the same questionnaire as in the previous study and obtained 2,616 responses. We create a dataset using three labeling strategies: \"pay or not\", 3-classes, and priority. We applied nine well-known machine learning methods on 27 code metrics to build a model for deciding whether a technical debt item should be paid (with an accuracy mean of 0.79 and F1 mean of around 0.86) and when to pay, applying four approaches achieving accuracy performance of 0.57 using traditional analysis and 0.81 using tuned analysis.