# Advance Tests (Layer 3)

**Purpose:** Deeper quality gates aligned with security, usability, maintainability, performance, and extensibility priorities.

**Status:** OPTIONAL until v1.0.0, MANDATORY for production releases

**Target Runtime:** < 30 minutes total

## Overview

Advance tests map to five priority areas:

1. **Security** (Priority #1) - Defense-in-depth, OWASP Top 10
2. **Usability** (Priority #2) - API intuitiveness, documentation
3. **Maintainability** (Priority #3) - Code quality, design patterns
4. **Performance** (Priority #4) - Benchmarks, scalability
5. **Extensibility** (Priority #5) - Plugin support, customization

## Test Files

- `test_security.py` - Security excellence (Priority #1)
- `test_usability.py` - Usability excellence (Priority #2)
- `test_maintainability.py` - Maintainability excellence (Priority #3)
- `test_performance.py` - Performance excellence (Priority #4)
- `test_extensibility.py` - Extensibility excellence (Priority #5)

## Running Advance Tests

```bash
# All advance tests
python tests/runner.py --advance

# Specific priority
python tests/runner.py --security        # Priority #1
python tests/runner.py --usability       # Priority #2
python tests/runner.py --maintainability # Priority #3
python tests/runner.py --performance     # Priority #4
python tests/runner.py --extensibility   # Priority #5

# Directly
python tests/3.advance/runner.py

# With pytest
pytest tests/3.advance/ -m xwnode_advance
pytest tests/3.advance/ -m xwnode_security
```

## Activation Status

**v0.0.1 (Current):**
- Framework in place
- Tests are placeholders (skipped)
- Optional to implement

**v1.0.0+ (Future):**
- Intended to be required for release tagging
- Treat as production-readiness checks once implemented

## Test Categories

### 1. Security Excellence (Priority #1)
- OWASP Top 10 compliance
- Defense-in-depth validation
- Input validation comprehensive
- Path security checks
- Cryptographic operations
- Authentication/authorization
- Data protection
- Security logging
- Dependency security

### 2. Usability Excellence (Priority #2)
- API intuitiveness
- Error message clarity
- Documentation completeness
- Example quality
- Naming consistency
- API discoverability

### 3. Maintainability Excellence (Priority #3)
- Code quality metrics
- Separation of concerns
- Design pattern implementation
- Refactorability
- Modularity
- Code organization

### 4. Performance Excellence (Priority #4)
- Response time benchmarks
- Memory usage validation
- Scalability under load
- Async performance
- Caching effectiveness
- Resource management

### 5. Extensibility Excellence (Priority #5)
- Plugin support
- Hook/callback system
- Customization points
- Extension API design
- Strategy registration
- Backward compatibility

## Markers

Advance tests use:
```python
@pytest.mark.xwnode_advance              # All advance tests
@pytest.mark.xwnode_security             # Security tests
@pytest.mark.xwnode_usability            # Usability tests
@pytest.mark.xwnode_maintainability      # Maintainability tests
@pytest.mark.xwnode_performance          # Performance tests
@pytest.mark.xwnode_extensibility        # Extensibility tests
```

## Success Criteria (v1.0.0+)

- ✅ All 5 priority tests pass (100%)
- ✅ Security excellence validated
- ✅ Usability excellence validated
- ✅ Maintainability excellence validated
- ✅ Performance excellence validated
- ✅ Extensibility excellence validated
- ✅ Production readiness confirmed

