Leanpub Header

Skip to main content

Writing Use Cases for AI

How to write use cases for stakeholders, engineers, and AI agents

Writing Use Cases for AI

Your use cases have a new reader: an AI agent that turns them directly into code and tests. Implementation is now cheap but expressing intent precisely is the bottleneck. This guide teaches you to write use cases that work for stakeholders, engineers, and the AI agents that implement from them.

Interested in this book? Show your support by saying what you'd like to pay for it!

$
PDF
EPUB
WEB
APP
About

About

About the Book

For forty years, use cases have been the best tool we have for describing what a system must do. Ivar Jacobson invented them, Alistair Cockburn taught a generation to write them well, and Use-Case 3.0 connected them to modern agile delivery. All of that work assumed one thing: the reader of a use case is a human being.

That assumption no longer holds. With AI code generation, a use case has a third reader: an AI agent that turns the specification directly into code and tests. Implementation has become cheap; expressing intent precisely is the new bottleneck. The specification is now the asset, and the code is its output.

This guide teaches you to write use cases that work for all three readers: the stakeholders who validate them, the engineers who review against them, and the AI agents that implement from them. You'll learn:

  • What actually changes when an AI reads your specification
  • The classical fundamentals that still carry the weight: actors, goals, scope, and complete behavioral stories
  • A practical specification template with a fully worked example
  • How to write main scenarios and alternative flows an AI cannot misread
  • Precision calibration: what to say, what to leave out, and how tests protect the gaps
  • How to slice use cases for iteration, and how to handle change requests, bugs, and brownfield systems
  • Checklists and common mistakes to keep open in a split pane while you write

Part of the AI Unified Process, and a companion to Spec-Driven Development: From Specs to Code with AI Agents (Apress, 2026). Written for requirements engineers, business analysts, and software engineers who know use cases from Cockburn or Use-Case 3.0 and want the delta, not a rehash.

Share this book

Author

About the Author

Simon Martinelli

Simon Martinelli is a Java Champion, Vaadin Champion, and Oracle ACE Pro with over three decades of experience as a software architect, developer, consultant, and trainer. He is the creator of the AI Unified Process (AIUP) and a strong advocate of Spec-Driven Development.

As the owner of Martinelli LLC, he coaches teams to get up to speed with AI-driven development. He regularly shares his insights through international conferences, articles, and his blog, Keep IT Simple (https://martinelli.ch), where he writes about AI, architecture, and modern Java development.

He is also a lecturer at three universities in Switzerland, where he teaches AI-driven software engineering, software architecture, persistence, DevOps, and cloud-native development.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub