Enhancing Maintainability in Robot Framework Test Suites: An AI-Based Refactoring Approach
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Background. As software systems grow, maintaining large test suites becomes increasingly challenging, particularly in keyword-driven testing frameworks like Robot Framework, where semantic test smells often emerge. These include overly long test cases, inconsistent structure, and redundant logic—issues that reduce readability, reusability, and long-term maintainability. A clear gap remains in tools that support automated refactoring for such issues.
Objectives. This thesis aims to design and evaluate an automated pipeline that improves the maintainability of Robot Framework test suites while preserving their original behavior. The work was conducted in collaboration with Ericsson, a leading telecommunications company, which sought to address maintainability challenges in its industrial-scale test base.
Methods. A hybrid approach was implemented by combining rule-based smell detection with AI-assisted refactoring. Scoped prompts and programmatic insertion techniques were used to ensure precision and preserve behavioral consistency. A custom structural validation tool was developed and used to evaluate the system across ten industrial test cases, and a developer survey was conducted to gather insights into the effectiveness of the refactoring.
Results. The pipeline refactored nine out of ten test cases with full behavioral preservation, and achieved 92.6% preservation in the remaining case. Developers generally preferred the refactored versions, highlighting improvements in structure, clarity, and readability.
Conclusions. The results demonstrate that combining deterministic detection with scoped AI assistance can enhance test suite maintainability without compromising test logic or developer confidence. This approach provides a practical foundation for future AI-driven tools aimed at scalable and maintainable test development.
Place, publisher, year, edition, pages
2025. , p. 27
Keywords [en]
Robot Framework, test, maintainability, semantic test smells, AI-assisted refactoring, validation. i
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:bth-28204OAI: oai:DiVA.org:bth-28204DiVA, id: diva2:1977246
External cooperation
Ericsson
Subject / course
PA1445 Kandidatkurs i Programvaruteknik
Educational program
PAGPT Software Engineering
Supervisors
Examiners
2025-06-262025-06-252025-09-30Bibliographically approved