EUVIMEDEUVIMED entdecken
Crossref

Automated Refactoring for Conditional Branching

Yang Zhang, Xi Zhang, Chunhao Dong, Chaoshuai Li, Grant Meredith

IEEE Transactions on Services Computing · 2026-07 · 19 (4) · 2702-2715

DOI: 10.1109/tsc.2026.3696354 ↗

Kurz gefasst

Fachartikel in der Zeitschrift IEEE Transactions on Services Computing, 2026-07. Verfasst von Yang Zhang und 4 weiteren Autor:innen. Die Arbeit nennt 43 Literaturangaben. Gefördert von: Hebei International Collaboration Foundation.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Conditional branching provides a fundamental structure for executing a specific branch based on the value of a boolean expression at run-time. However, repeated or nested conditional branching can lead to increased complexity. Furthermore, fall-through semantics in conditional branching result in uncontrollable jumps. Refactoring conditional branching manually is error-prone, time-consuming, and tedious. There is a critical need to provide automated refactoring support for conditional branching. To this end, this paper presents ReBrancher, an automated refactoring approach to eliminate repeated or nested conditional branching. Firstly, ReBrancher parses source code into an abstract syntax tree and walks through conditional branching statements. Secondly, it removes redundant fall-through semantics by static program analysis and an automaton. The automaton is constructed from a control flow graph to match patterns of conditional branching. Finally, it converts a conditional branching into a switch expression and removes the fall-through semantics. ReBrancher was evaluated on nine real-world projects involving 25,137 conditional branchings. Experimental results show that a total of 1,790 conditional branching constructs are refactored within an average of 18.62 seconds per project. Furthermore, ReBrancher reduced the average cyclomatic complexity by 4.41% and removed 1,249 code smells, demonstrating its effectiveness in improving code quality.

Förderung

  • Hebei International Collaboration Foundation

Zitieren

APA

Zhang, Y., Zhang, X., Dong, C., Li, C., & Meredith, G. (2026). Automated Refactoring for Conditional Branching. IEEE Transactions on Services Computing, 19(4), 2702-2715. https://doi.org/10.1109/tsc.2026.3696354

Vancouver

Zhang Y, Zhang X, Dong C, Li C, Meredith G. Automated Refactoring for Conditional Branching. IEEE Transactions on Services Computing. 2026;19(4):2702-2715. doi:10.1109/tsc.2026.3696354

BibTeX
@article{Zhang2026,
  author = {Zhang, Yang and Zhang, Xi and Dong, Chunhao and Li, Chaoshuai and Meredith, Grant},
  title = {Automated Refactoring for Conditional Branching},
  journal = {IEEE Transactions on Services Computing},
  year = {2026},
  volume = {19},
  number = {4},
  pages = {2702--2715},
  doi = {10.1109/tsc.2026.3696354}
}
Kostenlos starten →