liveBook · Manning

Formal model

As explained in Software Testing with Generative AI

An explicitly defined model that uses established symbols, rules, or notation to represent a system.

A formal model represents an application with explicit symbols and rules, making a chosen perspective clear enough to inspect and use for risk-focused testing. section 5.3.2

Different models expose different risks. Data flow diagrams emphasize how data is handled; structural UML diagrams expose architecture; behavioral diagrams capture user flows. section 5.3.2

Useful formal-modeling choices include:

  • Data flow diagrams for tracing how information moves through the application. section 5.3.2
  • UML component diagrams for decomposing architecture and targeting risks in specific system parts. section 5.3.2
  • Sequence and use case diagrams for representing user behavior and generating user-focused risk prompts. section 5.3.2

Booking list functionality

A component model can represent a BookingRequest class calling an Auth API to verify that BookingService may complete a request. That model can become a prompt asking an LLM to generate risks for the represented behavior. section 5.3.2

Figure 5.6 A component diagram of the booking list functionality

Use the component diagram to inspect architectural boundaries and dependencies in the booking list functionality. section 5.3.2

Figure 5.7 A user flow diagram of the booking list functionality

Use the user-flow diagram to inspect behavioral paths and formulate user-focused risk prompts. section 5.3.2

How Software Testing with Generative AI covers it

How deep it goes
Defines symbols, rules, and model types, then demonstrates risk prompts; it stops short of detailed notation or validation procedures.
Examples
Uses booking list architecture, BookingRequest, Auth API, BookingService, and user-flow prompts as concrete modeling examples.
What it assumes
Assumes an application to model and basic data-flow modeling, then expands toward architectural and behavioral perspectives.
What you can do after
Apply it via data flow, UML, or behavioral diagrams to generate broader, perspective-specific testing risks.
How it connects
Connects data flow diagrams, UML, component diagrams, sequence diagrams, use case diagrams, software testing, and large language models.

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.