liveBook · Manning

Data transformation

As explained in Software Testing with Generative AI

The process of converting data from one structure, representation, or language into another while preserving its intended information.

Data transformation converts information between structures, representations, or languages while retaining the original values and intended logic. In testing, LLMs can transform test data, code, and raw testing notes to accelerate exploratory testing, debugging, and test automation. section 3.3.2 section 6.1.2

Useful transformation tasks include:

  • Convert JSON or plain-text records into SQL table definitions and insert statements. section 6.1.2
  • Translate code between languages while retaining its logic and flow, then test the result. section 3.3.2
  • Turn exploratory or design-testing notes into concise summaries for sharing. section 3.3.2
  • Use delimiters, explicit output requirements, and completeness checks to reduce altered values and missing fields. section 6.1.2
###
[{
    "firstname": "Sally",
    "lastname": "Wilson",
    "totalprice": 229,
    "depositpaid": false,
    "bookingdates": {
        "checkin": "2017-02-20",
        "checkout": "2019-07-05"
    },
    "additionalneeds": "Breakfast"
},{
    "firstname": "Jim",
    "lastname": "Jones",
    "totalprice": 871,
    "depositpaid": false,
    "bookingdates": {
        "checkin": "2017-08-11",
        "checkout": "2021-06-30"
    },
    "additionalneeds": "Breakfast"
},{
    "firstname": "Mary",
    "lastname": "Ericsson",
    "totalprice": 558,
    "depositpaid": true,
    "bookingdates": {
        "checkin": "2018-07-04",
        "checkout": "2022-09-25"
    }
}]
###

A concrete booking dataset shows the source JSON that can be transformed into a relational SQL structure and records. section 6.1.2

JSON to SQL

A reusable prompt can define the transformation, require a CREATE TABLE statement and INSERT statements, and ask the model to check every JSON field before responding. The generated SQL preserves names, prices, dates, Boolean values, and a missing additional-needs value as NULL; humans should still verify correctness and validity. section 6.1.2

How Software Testing with Generative AI covers it

How deep it goes
Demonstrates reusable prompts and field-completeness checks, but defers final validation because outputs may be inconsistent or invalid.
Examples
Uses language translation, JSON-to-SQL conversion, cross-language code conversion, and testing-note summarization as concrete transformations.
What it assumes
Requires clear output expectations and useful examples, while prompts can specify unfamiliar data structures through OpenAPI or XSD.
What you can do after
Apply it via reusable LLM prompts to generate or convert test data while checking structure, relationships, and preserved values.
How it connects
Connects LLMs with prompt engineering, test data generation, JSON, SQL, code conversion, and data specification formats.

Also explained in

Compare how 20 books explain data transformation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Testing with Generative AI. The section links point to the parts of the book it draws on.