TDD Guide
LeoYeAI/openclaw-master-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
Generates automated test oracles to verify correct software behavior.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generator --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/test-oracle-generator .claude/skills/test-oracle-generator && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .claude/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generatorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generator --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/test-oracle-generator .agents/skills/test-oracle-generator && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .agents/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generator --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/test-oracle-generator .cursor/skills/test-oracle-generator && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .cursor/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/test-oracle-generator--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generator --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/test-oracle-generator .gemini/skills/test-oracle-generator && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .gemini/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generatorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/test-oracle-generator .github/skills/test-oracle-generator && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .github/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE test-oracle-generator --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/test-oracle-generator .opencode/skills/test-oracle-generator && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "test-oracle-generator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/test-oracle-generator into .opencode/skills/test-oracle-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "test-oracle-generator", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
test-oracle-generatorGenerates automated test oracles to verify correct software behavior.
Test Oracle Generator is an agent skill from ArabelaTso/Skills-4-SE. Generates automated test oracles to verify correct software behavior. Creates assertion-based oracles (expected values), property-based oracles (invariants), differential oracles (comparing implementations), and metamorphic oracles (input transformations). Use when you need to generate assertions for test cases, identify invariants that should always hold, compare new vs legacy implementations, create metamorphic test relationships, validate function correctness, or improve test coverage with better verification…
Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/metamorphic_patterns.md` and `references/property_patterns.md`).
It sits in Testing & QA, covering Unit testing, Test generation and Test coverage. It works with JUnit, Java, Python and pytest. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python and java).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Test Oracle Generator loads about 3.5k tokens when it runs, and up to ~8.3k if it reads all its reference files. Until then it costs about 159 tokens; SKILL.md has 640 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 640 words, ~3,540 tokens.
.claude/skills/test-oracle-generator/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Generate automated test oracles to verify correct software behavior across multiple oracle types.
Understand what the function does and its expected behavior.
Checklist:
Example Analysis:
# Python
def calculate_discount(price: float, discount_percent: int) -> float:
"""Calculate discounted price.
Args:
price: Original price (must be positive)
discount_percent: Discount percentage (0-100)
Returns:
Discounted price
"""
return price * (1 - discount_percent / 100)Analysis:
price (float, must be > 0), discount_percent (int, 0-100)Create explicit expected value assertions for common cases.
Template:
# Python (pytest)
def test_<function>_<scenario>():
# Arrange
input1 = <value>
input2 = <value>
expected = <calculated_expected_value>
# Act
actual = function_under_test(input1, input2)
# Assert
assert actual == expected, f"Expected {expected}, got {actual}"// Java (JUnit)
@Test
public void test<Function><Scenario>() {
// Arrange
Type input1 = <value>;
Type input2 = <value>;
Type expected = <calculated_expected_value>;
// Act
Type actual = functionUnderTest(input1, input2);
// Assert
assertEquals(expected, actual, "Expected and actual should match");
}Example:
def test_calculate_discount_50_percent():
# Arrange
price = 100.0
discount = 50
expected = 50.0
# Act
actual = calculate_discount(price, discount)
# Assert
assert actual == expected
assert abs(actual - expected) < 0.01 # For floating pointGenerate oracles for:
Identify invariants and properties that should always hold.
Common Properties:
Template (Python with hypothesis):
from hypothesis import given, strategies as st
@given(st.floats(min_value=0.01, max_value=10000),
st.integers(min_value=0, max_value=100))
def test_discount_properties(price, discount_percent):
result = calculate_discount(price, discount_percent)
# Property: Result should never exceed original price
assert result <= price, "Discount should not increase price"
# Property: Result should be non-negative
assert result >= 0, "Price cannot be negative"
# Property: 0% discount returns original price
if discount_percent == 0:
assert abs(result - price) < 0.01
# Property: 100% discount returns 0
if discount_percent == 100:
assert abs(result) < 0.01Template (Java with JUnit Theories):
@Theory
public void discountProperties(
@ForAll @InRange(min = "0.01", max = "10000") double price,
@ForAll @InRange(min = "0", max = "100") int discountPercent) {
double result = calculateDiscount(price, discountPercent);
// Property: Result should never exceed original price
assertTrue(result <= price, "Discount should not increase price");
// Property: Result should be non-negative
assertTrue(result >= 0, "Price cannot be negative");
}Identify properties by asking:
For detailed property patterns, see references/property_patterns.md.
Compare new implementation against reference implementation.
Use Cases:
Template:
# Python
def test_new_vs_legacy_implementation():
# Test data
test_cases = [
(100.0, 10),
(50.0, 25),
(200.0, 0),
(75.0, 100),
]
for price, discount in test_cases:
# Compare outputs
legacy_result = legacy_calculate_discount(price, discount)
new_result = calculate_discount(price, discount)
assert abs(legacy_result - new_result) < 0.01, \
f"Mismatch for ({price}, {discount}): " \
f"legacy={legacy_result}, new={new_result}"// Java
@Test
public void testNewVsLegacyImplementation() {
Object[][] testCases = {
{100.0, 10},
{50.0, 25},
{200.0, 0},
{75.0, 100}
};
for (Object[] testCase : testCases) {
double price = (double) testCase[0];
int discount = (int) testCase[1];
double legacyResult = LegacyClass.calculateDiscount(price, discount);
double newResult = calculateDiscount(price, discount);
assertEquals(legacyResult, newResult, 0.01,
String.format("Mismatch for (%f, %d)", price, discount));
}
}Best Practices:
Create test pairs where input transformation produces predictable output transformation.
Metamorphic Relations:
Example for discount function:
# Python
def test_discount_metamorphic_double_price():
"""If price doubles, discount amount doubles."""
price = 100.0
discount_percent = 20
result1 = calculate_discount(price, discount_percent)
result2 = calculate_discount(price * 2, discount_percent)
discount_amount1 = price - result1
discount_amount2 = (price * 2) - result2
# Metamorphic relation: doubling price doubles discount amount
assert abs(discount_amount2 - 2 * discount_amount1) < 0.01
def test_discount_metamorphic_additive():
"""Applying discount to sum equals sum of individual discounts."""
price1 = 50.0
price2 = 30.0
discount_percent = 15
# Method 1: Discount on combined price
combined_result = calculate_discount(price1 + price2, discount_percent)
# Method 2: Sum of individual discounts
individual_sum = (calculate_discount(price1, discount_percent) +
calculate_discount(price2, discount_percent))
# Metamorphic relation: Should be equivalent
assert abs(combined_result - individual_sum) < 0.01Example for sorting function:
def test_sort_metamorphic_reverse():
"""Reversing then sorting gives same result as sorting."""
input_list = [3, 1, 4, 1, 5, 9, 2, 6]
result1 = sort(input_list)
result2 = sort(list(reversed(input_list)))
assert result1 == result2
def test_sort_metamorphic_duplicate():
"""Sorting list with duplicated elements maintains order."""
input_list = [3, 1, 4]
duplicated = input_list + input_list
result = sort(duplicated)
# Should be sorted version of original, doubled
expected = sorted(input_list) + sorted(input_list)
assert result == sorted(expected)For more metamorphic relation patterns, see references/metamorphic_patterns.md.
Use multiple oracle types together for robust verification.
Example: Complete test suite for calculate_discount:
import pytest
from hypothesis import given, strategies as st
# Assertion-based oracles
class TestDiscountAssertions:
def test_50_percent_discount(self):
assert calculate_discount(100.0, 50) == 50.0
def test_no_discount(self):
assert calculate_discount(100.0, 0) == 100.0
def test_full_discount(self):
assert calculate_discount(100.0, 100) == 0.0
# Property-based oracles
class TestDiscountProperties:
@given(st.floats(min_value=0.01, max_value=10000),
st.integers(min_value=0, max_value=100))
def test_result_within_bounds(self, price, discount):
result = calculate_discount(price, discount)
assert 0 <= result <= price
@given(st.floats(min_value=0.01, max_value=10000),
st.integers(min_value=0, max_value=100))
def test_monotonic_in_discount(self, price, discount):
"""Higher discount percentage means lower price."""
if discount < 100:
result1 = calculate_discount(price, discount)
result2 = calculate_discount(price, discount + 1)
assert result2 <= result1
# Differential oracles
class TestDiscountDifferential:
@pytest.mark.parametrize("price,discount", [
(100.0, 10), (50.0, 25), (200.0, 50)
])
def test_vs_manual_calculation(self, price, discount):
result = calculate_discount(price, discount)
expected = price * (1 - discount / 100)
assert abs(result - expected) < 0.01
# Metamorphic oracles
class TestDiscountMetamorphic:
def test_double_price_doubles_discount_amount(self):
price = 100.0
discount = 20
discount_amt1 = price - calculate_discount(price, discount)
discount_amt2 = (price * 2) - calculate_discount(price * 2, discount)
assert abs(discount_amt2 - 2 * discount_amt1) < 0.01Ensure oracles are correct and well-documented.
Oracle Documentation Template:
def test_function_oracle_type():
"""Brief description of what this oracle verifies.
Oracle Type: [Assertion-based|Property-based|Differential|Metamorphic]
Rationale: Explain why this property/assertion should hold.
Edge Cases Covered:
- Case 1
- Case 2
"""
# Test implementation
passValidation Checklist:
Mutation Testing (validate oracle effectiveness):
# Introduce deliberate bug to verify oracle catches it
def calculate_discount_buggy(price, discount_percent):
# BUG: Wrong formula
return price * discount_percent / 100 # Should be: price * (1 - discount_percent / 100)
# Oracle should fail on buggy version
def test_oracle_detects_bug():
"""Verify oracle catches the bug."""
with pytest.raises(AssertionError):
assert calculate_discount_buggy(100, 50) == 50.0 # This should failChoose Assertion-based when:
Choose Property-based when:
Choose Differential when:
Choose Metamorphic when:
For detailed oracle patterns organized by domain, see:
© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in skills/test-oracle-generator of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
Test Oracle Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Test Oracle Generator this skillArabelaTso/Skills-4-SE | 253 | — | ~3.5k | Automated safety check: Pass | Apache-2.0 | |
| TDD GuideLeoYeAI/openclaw-master-skills | 2.2k | — | ~1.4k | Automated safety check: Pass | MIT | |
| TDD Guidealirezarezvani/claude-skills | 28k | — | ~3.4k | Automated safety check: Pass | MIT | |
| Test Coverage Reviewareed1192/finance-news-aggregator | 149 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Mutation Test Strength Auditbuildfastwithai/gen-ai-experiments | 785 | — | ~641 | Automated safety check: Pass | MIT | |
| Test Analysis Extensionsmicrosoft/testfx | 1k | 2 repos | ~1.1k | Automated safety check: Pass | MIT |
LeoYeAI/openclaw-master-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
alirezarezvani/claude-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
areed1192/finance-news-aggregator
Audit, plan, write, and verify unit tests for Python projects using pytest.
buildfastwithai/gen-ai-experiments
Measures how well a Python pytest suite catches behavior changes through diff-scoped mutation testing, then proposes and verifies tests for surviving mutants.
microsoft/testfx
Provides file paths to language-specific reference files for the test ANALYSIS skills (assertion-quality, test-anti-patterns, test-gap-analysis, test-smell-detection, test-tagging).
aAAaqwq/AGI-Super-Team
Test-driven development workflow with test generation, coverage analysis, and multi-framework support
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Categories
Generates automated test oracles to verify correct software behavior. Test Oracle Generator is an agent skill from ArabelaTso/Skills-4-SE. Generates automated test oracles to verify correct software behavior.
Test Oracle Generator fits situations like: you need to generate assertions for test cases; identify invariants that should always hold; compare new vs legacy implementations; create metamorphic test relationships.
Run `npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a claude-code`. Or copy the skill folder (skills/test-oracle-generator in ArabelaTso/Skills-4-SE) into .claude/skills/test-oracle-generator in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a codex`. Or copy the skill folder (skills/test-oracle-generator in ArabelaTso/Skills-4-SE) into .agents/skills/test-oracle-generator in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill test-oracle-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-oracle-generator, .gemini/skills/test-oracle-generator, .github/skills/test-oracle-generator and .opencode/skills/test-oracle-generator in your project.
SKILL.md names no scripts, command-line tools or credentials: Test Oracle Generator is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Test Oracle Generator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.8k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Test Oracle Generator: TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars), TDD Guide (alirezarezvani/claude-skills, 28k stars), Test Coverage Review (areed1192/finance-news-aggregator, 149 stars) and Mutation Test Strength Audit (buildfastwithai/gen-ai-experiments, 785 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.