My testing standards (test pyramid, what each test type covers, positive/negative/edge-case expectations, framework fallbacks). Load whenever writing, reviewing, planning, or scoping unit, service, integration, or UI tests, or recommending test coverage for a change. For running tests, use run-tests.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Testing Guidelines?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/stevenjv-testing-guidelines)
---
name: testing-guidelines
description: My testing standards (test pyramid, what each test type covers, positive/negative/edge-case expectations, framework fallbacks). Load whenever writing, reviewing, planning, or scoping unit, service, integration, or UI tests, or recommending test coverage for a change. For running tests, use run-tests.
---
# Testing Guidelines
## Test Case Types
Favor Unit Tests over Service Tests, Service Tests over Integration tests, Integration tests over UI Tests. This ordering wins over any coverage guidance below.
Unless told otherwise, always recommend/create tests based on specifications rather than basing new tests on existing code.
- **Unit Tests** - Single Function runtime tests with no external dependencies, least expensive to write, run, and maintain, high coverage (tracked by SonarQube)
- Input Validations -
- Business Logic validations -
- **Service Tests** - Single Service runtime tests, public interface through API or UI, Mocked Dependencies, Business Logic plus contract, persistent. Can help user identify if recent service changes are the cause of integration test failures. Testing Contracts (API) Give x input and receive y output.
- Input Validation
- Mocked UI component testing.
- **Integration Tests** - multi-service environmental tests, live dependencies, user flow perspective, API, service, and end to end validations. Can be run in all environments, Local, Docker, Dev, and Staging. Pipelines setup for Dev and Staging.
- What to Test:
- Happy Paths: Test the main workflow with valid data to ensure components integrate properly and data is accurate
- Negative Paths: Test error scenarios that involve multiple systems (e.g., external service failures, database connectivity issues, the most common error case input) Fail appropriately and give the correct errors and messages
- What NOT to Test:
- Input Validation: Leave detailed validation testing (null inputs, format checks, boundary conditions) to unit tests, too much detail here is too costly from maintenance and time R.O.I.
- Business Logic Edge Cases: Complex business rules should be covered by service/unit tests or at the Customer UI level if high profile customer or many are affected (Very limited in scope)
- Every Possible Scenario: Focus on integration points, not exhaustive coverage!
- Key Principle: Integration tests should validate that the application correctly communicates with external dependencies (databases, APIs, message queues) and that the overall system workflow functions as expected.
- **UI Tests** - User Interfacing layer that is most interacted by the end user, most expensive tests to write, maintain, and debug. Minimal testing should be focused on Integration between backend and frontend components (Critical User Flows). Should be completed by N+1 (the sprint after the code is promoted, i.e. Dev > Stage > Prod behind toggle if applicable).
## Positive Path Testing
- Validates that all Acceptance Criteria are tested and verified to be working as expected.
## Negative Path Testing
- Validates unexpected or incorrect usage of the software does not present potential breaking scenarios and that the scenarios are handled appropriately.
- Non exhaustive list of possible Invalid Input Type Tests
- Incorrect Data Types: text in a numeric field, invalid date formats, etc.
- Boundary Values: values outside of the acceptable range
- Long inputs: long strings exceeding the expected length
- Empty Mandatory Fields: neglecting inputting data into all mandatory fields
- Special Characters: when unexpected, inputting various types of special characters
- Leading and/or Trailing Spaces: manually, programmatically, copy/paste, hidden space characters at the start of and/or end of a field
- Invalid Phone Number Formats: letters, formatting, too short/too long
- Expired or Invalid Credentials: invalid credentials, credentials have expired, credentials have been revoked
- Etc.
- Non exhaustive list of possible Error Handling Tests
- Graceful Error Messages: the system displays clear and informative error messages
- Proper Recovery: the system recovers gracefully
- No System Crashes: the system does not crash due to invalid input
- Logging errors: errors are logged appropriately
- Etc.
- Non exhaustive list of possible Unexpected Action Tests
- Invalid Button Clicks: buttons are only clickable when expected
- Forms with Missing Fields: forms cannot be submitted if missing expected, mandatory fields
- Invalid User Actions: user cannot perform certain functions based on their role(s) or permission(s)
- Security Vulnerabilities: SQL Injection, cross-site Scripting, etc.
- Etc.
## Edge Case Testing
- Validates that all reachable paths of the software are working as expected.
- These can be covered and verified at any level of the testing pyramid (Unit/Service/Integration) but should be covered somewhere.
- After using SonarQube to validate testing coverage in Unit & Service tests, reachable test paths still not covered may be covered with Integration tests, but only where unit/service tests can't practically cover them. This does not override "What NOT to Test" above.
## Tooling
When adding unit, service, or integration tests, use the same framework and tooling as the existing tests in that same part of the repo (e.g. `BFF/` vs `Web/`, or the specific test project being edited). The list below is the fallback when no existing tests set a precedent.
- Unit Tests:
- XUnit (C#)
- Jest (frontend `Web/` projects)
- Service / API Tests:
- Automation aligned with LogCom Framework
- C# .Net
- Integration:
- Playwright
- C# .Net or Typescript depending on existing tests in the repository
## Running Tests
To run tests and report results, use the `run-tests` skill.