Common Code Policy
Common Code policy
The Common Code Policy is an optimization policy specifically designed for foundational or shared code within an application. It defines which tests should run when "common code" (shared foundations) is altered and which can be safely skipped. This empowers teams to maintain high quality while avoiding the massive test overhead typically triggered by changes to infrastructure or utility layers.
Why It Is Useful
In most enterprise applications, approximately 30% of the codebase consists of "common code" (utility classes, logging wrappers, string formatters, or foundational infrastructure).
Without this policy, a single character change in a widely used utility would technically "touch" every test in the suite, forcing a full test run. The Common Code Policy recognizes these patterns and applies a more targeted selection logic.
How it Works?
Targeted Identification: SeaLights identifies specific methods or classes that serve as common foundations.
Subset Selection: When these common areas are modified, the engine does not trigger the entire suite. Instead, it identifies and recommends a smaller, highly relevant subset of tests that have the highest probability of catching a regression in that specific foundation.
Reduced Redundancy: This approach ensures that quality is verified for shared code without the time-cost of running thousands of unrelated tests.
Activation & Configuration
This policy is currently a manually managed capability that requires collaboration between the customer and the SeaLights team.
Analysis & Discovery: SeaLights engineers analyze your codebase and tests distribution. to generate a list of candidate methods that exhibit "common code" behavior (high fan-out and usage).
Marking Methods: Upon receiving this list, the customer reviews and formally requests to mark specific methods as Common Code.
Defining Test Logic: For each method marked as Common Code, the customer defines which specific tests should run to validate it when changes occur. This ensures that the optimization remains safe and effective.
Implementation: Once the methods and their corresponding tests are defined, the SeaLights team activates the policy for those specific sections.
FAQ
Last updated
Was this helpful?

