Testing what you built

  • Release version: Zurich
  • Updated April 30, 2026
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Testing what you built

    Test Agent in the Zurich release automates the testing process for code generated by Build Agent, streamlining build-to-test workflows within a single development session. It generates Automated Test Framework (ATF) functional tests, executes them, and performs root cause analysis (RCA) on failures. This eliminates manual test creation and failure investigation, enabling developers to validate code quality efficiently before release. Note that executing ATF tests requires Zurich Patch 9 or later.

    Show full answer Show less

    Key Features

    • Autonomous Test Authoring: Test Agent automatically creates functional ATF tests based on the code changes and prompts used with Build Agent.
    • Automated Test Execution and Failure Triage: Tests are run automatically, and any failures trigger RCA that either applies safe fixes automatically or provides actionable guidance within the ServiceNow Studio or IDE.
    • Auto-Healing Loop: Build Agent ingests the RCA and re-runs tests, applying fixes until all tests pass, minimizing manual intervention.
    • Integration with ServiceNow Development Tools: The workflow integrates seamlessly with ServiceNow Studio and the ServiceNow IDE for an uninterrupted developer experience.

    Key Outcomes

    • Unified Build and Test Sessions: Developers can build and test applications sequentially in the same session without switching contexts.
    • Faster Failure Resolution: Automated RCA and proposed fixes reduce time spent on troubleshooting test failures.
    • Increased Release Confidence: Automated testing enforces quality gates, providing verifiable evidence of code health before deployment.
    • Test Management: Generated ATF tests are stored under the app scope in the sysatftests table and can be scheduled for regression runs.

    Typical Workflow

    1. Create or modify an app using Build Agent in ServiceNow Studio or the IDE, prompted by your development instructions.
    2. Test Agent generates relevant functional ATF tests based on the prompt and code context.
    3. Prompt Build Agent to execute these tests.
    4. Failures trigger automatic RCA and either autonomous fixes or suggested guidance via the chat panel.
    5. Build Agent applies fixes and reruns tests until they pass, completing the auto-healing process.

    Scope and Availability

    • Authoring Environments: ServiceNow Studio and ServiceNow IDE.
    • Application Scopes: Global, custom, and store scopes supported.
    • Test Types: Functional ATF tests.
    • Execution Targets: Cloud Runner lanes (requires ATF Test Generator and Cloud Runner apps installed and configured).

    Practical Usage Notes

    To leverage Test Agent effectively, ensure you are running Zurich Patch 9 or newer, and have the necessary ATF Test Generator and Cloud Runner applications installed with a cloud user configured. You can prompt Build Agent with commands such as "Generate ATF tests for all the feature permutations on the app we built" and then execute all generated ATF tests to initiate the automated testing and healing workflow.

    Test Agent generates test coverage for code created by Build Agent, executes tests, and performs root cause analysis on failures. Prompt Test Agent to complete build-to-test workflows in a single development session without manual test authoring or failure investigation.

    Test Agent extends Build Agent by making every build safe before release. After Build Agent produces code changes in a development instance, Test Agent consumes the same prompt and code context to author functional Automated Test Framework (ATF) tests, execute those tests, and triage any failures automatically.

    Note:
    To execute ATF tests, you must have Zurich Patch 9 and above.

    When a test fails, Test Agent performs a root cause analysis (RCA) and either auto-applies safe fixes or surfaces actionable guidance in the chat panel so you can resolve the issue without leaving ServiceNow Studio or the ServiceNow IDE.

    Customer outcomes

    Test Agent delivers the following measurable outcomes:
    • Build and test in one session: You no longer need to context-switch between authoring code and writing tests. Both happen sequentially within the same Build Agent session.
    • Faster failure triage: Automated RCA and proposed fixes reduce the time you spend looking through logs after a test run.
    • More release confidence: Measurable quality gates enforced by automated test execution give you verifiable evidence of code health before promotion to production instances.
    • Generated ATF tests are stored in the sys_atf_tests table under the app scope for which they were created. You can schedule regression test runs using the generated tests.

    Example prompts

    An example prompt to get Build Agent to create and run ATF tests would be Generate ATF tests for all the feature permutations on the app we built.

    Then, you can tell Build Agent to Execute all ATF tests.

    Test Agent workflow

    The end-to-end workflow is:
    1. Create or edit an app in a development instance using Build Agent in ServiceNow Studio or the ServiceNow IDE, driven by your prompt.
    2. Test Agent consumes the prompt and the resulting code changes to generate contextually relevant functional ATF tests.
    3. Prompt Build Agent to run the tests.
    4. Failures are automatically triaged. Test Agent produces an RCA and either applies safe fixes autonomously or proposes them to you through the Build Agent chat panel.
    5. Build Agent ingests the RCA from Test Agent and re-executes tests until a passing status is achieved, completing the auto-heal loop.

    Key developer experiences

    Autonomous test authoring
    When you use Build Agent to implement a new story, you can prompt it to create functional tests automatically.
    Assisted troubleshooting
    Test Agent automatically troubleshoots failed tests, generates RCAs, and proposes targeted fixes, eliminating manual log investigation.
    Auto-healing
    Build Agent consumes the RCA produced by Test Agent and applies fixes to code or tests, then re-executes the test suite until all tests reach a passing status. This removes the need for developers to manually patch and maintain tests during a session.

    Scope and availability

    Test Agent is available in the following environments and scopes:

    Table 1. Test Agent scope and availability
    Dimension Supported values
    Authoring environment ServiceNow Studio, the ServiceNow IDE
    Application scope Global, custom, store
    Test types ATF functional tests
    Execution target Cloud Runner lanes
    Note:
    Test execution requires the ATF Test Generator and Cloud Runner app to be installed and a cloud user set up. See here for more details: https://www.servicenow.com/docs/r/zurich/servicenow-platform/atf-test-generator-and-cloud-runner/atf-tg-cr-intro.html