Automated Support for Unit Test Generation: A Tutorial Book Chapter
Not on the map. Why?
Abstract (arXiv)
Unit testing is a stage of testing where the smallest segment of code that can be tested in isolation from the rest of the system - often a class - is tested. Unit tests are typically written as executable code, often in a format provided by a unit testing framework such as pytest for Python. Creating unit tests is a time and effort-intensive process with many repetitive, manual elements. To illustrate how AI can support unit testing, this chapter introduces the concept of search-based unit test generation. This technique frames the selection of test input as an optimization problem - we seek a set of test cases that meet some measurable goal of a tester - and unleashes powerful metaheuristic search algorithms to identify the best possible test cases within a restricted timeframe. This chapter introduces two algorithms that can generate pytest-formatted unit tests, tuned towards coverage of source code statements. The chapter concludes by discussing more advanced concepts and gives pointers to further reading for how artificial intelligence can support developers and testers when unit testing software.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 10 of its 34 references that are in the map. First posted on arXiv 26 Oct 2021.
Builds on
10 of 34 references.
References · 10
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2020Automated Unit Test Generation for Pythoncited by 18
- 2015Test Set Diameter: Quantifying the Diversity of Sets of Test Casescited by 10
- 2019Understanding Flaky Tests: The Developer's Perspectivecited by 8
- 2021Using Machine Learning to Generate Test Oracles: A Systematic Literature Reviewcited by 7
- 2016Uncertainty-Driven Black-Box Test Data Generationcited by 4
- 2020Boundary Value Exploration for Software Analysiscited by 4
- 2021Learning How to Search: Generating Effective Test Cases Through Adaptive Fitness Function Selectioncited by 4
- 2018Visualizing test diversity to support test optimisationcited by 2
- 2019Towards Automated Boundary Value Testing with Program Derivatives and Searchcited by 1
Built on by
Not cited yet.