Testing¶
Testing Overview¶
RAPID employs a comprehensive testing strategy that combines static code analysis with runtime testing to ensure code quality and scientific integrity.
Static Code Analysis¶
RAPID uses multiple static analysis tools to enforce consistency and quality:
Markdown Linting¶
pymarkdown scan *.md
.pymarkdown.yml
configuration file.
YAML Linting¶
yamllint .*.yml .github/*/*.yml
.yamllint.yml
.
Dockerfile Linting¶
hadolint --ignore DL3008 --ignore SC2046 Dockerfile
wc -L Dockerfile | awk '{exit $1 > 79}'
Python Code Linting¶
flake8 src/*.py src/rapid2/*.py
Python Type Checking¶
mypy --strict src/*.py src/rapid2/*.py
Runtime Testing¶
Python Docstring Testing¶
python3 -m doctest src/rapid2/*.py
Scientific Integrity Testing¶
Replication of past results testing is planned for future implementation.
Testing Guidelines¶
For Developers¶
- Run all static analysis tools before submitting code
- Ensure doctest examples pass for any modified functions
- Maintain type hints for all function parameters and returns
- Follow naming conventions and code style guidelines
Test Commands Summary¶
Run all tests with these commands:
# Static analysis
pymarkdown scan *.md
yamllint .*.yml .github/*/*.yml
hadolint --ignore DL3008 --ignore SC2046 Dockerfile
flake8 src/*.py src/rapid2/*.py
mypy --strict src/*.py src/rapid2/*.py
# Runtime testing
python3 -m doctest src/rapid2/*.py
For complete testing procedures and configuration details, see TESTING.md in the RAPID repository.