Testing and Evaluation Strategies for AI-Powered Code Editor with Agentic Editing
zed · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: AI-powered code editor reliability
Zed needed reliable agentic editing in a Rust code editor while preserving its empirical engineering culture despite non-deterministic LLM outputs, streaming edits, parsing edge cases, and model-specific behavior.
Constraints:
- Agentic edit outputs are stochastic.
- High-level evaluations can fail for many possible reasons.
- Streaming edits need robust old-text/new-text parsing.
- XML tags, indentation, and escaping behavior can break edits.
- The editor targets high-performance native interaction.
Architecture
Zed combined data-driven high-level evaluations with deterministic and stochastic unit tests around specific editing mechanisms. For streaming edits, it moved from single tool calls to a two-stage model loop: a small tool call describes intended edits, then the model streams old-text/new-text blocks that are parsed and applied incrementally.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR agentic_editing_model["Agentic editing model"] --> streaming_edit_parser["Streaming edit parser"] streaming_edit_parser --> code_buffer["Code buffer"] agentic_editing_model --> evaluation_harness["Evaluation harness"] evaluation_harness --> stochastic_unit_tests["Stochastic unit tests"] stochastic_unit_tests --> streaming_edit_parser
Components
| Component | Role | Interacts with |
|---|---|---|
Agentic editing model |
Generates intended edit descriptions and old/new text blocks. | Streaming edit parser, Evaluation harness |
Streaming edit parser |
Parses structured streamed old/new blocks and handles malformed output. | Agentic editing model, Code buffer |
Code buffer |
Editor state that receives incremental edits. | Streaming edit parser |
Evaluation harness |
Runs headless editor tasks and high-level coding-agent evaluations. | Agentic editing model, Stochastic unit tests |
Stochastic unit tests |
Runs repeated focused tests for nondeterministic LLM behaviors and parser edge cases. | Evaluation harness, Streaming edit parser |
Data flow
A code-editing task runs through high-level agent evaluations and targeted stochastic tests. For actual editing, the model first describes the intended change, then emits structured old/new text blocks; Zed parses, validates, and applies those blocks incrementally while tests probe parser and formatting edge cases.
3 supporting quotes
Why this architecture
Zed layered tests because broad agent evaluations reveal failures but are too coarse to debug; focused stochastic tests catch nondeterministic parser and edit behavior where deterministic unit tests alone are insufficient.
3 supporting quotes
Models used: Claude 4 · Frontier LLMs
Scale
- Zed's editor is engineered to render at 120 frames per second.“designed to deliver frames at 120 frames per second.”summary, stated
- The editor includes about 1,200 lines of GPU shader programs.“approximately 1,200 lines of shader programs running on the GPU”summary, stated
Alternatives considered (roads not taken)
Traditional tool calls for edits
Rejected because: They did not stream well and produced poor progressive user experience.
Rely only on high-level SWE-bench-like evaluations
Rejected because: Failures were too hard to diagnose among many possible causes.
Patterns
eval-driven-development (quality)
Zed used high-level evaluations plus focused stochastic unit tests to validate agentic editing.
tool-use-orchestration (editing workflow)
The model first uses a small edit-description tool call, then emits streamed old/new blocks for application.
Tradeoffs
Use a two-stage streaming edit protocol.
Chose Tool description plus streamed old/new text blocks over Single non-streaming tool call.
Rationale: The two-stage design improves user experience by showing progressive edits while reusing model cache.
Gotchas (what bit them)
Streaming LLM edits require robust parsers, not just prompts.
Root cause: The model can emit malformed, incomplete, or incorrectly structured output while streaming.
Resolution: Build parsing, validation, and focused tests around the output format.
High-level agent tests are poor debugging tools by themselves.
Root cause: A failed end-to-end coding task can involve millions of possible failure modes.
Resolution: Pair them with programmatic stochastic unit tests for specific mechanisms.
Evaluation
Zed evaluated agentic editing with headless repository tasks, stochastic unit tests, deterministic unit tests, repeated runs, and pass/fail thresholds.
Metrics: Hundreds of stochastic iterations. · Pass/fail thresholds. · Parser and formatting unit tests. · Headless coding-agent task outcomes.
Outcomes
- Zed deployed reliable AI-powered code editing features.
- The system supports streaming edits instead of all-at-once tool-call outputs.
- The evaluation suite covers XML, indentation, escaping, and streaming behavior.
The summary mentions hundreds of stochastic iterations and a native editor target of 120 FPS, but not production user volume.