---
title: "Choose the testing layer for a software factory requirement"
description: "Place assertions in unit, service, scripted browser or natural-language UI tests according to the evidence needed to verify each application requirement."
canonical_url: "https://vostride.com/agent-library/software-factory/choose-the-testing-layer.md"
md_url: "https://vostride.com/agent-library/software-factory/choose-the-testing-layer.md"
content_kind: "guide"
topic: "software-factory"
---

# Choose the testing layer for a software factory requirement

Choose a test by the observation required to establish the outcome. Natural-language UI execution is useful when the acceptance criterion concerns what a person can do through the real interface. A calculation or database invariant may be easier to check directly through existing unit or integration tooling.

## Split a broad requirement

Consider a discount feature. The percentage calculation, eligibility rule, cart display and final persisted order total are separate assertions. Test arithmetic with fixed numeric inputs. Test service eligibility with controlled account and product data. Exercise the actual cart to confirm the selected discount and resulting total are understandable to the user.

If the requirement includes the final order ledger, add an independent persistence check. A correct-looking checkout page does not prove the saved amount is correct. The [checkout recipes](/agent-library/checkout-payments.md) and [hooks guide](/docs/agent-qa/guides/hooks.md) provide relevant test-design and execution references.

## Compare execution approaches fairly

An existing scripted browser suite may already preserve stable regressions effectively. Evaluate natural-language agent-qa tests for the journeys where its authoring and execution model fits the team's workflow. Do not replace a reliable deterministic assertion merely to increase the number of agent-run tests.

Use identical fixture states and known defects when comparing approaches. Record both false passes and failures unrelated to the product. A shorter test definition may reduce authoring effort while introducing different runtime costs; measure the dimensions that matter for the actual project.

## Define the boundary of a UI result

Visual execution does not by itself establish security, accessibility compliance, load capacity or file integrity. Use the appropriate additional tools where those are requirements, and connect their results to the same application revision.

The final acceptance contract can combine evidence from multiple layers. Report which observation each layer supplies so a reviewer can see the remaining gaps. The goal is a verified product behavior, not a particular count of end-to-end runs.

[agent-qa evaluation](/docs/agent-qa/guides/evaluating-agent-qa.md) · [QA architecture](/agent-library/software-factory/qa-architecture-for-a-software-factory.md)
