liveBook · Manning

Delimiter

As explained in Software Testing with Generative AI

A delimiter is a character or sequence of characters that marks the boundary between portions of text or data.

A delimiter is a character or sequence of characters that separates portions of text or data. In prompts, delimiters distinguish instructions, rules, examples, source data, code, and existing outputs so an LLM can interpret their roles more clearly. section 2.4.2 section 2.8

Use delimiters to make prompt structure explicit:

  • Separate the task description from the data to process, such as placing a user story between three hash marks. section 2.4.7
  • Define a small notation system for structured data, such as # for a table, % for columns, and | for column properties. section 2.4.2 section 6.1.1
  • Keep multiple inputs distinct, such as separating a user story from an existing risk list or existing test cases. section 8.1.1 section 5.4
  • Mark code boundaries clearly and instruct the model to preserve the delimited code rather than changing it. section 4.2.2 section 4.5.1

Delimited SQL data-generation prompt

You are a SQL data generator. Generate five rows for a MySQL database. Interpret # as the table name, % as a column, and | as the sequence of column name, data type, and options. If an option says random, randomize the value. # rooms % room_name | string | random % type | string | 'single' or 'double' % beds | integer | 1 to 6 % accessible | boolean | true or false % roomPrice | integer | 100 to 200. The same notation can be modified to add requirements such as room_size. The resulting rows can then be checked against the requested types, ranges, and relationships. section 2.4.2

###
public BookingResult createBooking(Booking bookingToCreate) throws
➥SQLException {
    if(dateCheckValidator.isValid(bookingToCreate.getBookingDates())) {
        if (bookingDB.checkForBookingConflict(bookingToCreate)) {
            return new BookingResult(HttpStatus.CONFLICT);
        } else {
            CreatedBooking createdBooking = 
            ➥bookingDB.create(bookingToCreate);
 
            if(bookingToCreate.getEmail() != null && 
            ➥bookingToCreate.getPhone() != null){
                MessageBuilder messageBuilder = new MessageBuilder();
                Message message = messageBuilder.build(bookingToCreate);
 
                messageRequests.postMessage(message);
            }
 
            return new BookingResult(createdBooking, 
         ➥HttpStatus.CREATED);
        }
    } else {
        return new BookingResult(HttpStatus.CONFLICT);
    }
}
###

Inspect the triple-hash boundary around Java code and compare it with the requested risk-analysis instructions. section 4.2.2

Delimiters improve clarity and make prompts easier to reconfigure, but they do not guarantee correct output. Generated data can still contain weak assumptions, invalid relationships, or placeholder URLs, so humans must verify results against requirements. section 2.4.2 section 6.1.1 section 2.8

How Software Testing with Generative AI covers it

How deep it goes
Demonstrates notation design across prompts and testing workflows, but stops short of guaranteeing interpretation or eliminating hallucinations.
Examples
Uses SQL room data, JSON objects, user stories, risk lists, test cases, Java code, and exploratory-testing criteria.
What it assumes
Assumes the ability to write task instructions and judge testing requirements while teaching delimiter notation through concrete prompts.
What you can do after
Apply it via prompt engineering to separate changing data sets and constrain LLM-generated analysis, code comments, test cases, or seed data.
How it connects
Connects delimiters with prompt engineering, structured output, few-shot prompting, test cases, exploratory testing, and quality characteristics.

Also explained in

Compare how 11 books explain delimiter →

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.