Logo di Generate Test Data

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.

Panoramica

Autoreanhtester
Repositorycodex-testing-kit
Nome della skillgenerate-test-data
Stelle
34
Fork
14
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 1 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da anhtester su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Generate Test Data in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/anhtester/codex-testing-kit/tree/main/.agents/skills/generate-test-data
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Generate Test Data in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Generate Test Data non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Generate Test Data non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

$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)

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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.

Perché usare Generate Test Data su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Generate Test Data è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Generate Test Data in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/anhtester/codex-testing-kit/tree/main/.agents/skills/generate-test-data. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Generate Test Data?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Generate Test Data?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Generate Test Data: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Generate Test Data è gratuita?

Sì. È pubblicata su GitHub da anhtester con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