Developer & Maintainer Area¶
Status: Informational
Scope:.dev/directory
Last Updated: December 27, 2025 13:49:14
Created: December 8, 2025 17:09:22β οΈ Note: This folder is for project maintainers only, containing unit tests, development documentation, and maintenance tools.
For general users, please refer to the root README.md
π Folder Structure¶
.dev/
βββ tests/ # Component tests (Runner modules)
β βββ test_util.py # util.py tests (40+ tests)
β βββ test_case_runner.py # case_runner.py tests (15+ tests)
β βββ test_test_runner.py # test_runner.py tests (30+ tests)
β βββ test_complexity_estimator.py # complexity_estimator.py tests (25+ tests)
β βββ test_edge_cases.py # Edge case tests (40+ tests)
β βββ test_integration.py # Integration tests (20+ tests)
β βββ test_generate_mindmaps.py # mindmap generator tests (50+ tests)
β βββ test_generate_pattern_docs.py # pattern doc generator tests (50+ tests)
β βββ README.md
β
βββ tests_solutions/ # Solution correctness tests
β βββ test_all_solutions.py # All Solution tests (~99 tests)
β βββ README.md
β
βββ run_tests.bat # Windows - Component tests
βββ run_tests.sh # Linux/Mac - Component tests
βββ run_tests_solutions.bat # Windows - Solution tests
βββ run_tests_solutions.sh # Linux/Mac - Solution tests
βββ run_all_tests.bat # β
Windows - Full project tests
βββ run_all_tests.sh # β
Linux/Mac - Full project tests
β
βββ testing.md # Complete testing documentation
βββ virtual-env-setup.md # Virtual environment setup guide
βββ README.md # This file
π― Test Categories¶
This project's tests are divided into three main categories:
| Category | Directory | Purpose | Count |
|---|---|---|---|
| Format Compliance Tests | tools/review-code/validation/tests/ | Solution format standards | ~10 |
| Component Tests | .dev/tests/ | Runner module functionality | ~273 |
| Solution Correctness Tests | .dev/tests_solutions/ | Solution execution results | ~99 |
π Quick Start¶
1. Ensure Virtual Environment is Set Up¶
# Windows
python -m venv leetcode
leetcode\Scripts\activate
# Linux/Mac
python -m venv leetcode
source leetcode/bin/activate
2. Install Test Dependencies¶
3. Run All Tests (Recommended)¶
This will execute in order: 1. β Solution format compliance tests 2. β Runner component tests 3. β Solution correctness tests
4. Run Tests Separately¶
# === Format Compliance Tests ===
# Windows
tools\review-code\validation\run_format_tests.bat
# Linux/Mac
tools/review-code/validation/run_format_tests.sh
# === Component Tests ===
# Windows
.dev\run_tests.bat
# Linux/Mac
.dev/run_tests.sh
# === Solution Correctness Tests ===
# Windows
.dev\run_tests_solutions.bat
# Linux/Mac
.dev/run_tests_solutions.sh
π Test Statistics¶
| Item | Count |
|---|---|
| Test Files | 10 |
| Test Classes | 70+ |
| Test Cases | 380+ |
| Code Coverage | 80-100% |
Test Coverage¶
- β
runner/util.py- 100% coverage - β
runner/case_runner.py- 90% coverage - β
runner/test_runner.py- 85% coverage - β
runner/complexity_estimator.py- 80% coverage - β
solutions/*.py- Format compliance validation
π Documentation Index¶
Core Documentation¶
| Document | Description |
|---|---|
| testing.md | Complete testing documentation (strategy, principles, workflow) |
| virtual-env-setup.md | Virtual environment setup guide |
| documentation-architecture.md | Documentation structure and best practices |
| tests/README.md | Component tests detailed description |
| tests_solutions/README.md | Solution tests detailed description |
| ../tools/README.md | Developer tools reference |
π§ Development Workflow¶
Adding New Solutions¶
- Ensure compliance with format standards
- Add test cases to
tests/directory - Run tests to verify
- Commit code
Modifying Runner Modules¶
- Run existing tests to ensure they pass
- Make modifications
- Run tests again
- Commit code
Refactoring Code¶
- Run all tests to establish baseline
- Perform refactoring
- Run all tests again to ensure consistent behavior
- Commit code
π Test Command Reference¶
# === Full Project Tests ===
.dev\run_all_tests.bat # Windows
.dev/run_all_tests.sh # Linux/Mac
# === Format Tests ===
python tools/review-code/validation/check_solutions.py # Quick check
python tools/review-code/validation/check_solutions.py --verbose # Show suggestions
python -m pytest tools/review-code/validation/tests -v # Unit tests
# === Component Tests ===
python -m pytest .dev/tests -v # All
python -m pytest .dev/tests -v -m unit # By marker
# === Solution Tests ===
python -m pytest .dev/tests_solutions -v # All
python -m pytest .dev/tests_solutions -v -k "0023" # Specific problem
# === Coverage Report ===
python -m pytest .dev/tests --cov=runner --cov-report=html
π Testing Principles¶
- Behavior Testing First - Test "what it does" not "how it does it"
- Independence - Each test runs independently, not relying on other tests
- Reproducibility - Test results are deterministic
- Clarity - Tests are easy to understand and maintain
- Completeness - Cover normal cases and edge cases
π Contact Information¶
Test Lead: luffdev
Created: 2025-12-08
Last Updated: 2025-12-12
π Related Links¶
- Project Main README - Project overview
- Root pytest.ini - pytest configuration file
- requirements.txt - Project dependencies
Note: This folder's contents are for maintainers only; general users need not be concerned.