Generate Test Data logo

Generate Test Data

Community
anhtester
generate-test-data

Sinh test data có cấu trúc, unique, traceable cho test cases. Hỗ trợ UI forms, API payloads, data-driven tests.

Overview

Publisheranhtester
Repositorycodex-testing-kit
Skill namegenerate-test-data
Stars
34
Forks
14
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by anhtester on GitHub. Read the source before you install it.

Installation

Install the Generate Test Data AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/anhtester/codex-testing-kit/tree/main/.agents/skills/generate-test-data
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/anhtester/codex-testing-kit.git /tmp/codex-testing-kit
mkdir -p .claude/skills
cp -r /tmp/codex-testing-kit/.agents/skills/generate-test-data .claude/skills/generate-test-data
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Generate Test Data in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Generate Test Data on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Generate Test Data is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

$generate-test-data — Sinh Test Data Có Cấu Trúc

User cung cấp feature/module hoặc test cases cần sinh data. AI phân tích fields, constraints, sinh bộ data đầy đủ (positive, negative, boundary, edge cases) với format sẵn sàng sử dụng.

BẮT BUỘC (MANDATORY): Trước khi bắt đầu, PHẢI nạp và đọc kỹ:

  • Skill: .agents/skills/test-data-generator/SKILL.md — Quy tắc sinh data
  • Rule: .agents/rules/automation_rules.md — Section Test Data

Input cần từ User

InputBắt buộcMô tả
Feature / Module✅VD: "Form đăng ký", "API Create User", "Trang Login"
Fields cần data⚠️ Nên cóDanh sách fields + constraints. Nếu không có → AI tự phân tích từ DOM/Spec
URL trang / Swagger spec❌Nếu có → AI inspect DOM/Spec để lấy validation rules chính xác
Test cases❌Nếu đã có test cases → AI sinh data match từng TC
Output format❌json (mặc định), csv, markdown table, code (TypeScript/Java/Python)
Ngôn ngữ data❌Tiếng Việt / Tiếng Anh (mặc định: theo context)

Các bước thực hiện

Bước 1: Phân tích Fields & Constraints

  1. Xác định nguồn thông tin:

    NguồnCách lấyƯu tiên
    User cung cấp trực tiếpĐọc từ input⭐ Cao nhất
    DOM thực tế (UI form)browser_navigate → browser_snapshot → phân tích input fields⭐ Cao
    Swagger/OpenAPI specread_url_content → parse schema + constraints⭐ Cao
    Test cases đã cóĐọc test steps → trích xuất fieldsTrung bình
    Đoán từ tên moduleDựa trên kinh nghiệm domain⭐ Thấp nhất
  2. Với mỗi field, xác định:

    AttributeVí dụ
    Tên fieldemail, password, name, phone
    Kiểu dữ liệustring, number, boolean, date, file, enum
    Required?Bắt buộc hay tùy chọn
    Validation rulesmin/maxLength, pattern/regex, format (email, phone), unique
    Giá trị mặc địnhNếu có
    Enum valuesVD: status = ["AVAILABLE", "UNAVAILABLE"]
    Quan hệ phụ thuộcVD: password_confirm phải khớp password
  3. Trình bày bảng Fields cho User xác nhận (CHECKPOINT ⏸️):

    markdown
    | # | Field | Type | Required | Constraints | Notes |
    |---|-------|------|----------|-------------|-------|
    | 1 | email | string | ✅ | format: email, unique | Dùng để login |
    | 2 | password | string | ✅ | minLength: 6 | |
    | 3 | name | string | ✅ | maxLength: 100 | |
    | 4 | phone | string | ❌ | pattern: /^0[0-9]{9}$/ | 10 chữ số, bắt đầu bằng 0 |

    Chờ User xác nhận hoặc bổ sung constraints trước khi sang Bước 2.


Bước 2: Sinh Test Data theo 4 Categories

Với mỗi field đã xác định, sinh data theo bảng sau:

