Cleantest pipeline
Orchestrates the CleanTest data cleaning pipeline for unit test training datasets. Sequentially invokes syntax-filter, relevance-filter, and coverage-filter skills to remove noisy samples, then generates a noise report. Triggers: "clean test data", "filter noisy tests", "run cleantest pipeline", "remove noisy samples", "data quality", "clean training data", "unit test cleaning", "数据清洗", "过滤噪声测试", "运行 CleanTest", "清洗训练数据"From its SKILL.md
npx -y skills add jimmy0717/cleantest-agent --skill cleantest-pipelineAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.2 KB, 886 tokens by cl100k_base, as published. Nobody here has run it
CleanTest Pipeline Orchestrator
Prerequisites
This skill is the front-end of the open-source cleantest-agent Python package. Before invoking it, make sure the package is installed in the active Python environment:
pip install cleantest-agent
# or, from a checkout of the project repository:
pip install -e .
If the package is missing, the helper scripts under this skill exit with a clear message and a one-line install hint.
You are orchestrating a 3-stage data cleaning pipeline for unit test training data. The goal is to remove noisy samples that degrade model performance.
Pipeline Stages
Stage 1: Syntax Noise Filter
Invoke the cleantest-syntax-filter skill to detect and remove:
- Syntax errors (tree-sitter ERROR nodes)
- Empty exception handling statements (catch/finally with empty blocks)
- Missing implementation / empty functions (method body < 3 AST children)
- Ambiguous data types (generics markers like
<E>,<T>,<?>) - Unnecessary annotations (Aho-Corasick, 21,954 patterns)
- Non-English literals (Chinese/Japanese/Korean)
Stage 2: Relevance Filter
Invoke the cleantest-relevance-filter skill to detect and remove:
- Test cases that have NO relevance to their focal method
- Uses AST-based matching: function name + parameter count + parameter types (fast path)
- Falls back to LLM semantic judgment for borderline cases
Stage 3: Coverage Prediction Filter
Invoke the cleantest-coverage-filter skill to detect and remove:
- Test cases with branch coverage below threshold (default: 0.01)
- Uses ground-truth
condition_cover_ratelabels when present (label mode); falls back to a fine-tuned Qwen2.5-Coder-0.5B regression model when only raw code is available (model mode). The original CleanTest paper used CodeGPT, a continued-pretrained GPT-2 on code; Qwen2.5-Coder-0.5B is the modern code-specific replacement.
Input Requirements
The input CSV must contain at minimum:
src_fm: The focal method source code (Java)target: The unit test source code (Java)
Optional columns: condition_cover_rate (enables Filter 3 without model)
Output
After all stages complete, generate:
filtered_data.csv-- Cleaned dataset (rows that passed all filters)noise_report.json-- Structured report with per-filter statisticssummary.md-- Human-readable summary
Execution
After installing the package (see Prerequisites), run:
cleantest \
--input_csv <path> \
--output_dir <path> \
[--llm_enhance] # Enable LLM enhancement for Filter 1 & 2
[--coverage_threshold 0.01]
[--skip_coverage] # Skip Filter 3 if no GPU/labels available
[--reflection] # Enable reflective LLM step for Filter 2
Equivalent module form (works without pip install, but only inside a checkout):
python -m cleantest_agent.pipeline --input_csv <path> --output_dir <path>
Checkpoints
After each filter stage, the pipeline logs:
- Number of samples removed
- Noise type breakdown
- Number of remaining samples
In CLI mode, the pipeline runs all stages automatically. When invoked through a coding assistant, intermediate results are reported to the user between stages.
Error Handling
- Malformed samples: Wrapped in try/except, skipped silently without crashing.
- Deep AST nesting: Iterative stack-based traversal (no recursion).
- Missing GPU/model: Coverage filter gracefully skipped with
--skip_coverage. - Missing API key: LLM enhancement skipped, falls back to rules only.
Scripts
cleantest_agent/pipeline.py-- main orchestrator (exposed as thecleantestconsole script after install)references/pipeline-schema.json-- JSON Schema for input/output format
What ships with it: 1 file
1.9 KB alongside SKILL.md
references/
- pipeline-schema.json1.9 KB
Gives 0 of the 12 instructions most test skills give in 886 tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-07
- Close the browser when donein 55 of 964, across 12 files
- Wait for network idle statein 51 of 964, across 6 files
- Launch Chromium in headless modein 49 of 964, across 6 files
- Use descriptive selectors for elementsin 49 of 964, across 6 files
- Run provided scripts with help flag firstin 49 of 964, across 6 files
- Add appropriate explicit waitsin 48 of 964, across 5 files
- Use bundled scripts as black boxesin 46 of 964, across 3 files
- Do not read script source codein 46 of 964, across 3 files
- Use sync playwright for scriptsin 46 of 964, across 3 files
- Inspect dom before executing actionsin 46 of 964, across 3 files
- Run the full test suitein 37 of 964
- Write the failing test firstin 29 of 964, across 23 files
Said here and by no other author read
- install the required Python package
- invoke the syntax noise filter
- invoke the relevance filter
- invoke the coverage prediction filter
- require input CSV with focal method and test
- generate cleaned dataset CSV
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.