6 Rapid data creation with AI

 

This chapter covers

  • Generating basic test data using LLMs
  • Transforming test data from one format to another
  • Using complex data sets to prompt LLMs to create new datasets
  • Integrating LLMs as a test data manager for automated checks

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

However, we need test data. We simply cannot carry out most testing activities if we lack the necessary data to trigger actions and observe behavior. That’s why, in this chapter, we’ll explore how we can use large language models to generate test data for us. Exploring different prompts to create both simple and complex data structures and integrate LLM models 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 guides for prompts

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

6.5 Summary