Skip to content
Back to skills

Testing Strategies

ASecurity

Advanced testing strategies and methodologies. Use when user asks to "design tests", "test coverage", "property-based testing", "mutation testing", "contract testing", "chaos engineering", "test pyramid", "testing strategy", "behavior-driven development", "acceptance testing", or mentions comprehensive testing approaches.

  • 225 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 4, 2026
testingjavascriptjavaspringtestingapidatabaseci/cdperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill testing-strategies --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Strategies?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Strategies
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-testing-strategies/badge)](https://www.skillsdirectory.com/skills/neversight-testing-strategies)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-strategies
description: Advanced testing strategies and methodologies. Use when user asks to "design tests", "test coverage", "property-based testing", "mutation testing", "contract testing", "chaos engineering", "test pyramid", "testing strategy", "behavior-driven development", "acceptance testing", or mentions comprehensive testing approaches.
---

# Testing Strategies & Methodologies

Comprehensive testing strategies for building reliable, high-quality software systems.

## Test Pyramid

```
        UI/E2E Tests
       /            \
      /              \
   Integration Tests
    /                \
  /                  \
Unit Tests
```

- **Unit Tests**: Fast, isolated, low-level (60%)
- **Integration Tests**: Component interactions (30%)
- **E2E Tests**: Full system workflows (10%)

## Testing Types

### Unit Testing
- Test individual functions/methods
- Mocking dependencies
- Fast execution
- Examples: Jest, Pytest, Mocha

### Integration Testing
- Test component interactions
- With real databases/services
- Slower than unit tests
- Examples: Postman, Supertest

### End-to-End Testing
- Complete user workflows
- Browser automation
- Slowest but most realistic
- Examples: Cypress, Selenium, Playwright

### Property-Based Testing
- Generate random inputs
- Verify invariants hold
- Find edge cases
- Examples: Hypothesis, QuickCheck

### Contract Testing
- Verify API contracts between services
- Consumer and provider sides
- Microservices testing
- Examples: Pact, Spring Cloud Contract

### Chaos Engineering
- Inject failures intentionally
- Test system resilience
- Find weak points
- Tools: Chaos Toolkit, Gremlin

## Best Practices

1. **Test Behavior, Not Implementation** - Focus on what, not how
2. **Keep Tests Fast** - Run frequently
3. **Isolate Dependencies** - Mock external systems
4. **Clear Test Names** - Describe what's being tested
5. **DRY Tests** - Eliminate duplication
6. **Test Edge Cases** - Boundaries, nulls, errors
7. **Use Test Fixtures** - Consistent setup
8. **Automate Testing** - CI/CD integration

## Test Naming Convention

```
test_[function]_[scenario]_[expected_outcome]

Example:
test_calculateDiscount_withValidCode_returnsDiscountedPrice
test_loginUser_withInvalidPassword_throwsAuthenticationError
```

## Example Test Patterns

### AAA Pattern (Arrange-Act-Assert)
```javascript
test('calculateTotal with items', () => {
  // Arrange
  const cart = new Cart();
  cart.addItem({ price: 10 }, 2);
  
  // Act
  const total = cart.getTotal();
  
  // Assert
  expect(total).toBe(20);
});
```

### BDD (Behavior-Driven Development)
```gherkin
Feature: User Authentication
  Scenario: Login with valid credentials
    Given a user with email "test@example.com"
    When the user logs in with correct password
    Then they should see the dashboard
```

## Metrics

- **Code Coverage**: % of code executed by tests (aim for 80%+)
- **Test Pass Rate**: % of tests passing
- **Test Execution Time**: How long tests take to run
- **Mutation Score**: % of introduced bugs caught

## Common Pitfalls to Avoid

- Over-testing trivial code
- Not testing error paths
- Flaky tests (non-deterministic)
- Testing implementation details
- Ignoring performance in tests
- Not testing concurrency

## References

- Test Driven Development (Kent Beck)
- Growing Object-Oriented Software, Guided by Tests
- Working Effectively with Legacy Code (Michael Feathers)
- Testing Strategies for Microservices
- Chaos Engineering (whitepaper)

Files in this skill

  • SKILL.md3.4 KB
  • description_ar.txt596 B
  • description_cn.txt316 B
  • description_de.txt387 B
  • description_en.txt324 B
  • description_es.txt399 B
  • description_fr.txt434 B
  • description_it.txt368 B
  • description_ja.txt492 B
  • description_ko.txt383 B
  • description_ru.txt755 B
  • description_tw.txt319 B
  • stats.json65 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.