# datakitchen/dataops-testgen architecture

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

- Interactive diagram: https://gitdiagram.com/datakitchen/dataops-testgen
- Repository: https://github.com/datakitchen/dataops-testgen

## Overview

TestGen is a data-quality and observability application. Its documented workflow covers profiling and screening datasets, reviewing hygiene issues, generating and executing validation tests, and continuously monitoring production data for anomalies. The repository provides UI, API, and MCP surfaces, alongside command and scheduler subsystems; database models and flavor-aware query services support work against TestGen metadata and connected data sources. The README describes the product stages, while source evidence is uneven: edges without a shown caller are omitted or marked unverified.

Main entry points: [`testgen/common/database/database_service.py`](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/database/database_service.py) (Database access), [`testgen/ui`](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/ui) (Web UI), [`testgen/common/models`](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/common/models) (Metadata store), [`testgen/commands/queries/profiling_query.py`](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/profiling_query.py) (Data profiling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Product interfaces"]
  node_ui["Web UI"]
  node_api["HTTP API"]
  node_mcp["MCP server"]
end

subgraph group_quality["Quality workflows"]
  node_profiling["Data profiling<br/>[profiling_query.py]"]
  node_hygiene["Hygiene review"]
  node_testgen["Test generation"]
  node_execution["Test execution"]
  node_monitoring["Anomaly monitoring<br/>[monitor_service.py]"]
  node_scores["Quality scores"]
end

subgraph group_platform["Execution platform"]
  node_jobs["Job orchestration"]
  node_scheduler["Scheduler"]
  node_plugins["Plugin hooks<br/>[plugins.py]"]
  node_notifications["Notifications"]
end

subgraph group_data["Data access and state"]
  node_targetdb[("Connected data source")]
  node_queryservice["Database access"]
  node_flavors["SQL flavors<br/>[flavor_service.py]"]
  node_metadata[("Metadata store")]
  node_connections["Connection records<br/>[connection.py]"]
  node_tablegroups["Table groups<br/>[table_group.py]"]
end

node_user(("Data practitioner"))

node_user -->|"manages quality"| node_ui
node_profiling -->|"queries data"| node_queryservice
node_profiling -->|"reads models"| node_metadata
node_execution -->|"executes queries"| node_queryservice
node_execution -->|"reads models"| node_metadata
node_queryservice -->|"uses flavor"| node_flavors
node_queryservice -.->|"connects to"| node_targetdb
node_ui -->|"previews data"| node_targetdb
node_ui -->|"uses access layer"| node_queryservice
node_connections -->|"references flavors"| node_flavors
node_tablegroups -->|"queries session"| node_metadata
node_mcp -.->|"loads extensions"| node_plugins

click node_ui "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/ui"
click node_api "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/api"
click node_mcp "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/mcp"
click node_profiling "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/profiling_query.py"
click node_hygiene "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/api"
click node_testgen "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/commands"
click node_execution "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/execute_tests_query.py"
click node_monitoring "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/monitor_service.py"
click node_scores "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/rollup_scores_query.py"
click node_jobs "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/commands"
click node_scheduler "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/scheduler"
click node_plugins "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/utils/plugins.py"
click node_notifications "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/common/notifications"
click node_queryservice "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/database/database_service.py"
click node_flavors "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/database/flavor/flavor_service.py"
click node_metadata "https://github.com/datakitchen/dataops-testgen/tree/main/testgen/common/models"
click node_connections "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/models/connection.py"
click node_tablegroups "https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/models/table_group.py"

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_ui,node_api,node_mcp toneBlue
class node_profiling,node_hygiene,node_testgen,node_execution,node_monitoring,node_scores toneAmber
class node_jobs,node_scheduler,node_plugins,node_notifications toneMint
class node_targetdb,node_queryservice,node_flavors,node_metadata,node_connections,node_tablegroups toneRose
class node_user toneIndigo
```

## Components

### Product interfaces

- [Web UI](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/ui): `testgen/ui`
- [HTTP API](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/api): `testgen/api`
- [MCP server](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/mcp): `testgen/mcp`

### Quality workflows

- [Data profiling](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/profiling_query.py): `testgen/commands/queries/profiling_query.py`
- [Hygiene review](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/api): `testgen/api`
- [Test generation](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/commands): `testgen/commands`
- [Test execution](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/execute_tests_query.py): `testgen/commands/queries/execute_tests_query.py`
- [Anomaly monitoring](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/monitor_service.py): `testgen/common/monitor_service.py`
- [Quality scores](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/commands/queries/rollup_scores_query.py): `testgen/commands/queries/rollup_scores_query.py`

### Execution platform

- [Job orchestration](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/commands): `testgen/commands`
- [Scheduler](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/scheduler): `testgen/scheduler`
- [Plugin hooks](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/utils/plugins.py): `testgen/utils/plugins.py`
- [Notifications](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/common/notifications): `testgen/common/notifications`

### Data access and state

- **Connected data source**
- [Database access](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/database/database_service.py): `testgen/common/database/database_service.py`
- [SQL flavors](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/database/flavor/flavor_service.py): `testgen/common/database/flavor/flavor_service.py`
- [Metadata store](https://github.com/datakitchen/dataops-testgen/tree/main/testgen/common/models): `testgen/common/models`
- [Connection records](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/models/connection.py): `testgen/common/models/connection.py`
- [Table groups](https://github.com/datakitchen/dataops-testgen/blob/main/testgen/common/models/table_group.py): `testgen/common/models/table_group.py`

### Other components

- **Data practitioner**

## Connections

- Data practitioner → Web UI: manages quality (evidence: `README.md`)
- Data profiling → Database access: queries data (evidence: `testgen/commands/queries/profiling_query.py`)
- Data profiling → Metadata store: reads models (evidence: `testgen/commands/queries/profiling_query.py`)
- Test execution → Database access: executes queries (evidence: `testgen/commands/queries/execute_tests_query.py`)
- Test execution → Metadata store: reads models (evidence: `testgen/commands/queries/execute_tests_query.py`)
- Database access → SQL flavors: uses flavor (evidence: `testgen/common/database/database_service.py`)
- Database access → Connected data source: connects to
- Web UI → Connected data source: previews data (evidence: `testgen/ui/services/database_service.py`)
- Web UI → Database access: uses access layer (evidence: `testgen/ui/services/database_service.py`)
- Connection records → SQL flavors: references flavors (evidence: `testgen/common/models/connection.py`)
- Table groups → Metadata store: queries session (evidence: `testgen/common/models/table_group.py`)
- MCP server → Plugin hooks: loads extensions (evidence: `testgen/mcp/server.py`)
