Analysing Test-Driven Development Adherence in Open-Source Projects Using Test-to-Code Traceability Links

dc.contributor.authorKirui, Gerald Kipruto
dc.contributor.supervisorLevitt, Stephen
dc.date.accessioned2025-07-14T08:57:35Z
dc.date.issued2024
dc.descriptionA research report submitted in fulfillment of the requirements for the Master of Science in Engineering, In the Faculty of Engineering and the Built Environment , School of Electrical and Information Engineering, University of the Witwatersrand, Johannesburg, 2024
dc.description.abstractSeveral studies have been conducted to determine the impact of Test-Driven Develop- ment (TDD) on software quality. Many studies utilise test-to-code traceability tools and strategies to detect TDD adherence as part of their methodology. However, most test-to-code traceability tools rely on filename-based matching algorithms, which suffer from low recall; therefore, most TDD detection methods are not accurate. This study aims to assess the effectiveness of a statement-based matching algorithm over a filename-based one and whether it can be used to detect the TDD adherence of a software project. The filename-based and statement-based matching algorithms are implemented in Python. To evaluate these algorithms, 500 tests from sixteen Java projects (encompassing frameworks, libraries, and tools for data processing, testing, and web services) are used. These projects range in size from 5,115 lines of code (LoC) to 378,167 LoC. This evaluation helps in understanding the performance of the algorithms through their weighted F1-scores. A mathematical function is created from first principles to correlate method coverage and time deltas with the test-with-development (TWD) adherence of a project. Thereafter, 100 Java projects are used to demonstrate the utility of this function. The results show that the statement-based matching algorithm, with a weighted F1-score of 0.771 and a 95% confidence interval of [0.741, 0.786], is more accurate than the filename-based matching algorithm, with a weighted F1-score of 0.218 and a 95% confidence interval of [0.193, 0.246]. Additionally, the results show that the relative TWD adherence of eleven projects is found to be highly correlated with TDD scores from surveys (rs = 0.723 and p-value = 0.012), and the method coverage of eighteen projects is found to be highly correlated with code coverage obtained from Codecov (rs = 0.744 and p-value = 0.0003). The literature review reveals that no studies have explored the correlation between TDD adherence and the development step size in software projects. An investigation is conducted using a statement-based test-to-code traceability tool and relative TWD adherence values to determine if TDD projects have smaller development steps compared to non-TDD projects. The study finds no significant correlation between median production method churn and relative TWD adherence of projects in all but one out of eight cases.
dc.description.submitterMM2025
dc.facultyFaculty of Engineering and the Built Environment
dc.identifier0000-0002-7865-3074
dc.identifier.citationKirui, Gerald Kipruto. (2024). Analysing Test-Driven Development Adherence in Open-Source Projects Using Test-to-Code Traceability Links [Masters dissertation, University of the Witwatersrand, Johannesburg]. WIReDSpace. https://hdl.handle.net/10539/45426
dc.identifier.urihttps://hdl.handle.net/10539/45426
dc.language.isoen
dc.publisherUniversity of the Witwatersrand, Johannesburg
dc.rights© 2024 University of the Witwatersrand, Johannesburg. All rights reserved. The copyright in this work vests in the University of the Witwatersrand, Johannesburg. No part of this work may be reproduced or transmitted in any form or by any means, without the prior written permission of University of the Witwatersrand, Johannesburg.
dc.rights.holderUniversity of the Witwatersrand, Johannesburg
dc.schoolSchool of Electrical and Information Engineering
dc.subjectUCTD
dc.subjectTraceability Links
dc.subjectAssertion Analysis
dc.subjectTest-With DevelopmentTest-Driven Development
dc.subjectTime Deltas
dc.subjectMethod Coverage
dc.subjectMethod Churn
dc.subject.primarysdgSDG-17: Partnerships for the goals
dc.titleAnalysing Test-Driven Development Adherence in Open-Source Projects Using Test-to-Code Traceability Links
dc.typeDissertation

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Kirui_Analysing_2024.pdf
Size:
1.67 MB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
2.43 KB
Format:
Item-specific license agreed upon to submission
Description: