Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Rename this method to match the regular expression: yyyy
-
List of parameters:
- Key : format
- Description : Regular expression the test method names are checked against.
- Default value : ^test[A-Z][a-zA-Z0-9]*$
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Covered Languages:Java
-
Remediation Function:Constant/Issue
-
Constant Cost:5min
-
Analysis Scope:Test Sources
Description
Shared naming conventions allow teams to collaborate efficiently. This rule raises an issue when a test method name does not match the provided regular expression.
Noncompliant Code Example
With the default value: ^test[A-Z][a-zA-Z0-9]*$
@Test public void foo() { // Noncompliant //... }
Compliant Solution
@Test public void testFoo() { // ... }
Attachments
Issue Links
- is implemented by
-
SONARJAVA-1734 Rule S3578: Test methods should comply with a naming convention
-
- Closed
-