Automated Clone Elimination in Python Tests (Sebastian Kingston)

By Sebastian Kingston, Volker Stolz
Published May 27, 2024

Just like any other code, test code contains large amounts of duplicate code, also known as code clones. For test code, we can use specific techniques to reduce the number of code clones contained in test suites. In this thesis we present PyTeRor, an automated refactoring tool which refactors pytest test suites by combining Type 2 code clones using parametrization. We evaluate the performance of PyTeRor on nine open-source Python repositories. Our results demonstrate that the refactoring was generally successful, with clones being removed from each repository’s test suite, though there is large variation in the number of clones removed.

Git repository: https://github.com/semaki2000/PyTeRor
(DOI: https://doi.org/10.5281/zenodo.11145543)


Thesis: PDF
Date of defense: 2024-06-14, 14:00, "Procyon" (IFI)
External examiner: Melina Mongiovi (UFCG, Brazil)

Supervisor: Volker Stolz

We have since then published this work at ISoLA'24. Check our entry in Cristin and this post.

Tags: refactoring, Python, Testing, unit tests
Published May 27, 2024 8:35 AM - Last modified May 29, 2026 8:28 AM