Skip to content

Conversation

@guiandmag
Copy link
Contributor

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to ArchUnitNode?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Added 157 test cases achieving 93%+ coverage for architectural patterns:

Architectures.ts (5.71% -> 99.42% coverage):
- 64 tests covering all 5 patterns (Layered, Onion, Clean, DDD, Microservices)
- Tests for layer definitions, dependency rules, conversions, and edge cases
- Integration tests with real code fixtures

PatternLibrary.ts (4.04% -> 94.27% coverage):
- 93 tests covering all 5 patterns (MVC, MVVM, CQRS, Event-Driven, Ports-and-Adapters)
- Tests for factory functions, layer definitions, dependency rules
- Pattern-specific validations (CQRS command/query separation, event immutability, ports interfaces)
- Complex scenarios and edge cases

Overall library/ directory now at 93.94% statement coverage.
Added 62 test cases for ClassesThat filtering and predicate chains:
- Constructor and basic setup
- Logical operators (not(), or(), and())
- Package filtering (resideInPackage, resideOutsideOfPackage)
- Decorator filtering (areAnnotatedWith, areNotAnnotatedWith)
- Name pattern filtering (matching, ending with, starting with)
- Type hierarchy filtering (areAssignableTo, implement, extend)
- Complex predicate chains with multiple operators
- Transition to ClassesShould
- Edge cases and error handling
- Integration with real code fixtures

Coverage improved from 0% to 84.37% statements (98.03% lines).
…age)

- Created 93 test cases covering all 40 static template methods
- Tests naming conventions (9 basic + 10 extended)
- Tests dependency rules (5 architectural rules)
- Tests pattern-specific rules (10 rules)
- Tests rule collection methods (getAllRules, getAllNamingConventionRules, etc.)
- Integration tests with real codebase
- Edge cases and error handling
- All 93 tests passing
- Achieved 100% statement, function, and line coverage
…overage)

- Created 46 test cases covering all formatting methods
- Tests single/multiple violation formatting
- Tests summary generation with severity breakdown
- Tests color options (enabled/disabled)
- Tests code context with line highlighting
- Tests relative vs absolute paths
- Tests edge cases (missing files, special chars, Unicode, etc.)
- All 46 tests passing
- Achieved 99.01% statement, 100% function, 98.95% line coverage
- Only 1 uncovered line (error catch branch)
Achieves 82%+ coverage across all metrics for ClassesShould.ts:
- Statements: 82.39% (target: 80%) ✓
- Branches: 70.8% (target: 70%) ✓
- Functions: 86.81% (target: 75%) ✓
- Lines: 84.26% (target: 80%) ✓

Coverage improvement: 37.42% → 82.39% (+44.97 percentage points)

Tests cover all 28 assertion methods:
- Package rules (resideInPackage, notResideInPackage)
- Decorator rules (beAnnotatedWith, notBeAnnotatedWith)
- Naming rules (haveSimpleName, matching, endingWith, startingWith + negations)
- Dependency rules (onlyDependOnClassesThat, notDependOnClassesThat)
- Cyclic dependency rules (notFormCycles, formCycles)
- Interface rules (beInterfaces, notBeInterfaces)
- Abstract rules (beAbstract, notBeAbstract)
- Assignability rules (beAssignableTo, notBeAssignableTo, beAssignableFrom)
- Field/method rules (haveOnlyReadonlyFields, haveOnlyPrivateConstructors, haveOnlyPublicMethods)

Tests include:
- Direct ClassesShould API usage
- ArchRuleDefinition static API integration
- Wildcard pattern support in dependency rules
- Edge cases and error handling
- Severity level application
- Rule description generation
**Repository Organization:**
- Moved 14 planning/analysis documents from root to docs/planning/
- Created docs/planning/README.md as comprehensive index
- Updated docs/README.md to include planning section
- Cleaned up root directory to contain only essential files

**Benefits:**
✓ Cleaner root directory - easier for new contributors
✓ Better documentation organization - easier to find resources
✓ Preserved historical context - all planning docs archived
✓ Professional structure - industry best practices

**Files Reorganized:**
- API audit reports (4 files)
- Coverage improvement plans (3 files)
- Code/deep analysis reports (2 files)
- Release readiness reports (2 files)
- Documentation audit (1 file)
- Executive summary (1 file)
- Planning index (1 new file)

This makes the repository more maintainable and easier to navigate,
following GitHub best practices for project organization.
Add REPOSITORY_QUALITY.md showcasing:
- Code quality metrics and standards
- Test coverage improvements (+44% to +99% across core modules)
- Documentation excellence with 15+ doc files
- Development tools and CI/CD pipeline
- Feature comparison with ArchUnit Java
- Best-in-class repository practices
@guiandmag guiandmag self-assigned this Nov 18, 2025
@guiandmag guiandmag merged commit 7f9946a into master Nov 18, 2025
1 of 16 checks passed
@guiandmag guiandmag deleted the claude/improve-test-coverage-018xnijuf3Wke5uEiKP9n9dT branch November 18, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants