Skip to content

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

pip install pytest pytest-cov
# Windows
.dev\run_all_tests.bat

# Linux/Mac
.dev/run_all_tests.sh

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

  1. Ensure compliance with format standards
    python tools/review-code/validation/check_solutions.py --verbose
    
  2. Add test cases to tests/ directory
  3. Run tests to verify
    python -m pytest .dev/tests_solutions -v -k "problem_number"
    
  4. Commit code

Modifying Runner Modules

  1. Run existing tests to ensure they pass
  2. Make modifications
  3. Run tests again
    python -m pytest .dev/tests -v
    
  4. Commit code

Refactoring Code

  1. Run all tests to establish baseline
    .dev\run_all_tests.bat
    
  2. Perform refactoring
  3. Run all tests again to ensure consistent behavior
  4. 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

  1. Behavior Testing First - Test "what it does" not "how it does it"
  2. Independence - Each test runs independently, not relying on other tests
  3. Reproducibility - Test results are deterministic
  4. Clarity - Tests are easy to understand and maintain
  5. Completeness - Cover normal cases and edge cases

πŸ“ž Contact Information

Test Lead: luffdev
Created: 2025-12-08
Last Updated: 2025-12-12



Note: This folder's contents are for maintainers only; general users need not be concerned.