원클릭으로
test-quality-standards
// Provides test quality standards and best practices. Use when writing test cases, creating unit tests, implementing tests, or refining/reviewing test code. Essential for test generation and test refinement phases.
// Provides test quality standards and best practices. Use when writing test cases, creating unit tests, implementing tests, or refining/reviewing test code. Essential for test generation and test refinement phases.
| name | test-quality-standards |
| description | Provides test quality standards and best practices. Use when writing test cases, creating unit tests, implementing tests, or refining/reviewing test code. Essential for test generation and test refinement phases. |
When writing or reviewing test cases, follow these standards:
Minimal code: Each test case should be the simplest possible code that demonstrates the pattern. Avoid elaborate setups, complex methods, or unnecessary fields.
Focused: One test case per distinct scenario. Don't combine multiple patterns in a single test.
Brief comments: Use // Compliant or // Compliant: [2-4 words]. Avoid lengthy explanations. If a URL reference gives context, use that instead of block comments.
Integrate into existing methods: Add new test cases to existing test methods when the scenario belongs there, rather than creating separate methods with full setups.
Scope-appropriate: Match test code style to the rule's scope. Tests scope → test-style code (test classes, assertions). Main scope → production-style code. All scope → either is acceptable.
Follow existing conventions: Match the patterns, naming, and structure already established in the test file and similar test files.
No redundancy: If multiple variations test essentially the same thing, keep the clearest version. Each test must add unique coverage.
// Compliant or // Compliant: [2-4 words]// FP scenario: ... comments. A brief inline comment sufficesMinimal code:
[TestMethod]
public void ForLoop_NoIssue() => builder.AddSnippet("for (int i = 0; i < 10; i++) { }");
Brief comment:
foreach (int x in items) { } // Compliant: collection iteration
Use before a SonarJS release or when the Peach Main Analysis workflow on SonarSource/peachee-js shows failed jobs or suspicious project issue-count drops that need triage. Classify failed Peach jobs and flag likely project-configuration regressions using docs/peach-main-analysis.md.
Use before a SonarJS release or when the Peach Main Analysis workflow on SonarSource/peachee-js shows failed jobs or suspicious project issue-count drops that need triage. Classify failed Peach jobs and flag likely project-configuration regressions using docs/peach-main-analysis.md.
Provides guidance on implementing and fixing SonarJS rules. Use also when tracing false positives, working with rule configuration, or understanding native vs external rule implementations.
Add or modify rule options in SonarJS, including the fields array, SonarQube UI visibility, and Java check class configuration. Use when working on rule configurations.
Build pipeline for SonarJS. Use when asked to build the project, regenerate metadata, understand the build pipeline, or run npm build scripts.
Provides JavaScript/TypeScript helper functions and utilities for SonarJS rule implementation. Use when implementing rule fixes, searching for existing utilities, or needing to check available helper functions.