liveBook · Manning

Prompt

As explained in Software Testing with Generative AI

A prompt is an input instruction or context supplied to a language model to guide its generated output.

A prompt is the natural-language input sent to a large language model. It supplies instructions, context, constraints, examples, or requested formats that shape a probabilistic response. section 2.3 section 1.3

Useful prompts frame a specific testing or development problem rather than asking for a generic answer. Clear instructions, delimiters, structured output, assumption checks, and few-shot examples make the intended result more explicit. section 2.4.1 section 5.2.1

A practical prompt commonly specifies:

  • The role or task, such as analyzing risks in a software feature or reviewing code. section 4.2.1 section 4.2.2
  • The input boundary, using delimiters to separate requirements, code, models, or existing test cases from instructions. section 4.2.1 section 5.4
  • Constraints for quality characteristics, numbering, word limits, output fields, or response format. section 2.3 section 6.1.1
  • A request to break down complex work, check the result, avoid repetition, or compare suggestions with known risks. section 2.4.6 section 5.4

From generic request to targeted testing prompt

“Create tests for a file upload feature” leaves file formats, size limits, access control, progress updates, and auditing under-specified. A stronger prompt supplies those acceptance criteria, requests risks or test cases by quality characteristic, and defines the expected structure. Similarly, a data-generation prompt can request five JSON objects, specify each field’s type and allowed values, and require a count check before output. section 1.2.2 section 6.1.1

A prompt improves the likelihood of a useful response but does not guarantee correctness. LLMs may hallucinate, overfit a long conversation, misunderstand weakly specified requirements, or produce plausible but unsuitable code and data. Human judgment remains necessary to choose relevant suggestions, verify outputs, and decide what to test. section 2.7 section 5.5

Figure 5.5 Area of effect model showing the skills required to get valuable outputs from an LLM

Use the area-of-effect model to relate prompt quality to the testing skills and context needed for valuable outputs. section 5.3.1

How Software Testing with Generative AI covers it

How deep it goes
Defines prompts and develops construction tactics through worked examples, but stops short of guaranteeing reliable or self-validating outputs.
Examples
Demonstrates file-upload tests, contact-form risks, code-risk analysis, booking-list test cases, Java comments, unit checks, and JSON datasets.
What it assumes
Assumes testing or development judgment for framing problems and verifying results, while teaching prompt construction from the natural-language-input definition.
What you can do after
Apply it via prompt-engineering tactics to request focused suggestions, structured outputs, test cases, risks, code, comments, or test data.
How it connects
Connects prompts with large language models, prompt engineering, risk-based testing, test planning, test cases, test data, and code assistants.

Also explained in

Compare how 50 books explain prompt →

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.