2A. Positive Data (Happy Path)
  • Giá trị hợp lệ, đúng format, trong constraints
  • Tất cả required fields được điền
  • Dữ liệu phải unique + traceable

Format unique data:

<prefix>_<testName>_<timestamp>

Ví dụ:

email:    auto_register_1712049200@test.com
username: user_login_1712049200
code:     TC_BOOK_1712049200
2B. Negative Data
LoạiMô tảVí dụ
Missing requiredBỏ trống field bắt buộcemail: ""
Invalid formatSai formatemail: "not-an-email"
Invalid typeSai kiểu dữ liệuprice: "abc" (expect number)
DuplicateGiá trị đã tồn tạiemail: "existing@test.com"
Invalid charactersKý tự không được phépname: "<script>alert(1)</script>"
Wrong relationshipVi phạm quan hệ fieldspassword_confirm ≠ password
2C. Boundary Values
LoạiMô tảVí dụ (field có minLength=6, maxLength=20)
MinĐúng bằng min"abcdef" (6 chars)
Min - 1Dưới min"abcde" (5 chars)
MaxĐúng bằng max"a" * 20 (20 chars)
Max + 1Vượt max"a" * 21 (21 chars)
EmptyChuỗi rỗng""
ZeroSố 0 (cho number fields)0
NegativeSố âm (cho number fields)-1
2D. Edge Cases
LoạiMô tảVí dụ
UnicodeKý tự đặc biệt Unicode"Nguyễn Văn 🎉"
Very longChuỗi cực dài"a" * 10000
WhitespaceKhoảng trắng đầu/cuối" email@test.com "
SQL injectionPattern SQL injection"'; DROP TABLE users; --"
HTML tagsHTML trong text field"<b>bold</b><img src=x onerror=alert(1)>"
Null/undefinedGiá trị nullnull
Special numbersSố đặc biệt0.1 + 0.2, Number.MAX_SAFE_INTEGER, NaN
Date edgeNgày đặc biệt"2024-02-29" (năm nhuận), "2024-12-31", "1970-01-01"

Bước 3: Đóng gói Output

Trả kết quả theo format User yêu cầu (mặc định: JSON):

Format JSON (mặc định)
json
{
  "module": "User Registration",
  "totalDataSets": 15,
  "fields": ["email", "password", "name", "phone"],
  "positive": [
    {
      "id": "POS_01",
      "description": "Đăng ký thành công với tất cả fields hợp lệ",
      "data": {
        "email": "auto_register_1712049200@test.com",
        "password": "Test@12345",
        "name": "Auto User Register",
        "phone": "0912345001"
      },
      "expectedResult": "Tạo tài khoản thành công, status 201"
    }
  ],
  "negative": [
    {
      "id": "NEG_01",
      "description": "Email trống",
      "data": { "email": "", "password": "Test@12345", "name": "Test User" },
      "expectedResult": "Lỗi validation: Email is required",
      "targetField": "email",
      "negativeType": "missing_required"
    },
    {
      "id": "NEG_02",
      "description": "Email sai format",
      "data": { "email": "not-email", "password": "Test@12345", "name": "Test User" },
      "expectedResult": "Lỗi validation: Invalid email format",
      "targetField": "email",
      "negativeType": "invalid_format"
    }
  ],
  "boundary": [
    {
      "id": "BND_01",
      "description": "Password đúng min length (6 chars)",
      "data": { "email": "auto_bnd01_1712049200@test.com", "password": "Abc@12", "name": "Test User" },
      "expectedResult": "Thành công",
      "targetField": "password",
      "boundaryType": "min"
    }
  ],
  "edgeCases": [
    {
      "id": "EDGE_01",
      "description": "Name chứa Unicode tiếng Việt + emoji",
      "data": { "email": "auto_edge01_1712049200@test.com", "password": "Test@12345", "name": "Nguyễn Văn 🎉" },
      "expectedResult": "Thành công — hệ thống chấp nhận Unicode",
      "targetField": "name",
      "edgeType": "unicode"
    }
  ]
}
Format Markdown Table
markdown
| ID | Category | Description | email | password | name | Expected Result |
|----|----------|-------------|-------|----------|------|-----------------|
| POS_01 | Positive | Đăng ký thành công | auto_reg@test.com | Test@12345 | Auto User | 201 Created |
| NEG_01 | Negative | Email trống | (empty) | Test@12345 | Test User | 422: Email is required |
| BND_01 | Boundary | Password min length | auto_bnd@test.com | Abc@12 | Test User | 201 Created |
Format Code (TypeScript example)
typescript
// test-data/registration.data.ts
export const registrationData = {
  positive: {
    email: `auto_register_${Date.now()}@test.com`,
    password: 'Test@12345',
    name: 'Auto User Register',
    phone: '0912345001',
  },
  negative: {
    emptyEmail: { email: '', password: 'Test@12345', name: 'Test' },
    invalidEmail: { email: 'not-email', password: 'Test@12345', name: 'Test' },
    shortPassword: { email: `auto_neg_${Date.now()}@test.com`, password: '123', name: 'Test' },
  },
  boundary: {
    minPassword: { email: `auto_bnd_${Date.now()}@test.com`, password: 'Abc@12', name: 'Test' },
    maxName: { email: `auto_bnd_${Date.now()}@test.com`, password: 'Test@12345', name: 'A'.repeat(100) },
  },
};

