liveBook · Manning

Check for assumptions

As explained in Software Testing with Generative AI

A prompting technique that instructs a large language model to recognize when required conditions are unmet and provide an explicit fallback instead of guessing.

Check for assumptions is a prompting technique that prevents an LLM from guessing when required input or conditions are missing. Add an explicit fallback instruction so the model can decline the task or report that no result was found. section 2.4.4

A practical assumption check should:

Filtering emails safely

Prompt: “Extract all emails ending in .com from the JSON delimited by three hashes. If none exist, simply write ‘No .com emails found.’” With matching addresses, the output lists addresses such as baveray0@apple.com and pyandell4@ning.com; with records lacking emails, it returns the stated fallback instead of inventing results. section 2.4.4

Analyzing code

Prompt: “Analyze the code delimited by triple hashes and identify risks affecting Performance, security, and interoperability. If no code is provided, respond with ‘No risks could be found.’” Require the format Risk - Quality Characteristic - Explanation and provide an example such as a buffer-overflow risk. section 4.2.2

How Software Testing with Generative AI covers it

How deep it goes
Demonstrates conditional wording, delimiters, fallback outputs, and structured examples without examining model internals.
Examples
Uses .com email extraction and delimited code analysis with performance, security, and interoperability risks.
What it assumes
Assumes basic prompt construction and introduces explicit handling for missing data or code.
What you can do after
Apply it by writing prompts that specify unmet-condition fallbacks before requesting extraction or analysis.
How it connects
Connects prompt engineering with hallucinations, delimiters, few-shot prompting, and software testing risk analysis.

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.