How I Approach Testing AI Systems (And Why It's Different) Most testing advice assumes you control what your code returns. With AI systems, you don't. The model decides. That changes everything about how you write tests. Here's the approach I use when testing LLM integration layers — the classes that sit between your application and the AI provider. The One Rule: Mock the Service, Never Your Code When I test an AI client, I mock the network call to OpenAI or Ollama — not the