Data Rules (BẮT BUỘC)

#RuleMô tả
1UniqueKhông trùng lặp trong test suite — dùng timestamp/random
2TraceableCó thể truy ngược test nào sinh ra data — dùng prefix + test name
3No real PIIKHÔNG dùng dữ liệu cá nhân thật (số CCCD, email thật, SĐT thật)
4Respect constraintsData phải tuân theo validation rules đã phân tích
5Include expectedResultMỗi data set PHẢI có expected result để dùng cho assertion
6Deterministic khi cầnCùng seed → cùng data (cho reproducible tests)

NGHIÊM CẤM

❌ Không được làm✅ Thay thế đúng
Dùng placeholder (email hợp lệ, mã số hợp lệ)Giá trị cụ thể: auto_tc01@test.com, KH-2026-0012
Hardcode data trùng lặp giữa các testRandom data với prefix + timestamp
Dùng dữ liệu cá nhân thậtData giả lập: auto_*@test.com
Chỉ sinh positive dataBắt buộc cả 4 categories: Positive + Negative + Boundary + Edge
Sinh data không có expected resultMỗi data set PHẢI nêu rõ expected result
Đoán validation rules không kiểm traInspect DOM/Spec hoặc hỏi User
Đọc .env để lấy credentialsHỏi User hoặc dùng placeholder [FROM_ENV]

Checklist cuối

  • Đã phân tích đầy đủ fields + constraints
  • User đã xác nhận bảng fields trước khi sinh data
  • Data có đủ 4 categories (Positive, Negative, Boundary, Edge Cases)
  • Mỗi data set có expected result rõ ràng
  • Data unique + traceable (prefix + timestamp/random)
  • Không chứa real PII
  • Format output đúng yêu cầu User (JSON/CSV/Markdown/Code)
  • Boundary values đúng theo constraints (min, min-1, max, max+1)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Generate Test Data AI skill do?

Sinh test data có cấu trúc, unique, traceable cho test cases. Hỗ trợ UI forms, API payloads, data-driven tests.

Why use Generate Test Data on TypingMind?

Because you install it once and use it with any model. Generate Test Data is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Generate Test Data in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/anhtester/codex-testing-kit/tree/main/.agents/skills/generate-test-data. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Generate Test Data?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Generate Test Data?

As many as you like. As long as a model supports skills, you can use Generate Test Data with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Generate Test Data AI skill free?

Yes. It is published on GitHub by anhtester under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