# senthazalravi/testfox architecture

> Architecture diagram of the GitHub repository senthazalravi/testfox, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/senthazalravi/testfox
- Repository: https://github.com/senthazalravi/testfox

## Overview

TestFox is a VS Code testing extension. Its main workflow detects a project, generates rule-based or AI-assisted tests, executes them, then stores results and presents reports. Separate capabilities cover MCP/browser and API tooling, background and scheduled runs, defect tracking, and issue creation. The README establishes these product stages; sampled source confirms selected AI, storage, and MCP behavior. Other subsystem links reflect documented capabilities, not inspected call sites.

Main entry points: [`src/extension.ts`](https://github.com/senthazalravi/testfox/blob/master/src/extension.ts) (Extension Entry), [`src/runners/testRunner.ts`](https://github.com/senthazalravi/testfox/blob/master/src/runners/testRunner.ts) (Test Runner), [`src/core/projectDetector.ts`](https://github.com/senthazalravi/testfox/blob/master/src/core/projectDetector.ts) (Project Detection), [`src/core/mcpIntegrationManager.ts`](https://github.com/senthazalravi/testfox/blob/master/src/core/mcpIntegrationManager.ts) (MCP Integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Extension Experience"]
  node_extension["Extension Entry<br/>[extension.ts]"]
  node_views["Testing Views"]
end

subgraph group_analysis["Project Analysis"]
  node_detector["Project Detection<br/>[projectDetector.ts]"]
  node_analyzers["Project Analyzers"]
  node_swagger["OpenAPI Parsing<br/>[swaggerParser.ts]"]
end

subgraph group_generation["Test Generation"]
  node_generators["Test Generators"]
  node_ai["AI Services<br/>[aiService.ts]"]
  node_ai_provider["OpenRouter Client"]
  node_premium["AI Usage Limits<br/>[premiumService.ts]"]
end

subgraph group_execution["Test Execution"]
  node_runner["Test Runner<br/>[testRunner.ts]"]
  node_api_runner["API Runner<br/>[apiRunner.ts]"]
  node_browser_runner["Browser Runners<br/>[browserRunner.ts]"]
  node_full_cycle["Full-Cycle Runner<br/>[fullCycleRunner.ts]"]
  node_background["Background Runs"]
  node_scheduler["Test Scheduler<br/>[scheduler.ts]"]
  node_mcp["MCP Integration"]
  node_mcp_servers["MCP Server Manager"]
end

subgraph group_results["Results and Integrations"]
  node_store[("Test Run Storage<br/>[testRunStorage.ts]")]
  node_reports["Reports<br/>[reportGenerator.ts]"]
  node_defects["Defect Tracking<br/>[defectTracker.ts]"]
  node_issues["Issue Tracker<br/>[issueTracker.ts]"]
end

node_user(("VS Code User"))
node_project["Open Project"]
node_ai_service{{"AI Provider"}}
node_external_tools{{"Browser and MCP Tools"}}
node_git_host{{"GitHub or Jira"}}

node_user -->|"uses commands"| node_extension
node_extension -->|"opens views"| node_views
node_extension -->|"analyzes project"| node_detector
node_project -->|"project files"| node_detector
node_detector -->|"detects stack"| node_analyzers
node_detector -->|"discovers API specs"| node_swagger
node_extension -->|"requests generation"| node_generators
node_generators -.->|"enhances tests"| node_ai
node_ai -->|"checks usage"| node_premium
node_ai -->|"requests completions"| node_ai_provider
node_ai_provider -.->|"sends prompts"| node_ai_service
node_extension -->|"runs tests"| node_runner
node_extension -->|"runs full cycle"| node_full_cycle
node_runner -->|"executes API tests"| node_api_runner
node_runner -->|"executes browser tests"| node_browser_runner
node_extension -->|"starts background runs"| node_background
node_extension -->|"schedules tests"| node_scheduler
node_mcp -->|"manages servers"| node_mcp_servers
node_mcp -->|"generates MCP tests"| node_generators
node_mcp -.->|"dispatches tests"| node_external_tools
node_runner -->|"saves run results"| node_store
node_store -->|"provides run data"| node_reports
node_views -->|"opens reports"| node_reports
node_runner -->|"tracks failures"| node_defects
node_defects -->|"creates issues"| node_issues
node_issues -.->|"creates GitHub or Jira issue"| node_git_host

click node_extension "https://github.com/senthazalravi/testfox/blob/master/src/extension.ts"
click node_views "https://github.com/senthazalravi/testfox/tree/master/src/views"
click node_detector "https://github.com/senthazalravi/testfox/blob/master/src/core/projectDetector.ts"
click node_analyzers "https://github.com/senthazalravi/testfox/tree/master/src/core"
click node_swagger "https://github.com/senthazalravi/testfox/blob/master/src/core/swaggerParser.ts"
click node_generators "https://github.com/senthazalravi/testfox/tree/master/src/generators"
click node_ai "https://github.com/senthazalravi/testfox/blob/master/src/ai/aiService.ts"
click node_ai_provider "https://github.com/senthazalravi/testfox/blob/master/src/ai/openRouterClient.ts"
click node_premium "https://github.com/senthazalravi/testfox/blob/master/src/premium/premiumService.ts"
click node_runner "https://github.com/senthazalravi/testfox/blob/master/src/runners/testRunner.ts"
click node_api_runner "https://github.com/senthazalravi/testfox/blob/master/src/runners/apiRunner.ts"
click node_browser_runner "https://github.com/senthazalravi/testfox/blob/master/src/runners/browserRunner.ts"
click node_full_cycle "https://github.com/senthazalravi/testfox/blob/master/src/runners/fullCycleRunner.ts"
click node_background "https://github.com/senthazalravi/testfox/blob/master/src/core/backgroundTestRunner.ts"
click node_scheduler "https://github.com/senthazalravi/testfox/blob/master/src/core/scheduler.ts"
click node_mcp "https://github.com/senthazalravi/testfox/blob/master/src/core/mcpIntegrationManager.ts"
click node_mcp_servers "https://github.com/senthazalravi/testfox/blob/master/src/mcp/mcpServerManager.ts"
click node_store "https://github.com/senthazalravi/testfox/blob/master/src/core/testRunStorage.ts"
click node_reports "https://github.com/senthazalravi/testfox/blob/master/src/reports/reportGenerator.ts"
click node_defects "https://github.com/senthazalravi/testfox/blob/master/src/tracking/defectTracker.ts"
click node_issues "https://github.com/senthazalravi/testfox/blob/master/src/integrations/issueTracker.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension,node_views,node_user,node_external_tools toneBlue
class node_detector,node_analyzers,node_swagger toneAmber
class node_generators,node_ai,node_ai_provider,node_premium toneMint
class node_runner,node_api_runner,node_browser_runner,node_full_cycle,node_background,node_scheduler,node_mcp,node_mcp_servers toneRose
class node_store,node_reports,node_defects,node_issues,node_project,node_ai_service,node_git_host toneIndigo
```

## Components

### Extension Experience

- [Extension Entry](https://github.com/senthazalravi/testfox/blob/master/src/extension.ts): `src/extension.ts`
- [Testing Views](https://github.com/senthazalravi/testfox/tree/master/src/views): `src/views`

### Project Analysis

- [Project Detection](https://github.com/senthazalravi/testfox/blob/master/src/core/projectDetector.ts): `src/core/projectDetector.ts`
- [Project Analyzers](https://github.com/senthazalravi/testfox/tree/master/src/core): `src/core`
- [OpenAPI Parsing](https://github.com/senthazalravi/testfox/blob/master/src/core/swaggerParser.ts): `src/core/swaggerParser.ts`

### Test Generation

- [Test Generators](https://github.com/senthazalravi/testfox/tree/master/src/generators): `src/generators`
- [AI Services](https://github.com/senthazalravi/testfox/blob/master/src/ai/aiService.ts): `src/ai/aiService.ts`
- [OpenRouter Client](https://github.com/senthazalravi/testfox/blob/master/src/ai/openRouterClient.ts): `src/ai/openRouterClient.ts`
- [AI Usage Limits](https://github.com/senthazalravi/testfox/blob/master/src/premium/premiumService.ts): `src/premium/premiumService.ts`

### Test Execution

- [Test Runner](https://github.com/senthazalravi/testfox/blob/master/src/runners/testRunner.ts): `src/runners/testRunner.ts`
- [API Runner](https://github.com/senthazalravi/testfox/blob/master/src/runners/apiRunner.ts): `src/runners/apiRunner.ts`
- [Browser Runners](https://github.com/senthazalravi/testfox/blob/master/src/runners/browserRunner.ts): `src/runners/browserRunner.ts`
- [Full-Cycle Runner](https://github.com/senthazalravi/testfox/blob/master/src/runners/fullCycleRunner.ts): `src/runners/fullCycleRunner.ts`
- [Background Runs](https://github.com/senthazalravi/testfox/blob/master/src/core/backgroundTestRunner.ts): `src/core/backgroundTestRunner.ts`
- [Test Scheduler](https://github.com/senthazalravi/testfox/blob/master/src/core/scheduler.ts): `src/core/scheduler.ts`
- [MCP Integration](https://github.com/senthazalravi/testfox/blob/master/src/core/mcpIntegrationManager.ts): `src/core/mcpIntegrationManager.ts`
- [MCP Server Manager](https://github.com/senthazalravi/testfox/blob/master/src/mcp/mcpServerManager.ts): `src/mcp/mcpServerManager.ts`

### Results and Integrations

- [Test Run Storage](https://github.com/senthazalravi/testfox/blob/master/src/core/testRunStorage.ts): `src/core/testRunStorage.ts`
- [Reports](https://github.com/senthazalravi/testfox/blob/master/src/reports/reportGenerator.ts): `src/reports/reportGenerator.ts`
- [Defect Tracking](https://github.com/senthazalravi/testfox/blob/master/src/tracking/defectTracker.ts): `src/tracking/defectTracker.ts`
- [Issue Tracker](https://github.com/senthazalravi/testfox/blob/master/src/integrations/issueTracker.ts): `src/integrations/issueTracker.ts`

### Other components

- **VS Code User**
- **Open Project**
- **AI Provider**
- **Browser and MCP Tools**
- **GitHub or Jira**

## Connections

- VS Code User → Extension Entry: uses commands
- Extension Entry → Testing Views: opens views
- Extension Entry → Project Detection: analyzes project
- Open Project → Project Detection: project files
- Project Detection → Project Analyzers: detects stack
- Project Detection → OpenAPI Parsing: discovers API specs
- Extension Entry → Test Generators: requests generation
- Test Generators → AI Services: enhances tests
- AI Services → AI Usage Limits: checks usage
- AI Services → OpenRouter Client: requests completions
- OpenRouter Client → AI Provider: sends prompts
- Extension Entry → Test Runner: runs tests
- Extension Entry → Full-Cycle Runner: runs full cycle
- Test Runner → API Runner: executes API tests
- Test Runner → Browser Runners: executes browser tests
- Extension Entry → Background Runs: starts background runs
- Extension Entry → Test Scheduler: schedules tests
- MCP Integration → MCP Server Manager: manages servers
- MCP Integration → Test Generators: generates MCP tests
- MCP Integration → Browser and MCP Tools: dispatches tests
- Test Runner → Test Run Storage: saves run results
- Test Run Storage → Reports: provides run data
- Testing Views → Reports: opens reports
- Test Runner → Defect Tracking: tracks failures
- Defect Tracking → Issue Tracker: creates issues
- Issue Tracker → GitHub or Jira: creates GitHub or Jira issue
