> For the complete documentation index, see [llms.txt](https://learning.contextqa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.contextqa.com/enterprise-application-testing/ship/code-analysis.md).

# Repository Code Analysis

Use ContextQA code analysis to discover application features, review source-grounded test candidates, connect login variables, and build regression coverage.

> **Documentation owner:** [Deep Barot](https://contextqa.com/academy/) · **Last updated:** November 11, 2026

## Quick answer

Connect the intended repository, open **Autonomous SDLC → Code Analysis**, and inspect the analysis and generated requirements. Review discovered features and test candidates against the deployed application, then approve and execute useful coverage. Repository analysis supplies implementation context; execution establishes whether the expected behavior works.

## Key takeaways

* Align the analyzed repository and branch with the deployed test build.
* Review cited behavior, prerequisites, and missing coverage before approval.
* Reuse environment login variables and validate generated cases on the real application.

## Why analyze code as well as crawl the application?

A crawl observes reachable UI behavior. Repository analysis can identify routes, features, validations, and dependencies that a particular browser path did not visit. Requirements add business intent that source code alone cannot establish. Combine all three when deciding what a release must prove.

## Prerequisites

* Repository access granted to the intended ContextQA organization.
* A known branch and deployed application environment.
* Working login variables or an auth profile and representative test data.
* A reviewer who can distinguish intended behavior from implementation accidents.

![ContextQA integrations catalog with Slack, Linear, Jira, GitHub, and GitLab](https://4255556216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKlyaXxb76z3Dn47TrZkU%2Fuploads%2Fgit-blob-9b94d70882886106feadd2c58761f2ac0d35ff29%2Frepository-tracker-integrations.jpg?alt=media)

## Analyze and review

1. In **Integrations**, connect GitHub or GitLab and confirm the repositories ContextQA can access.
2. Open **Autonomous SDLC → Code Analysis**. Select the relevant analysis record or initiate analysis through the connected repository workflow.
3. Confirm the repository and branch, and wait for a terminal analysis status. Startup or sandbox preparation is still part of an active run.
4. Review the resulting modules, features, requirements, and test candidates.
5. Check each important candidate against the application and its supporting source context. Reject invented routes, unsupported success messages, or setup data a tester cannot create.
6. Confirm login steps use the selected environment variables. Replace captured literals with reusable data references where appropriate.
7. Approve the useful candidates, execute them, and inspect failures before adding them to regression plans.

## What should a reviewer check?

| Review area       | Acceptance question                                                          |
| ----------------- | ---------------------------------------------------------------------------- |
| Feature discovery | Are critical modules and cross-module journeys represented?                  |
| Traceability      | Does the cited implementation support the proposed behavior?                 |
| Executability     | Can the test create or select its own data and reach the target screen?      |
| Assertions        | Does it verify a business result rather than merely finish clicking?         |
| Reuse             | Can an existing prerequisite, step group, or test satisfy the requirement?   |
| Configuration     | Do roles, feature settings, and deployment behavior match the analyzed code? |
| Missing coverage  | Which negative, permission, boundary, or integration paths remain?           |

## How does code analysis support AI-generated code?

It gives the testing workflow context independent of a coding agent's explanation. Use that context with [PR impact analysis](https://learning.contextqa.com/enterprise-application-testing/ai-features/pr-impact-analysis.md), a baseline run, and the exact candidate deployment. Generated cases remain proposals until reviewed and executed.

### Does a completed analysis prove complete coverage?

No. Compare the discovered features with a maintained critical-journey inventory. Large repositories, conditional features, external services, and deployment-only configuration can require additional requirements and execution.

### Should I publish code-analysis speed or accuracy as a guarantee?

Use measurements from your own representative application and record the scope. Repository size, access, environment, and review criteria affect the result; test counts alone do not measure useful coverage.

Next: [Crawl requirements](https://learning.contextqa.com/enterprise-application-testing/ai-features/crawl-requirements.md) · [AI software factory](https://learning.contextqa.com/enterprise-application-testing/ship/ai-software-factory.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learning.contextqa.com/enterprise-application-testing/ship/code-analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
