6 Rapid data creation using AI

 

This chapter covers

  • Generating basic test data using LLMs
  • Changing the format of test data
  • Using complex data sets to prompt LLMs to create new data sets
  • Integrating LLMs as a test data manager for automated checks

Managing test data is one of the most challenging aspects of testing and software development. Typically, data requirements grow with the complexity of a system. Having to synthesize data relevant to our context for automated checks and human-driven testing that handles complex data structures and anonymizes at scale and on demand can impose a huge drain on testing time and resources, which could be better spent on other testing activities.

However, we need test data. It is simply not possible to carry out most testing activities if we lack the necessary data to trigger actions and observe behavior. That’s why this chapter shows how we can use large language models (LLMs) to generate test data, providing different prompts to create both simple and complex data structures and integrate LLMs into our automation frameworks via third-party APIs.

6.1 Generating and transforming data with LLMs

6.1.1 Prompting LLMs to generate simple data sets

6.1.2 Transforming test data into different formats

6.2 Processing complex test data with LLMs

6.2.1 Using format standards in prompts

6.2.2 SQL exports as prompt guides

6.3 Setting up LLMs as test data managers

6.3.1 Setting up an OpenAI account

6.3.2 Connecting to OpenAI

6.4 Benefiting from generated test data

Summary