---
title: All Apex Classes Should Have At Least One Test Class
description: "**Impact area** Manageability **Severity** Medium **Affected element** Apex Class ## Rule ID **SF-NO-TEST-CLASS** Impact Each Apex class must have its own test class. The name of the related Test class must be Test or _Test. Unit testing can improve the…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/pmd-rules/all-apex-classes-should-have-at-least-one-test-class/"
updated: "2025-03-21"
category: PMD Rules
---

# All Apex Classes Should Have At Least One Test Class

**Impact area**

Manageability

**Severity**

Medium

**Affected element**

Apex Class

## Rule ID

**SF-NO-TEST-CLASS**

Impact

Each Apex class must have its own test class. The name of the related Test class must be <Apex class name>Test or <Apex class name>_Test.
Unit testing can improve the quality of your codebase, making it more maintainable and less error-prone.

Remediation

Add at least an Apex test class per existing Apex class following previous name convention.

**Time to fix**

45 min
