Ai generated ut code review

From openharmonyinsight/openharmony-skills · View interactive version

Ai generated ut code review is an AI agent skill from the GitHub repository openharmonyinsight/openharmony-skills. Use when reviewing or scoring AI-generated unit tests/UT code, especially when coverage, assertion effectiveness, or test quality is in question and a numeric score, risk level, or must-fix checklist is needed

How to use this skill

Skill file

AI UT Code Review

Overview

Review AI-generated unit tests for effectiveness, coverage, assertions, negative cases, determinism, and maintainability. Output a 0-10 score, a risk level, and a must-fix checklist. Overall line coverage must be >= 80%; otherwise risk is at least High.

When to Use

Workflow

  1. Confirm tests target the intended business code and key paths.
  2. Check overall line coverage (>= 80% required).
  3. Inspect assertions for behavioral validity; flag missing/ineffective assertions.
  4. Verify negative/edge cases and determinism (no env/time dependency).
  5. Score by rubric, assign risk, list must-fix items with evidence.

Scoring (0-10)

Each dimension 0-2 points. Sum = total score.

| Dimension | 0 | 1 | 2 |

| --- | --- | --- | --- |

| Coverage | < 80% | 80%+ but shallow | 80%+ and meaningful |

| Assertion Quality | No/invalid assertions | Some weak assertions | Behavior-anchored assertions |

| Negative & Edge | Missing | Partial | Comprehensive |

| Data & Isolation | Flaky/env-dependent | Mixed | Deterministic, isolated |

| Maintainability | Hard to read/modify | Mixed quality | Clear structure & naming |

Risk Levels

Must-Fix Checklist

AI-Generated Test Pitfalls (Check Explicitly)

Output Format (Required, Semi-fixed)

Rules:

Common Mistakes

Example (Concise)

Score: 5/10 (Coverage 1, Assertion 0, Negative 1, Data 2, Maintainability 1)

Risk: High

Must-fix:

Key Evidence:

Notes:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.