# Enabling & Configuring Test Optimization

In SeaLights, Test Optimization (TIA - Test Impact Analysis) is managed at the **Test Stage** level. A Test Stage represents a specific phase in your pipeline, such as Unit Tests, Component Tests, Integration Tests, or E2E.

The configuration path is determined by how the stage interacts with your applications. You will use either the **App-Level** model or the **Cross-App** model depending on whether the stage is dedicated to a specific application or monitors a shared environment.

For a detailed technical comparison of these two models, refer to the [Test Optimization Models: Cross-App vs. App-Level](/knowledgebase/test-optimization/test-optimization-strategy/test-optimization-models-bounded-vs.-unbounded.md).

***

### App-Level Test Stages

The App-Level model is used for stages that are tied to a specific application. This is standard for tests like **Unit Tests** or **Component Tests** that reside within a single project's scope, where the relationship between code and tests is 1:1.

#### **How to Enable & Configure:**

1. **Navigate to Strategy:** Go to **Test Optimization > Strategy**.
2. **Select Stage:** Find your App and Test Stage in the list, hover the row and click the Breakdown Analysis & Settings button to open the **Breakdown** page.
3. **Open Settings:** Click the **TIA Settings** button at the top right of the breakdown view.
4. **Define Parameters:** In the configuration popup, define your optimization parameters at the **Branch level**. The system will now provide optimization recommendations for that specific app/branch context.

> For a detailed explanation, refer to: [App-Level Test Stage Configuration](/knowledgebase/test-optimization/test-optimization-strategy/enabling-test-optimization/tia-configuration.md).

### Cross-App Test Stages

The Cross-App model is used for stages that report data on a **Test Level**. This applies to lab environments or shared stages (like Integration or E2E) that report coverage for whichever apps happen to be running in the environment at that moment.

#### **How to Enable & Configure:**

1. **Navigate to Strategy:** Go to **Test Optimization > Strategy**.
2. **Select Stage:** Find your Test Stage in the list and click the row to open the **Strategy Overview**.
3. **Access Orchestration:** Click **Configure Strategy** to access the Orchestration Layer.
4. **Select Strategy Level:** Choose a predefined optimization profile based on your requirements: Conservative, Moderate, or Aggressive.

> For a detailed explanation, refer to: [Cross-App Test Stage Strategy Configuration](/knowledgebase/test-optimization/test-optimization-strategy/enabling-test-optimization/cross-app-test-stage-strategy-configuration.md).

***

### FAQ

<details>

<summary><strong>Can I use both models in the same pipeline?</strong></summary>

Yes. You might use the **App-Level** model for your Unit and Component tests while using the **Cross-App** model for your shared Integration or System tests.

</details>

<details>

<summary><strong>What happens if SeaLights cannot determine the impact?</strong></summary>

To ensure quality, SeaLights defaults to a "Run All" recommendation if the analysis is inconclusive or encounters an error.

</details>

<details>

<summary><strong>Does enabling optimization mean I'll never run my full suite?</strong></summary>

No. We recommend scheduling periodic full runs (e.g., weekly) to maintain a comprehensive coverage baseline.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/test-optimization/test-optimization-strategy/enabling-test-optimization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
