Test-Driven Development: Exploring Prompt Engineering
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Background: Test-Driven Development (TDD) offers theoretical benefits for software quality and design but faces significant adoption challenges due to its counter-intuitive approach and steep learning curve. Recent advances in artificial intelligence (AI), particularly large language models, present opportunities to address these barriers by automating aspects of the TDD process.
Objectives: This study aimed to (1) identify key benefits and challenges of AI-assisted TDD for novice developers through systematic literature review, (2) quantify how AI assistance affects efficiency, accuracy, and test coverage compared to manual TDD, and (3) determine whether AI can help minimize the skill gap between novice and experienced developers in TDD testing.
Methods: Two methods were used to answer the questions, combining a literature review of six recent studies on AI-assisted TDD with an experimental study. The experiment involved 13 participants (8 novices, 5 experienced) who implemented a concert itinerary system using both manual and AI-assisted TDD. Performance was measured across three phases of TDD (red, green, refactoring) regarding time efficiency, test accuracy, and code coverage.
Results: Literature analysis revealed three main benefits (automation, education, quality improvement) and three key challenges (learning difficulties, technical implementation, supervision requirements) of AI-assisted TDD. Experimental results showed that AI significantly improved test writing efficiency while maintaining comparable accuracy. Code coverage showed modest improvements with AI assistance , with experienced developers gaining greater benefits than novices. Despite efficiency gains, novices using AI required substantially more refactoring time than experienced, indicating persistent understanding gaps.
Conclusions: AI assistance significantly reduces the time burden of TDD, addressing a key adoption barrier, while maintaining test quality and modestly improving coverage. However, AI creates a paradox: making TDD more accessible while potentially limiting deeper understanding development. The most effective approach integrates AI efficiency with human critical evaluation, where AI handles routine aspects while developers focus on the higher-order reasoning that makes TDD valuable. This integration represents a promising path toward wider TDD adoption in experienced software development
Place, publisher, year, edition, pages
2025. , p. 41
Keywords [en]
Test-Driven Development, Artificial Intelligence, Prompt Engineering, Software Testing
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:bth-28129OAI: oai:DiVA.org:bth-28129DiVA, id: diva2:1971520
Subject / course
PA1445 Kandidatkurs i Programvaruteknik
Educational program
PAGPT Software Engineering
Presentation
2025-05-26, C245ALC, Valhallavägen 10, 371 79, Karlskrona, 13:30 (English)
Supervisors
Examiners
2025-06-172025-06-172025-09-30Bibliographically approved