Repository navigation
Testing and Quality Assurance
Test · Validate · Secure · Review · Release
A comprehensive engineering reference for verifying EveryO's functionality, mathematical correctness, reliability, compatibility, security, and release readiness.
Home · Automatic Differentiation · Performance Optimization · Contributing
Maintained By & Owner: EveryO Contributors & @krishanth7
Important
Documentation Scope
This guide reflects the test configuration and CI workflows inspected in the EveryO repository. It distinguishes existing checks from recommended future quality gates.
The presence of a test or workflow does not establish that the latest run passed. Consult GitHub Actions for actual execution results.
- Overview
- Quality Engineering Architecture
- Development Environment
- Testing Framework
- Test Suite Organization
- Unit Testing
- Automatic Differentiation Testing
- Numerical Gradient Verification
- Neural Network Testing
- Optimizer and Loss Testing
- Data Pipeline Testing
- Integration Testing
- Backend and Device Testing
- ONNX and Serialization Testing
- Performance Regression Testing
- Code Coverage
- Static Analysis and Formatting
- Continuous Integration
- Security and Dependency Quality
- Documentation Testing
- Cross-Platform Compatibility
- Test Reproducibility
- Quality Gates and Release Criteria
- Troubleshooting
- Contributor Testing Checklist
- Developer References
- Next Steps
Testing and quality assurance ensure that EveryO behaves correctly across its supported functionality.
For a machine learning framework, correctness extends beyond successful execution. Mathematical gradients, numerical stability, model behavior, and serialization compatibility must also be verified.
- Functional correctness.
- Mathematical correctness.
- Numerical stability.
- API reliability.
- Cross-platform compatibility.
- Reproducible behavior.
- Regression prevention.
- Secure development.
- Release confidence.
| Dimension | Objective |
|---|---|
| Functionality | APIs behave as documented |
| Mathematics | Operations and gradients are correct |
| Reliability | Edge cases are handled |
| Compatibility | Supported environments work |
| Performance | Regressions are identified |
| Security | Risks are detected and managed |
| Maintainability | Changes remain testable |
| Documentation | Examples match implementation |
SOURCE CODE
|
v
Static Analysis
|
v
Unit Tests
|
v
Numerical Validation
|
v
Integration Tests
|
v
Backend Tests
|
v
Documentation Tests
|
v
Package Validation
|
v
Release Review
| Category | Primary Purpose |
|---|---|
| Unit | Individual components |
| Integration | Interacting components |
| Numerical | Mathematical correctness |
| Regression | Prevent previously fixed defects |
| Compatibility | Environment differences |
| Performance | Runtime efficiency |
| Security | Identify vulnerabilities |
| Acceptance | Release requirements |
Every meaningful code change should be accompanied by tests appropriate to its risk.
For example, changing tensor broadcasting may require unit tests, gradient tests, shape edge cases, and integration tests.
git clone https://github.com/krishanth7/EveryO.git
cd EveryOpython -m venv .venvActivate on Linux or macOS:
source .venv/bin/activateActivate on Windows PowerShell:
.venv\Scripts\Activate.ps1python -m pip install --upgrade pip
python -m pip install -e ".[dev]"The inspected development extra includes:
- pytest
- pytest-cov
- Ruff
- PyYAML
python -m everyo info
python -m everyo doctorEveryO uses pytest.
python -m pytestpython -m pytest -qpython -m pytest tests/test_autograd.pypython -m pytest \
tests/test_autograd.py::TestBasicGradients::test_square_gradientpython -m pytest -xpython -m pytest -vThe repository declares:
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
addopts = "-q --strict-markers"The configuration also treats RuntimeWarning as an error.
The inspected repository contains dedicated test files for multiple framework subsystems.
tests/
│
├── conftest.py
├── test_autograd.py
├── test_operations.py
├── test_layers.py
├── test_losses.py
├── test_optimizers.py
├── test_dataloader.py
├── test_integration.py
├── test_attention.py
├── test_conv.py
├── test_normalization.py
├── test_devices.py
├── test_distributed.py
├── test_precision.py
├── test_profiler.py
├── test_onnx.py
└── test_onnx_trace.py
This is a representative selection, not an exhaustive directory listing.
| Subsystem | Test File |
|---|---|
| Autograd | test_autograd.py |
| Tensor operations | test_operations.py |
| Neural layers | test_layers.py |
| Loss functions | test_losses.py |
| Optimizers | test_optimizers.py |
| DataLoader | test_dataloader.py |
| Integration | test_integration.py |
| Attention | test_attention.py |
| Convolution | test_conv.py |
| Devices | test_devices.py |
| Profiling | test_profiler.py |
| ONNX | test_onnx.py |
Unit tests verify individual operations in isolation.
import numpy as np
import everyo as eo
def test_tensor_addition():
a = eo.tensor([1.0, 2.0])
b = eo.tensor([3.0, 4.0])
result = a + b
np.testing.assert_allclose(
result.numpy(),
[4.0, 6.0]
)def test_matrix_multiplication_shape():
a = eo.ones(3, 4)
b = eo.ones(4, 5)
result = eo.matmul(a, b)
assert result.shape == (3, 5)A good unit test should:
- Have a clear purpose.
- Use small deterministic inputs.
- Check meaningful outputs.
- Cover relevant edge cases.
- Produce actionable failure messages.
Automatic differentiation is a critical component of EveryO.
For:
[ f(x)=x^2 ]
the derivative is:
[ f'(x)=2x ]
At (x=2):
[ f'(2)=4 ]
import numpy as np
import everyo as eo
def test_square_gradient():
x = eo.tensor(
[2.0],
requires_grad=True
)
y = x * x
y.backward()
np.testing.assert_allclose(
x.grad,
[4.0]
)This test corresponds to an existing gradient test pattern in EveryO.
- Addition.
- Subtraction.
- Multiplication.
- Division.
- Chain rule.
- Broadcasting.
- Gradient accumulation.
- Reused tensors.
- Gradient reset.
- Matrix multiplication.
Analytical gradients should be compared against numerical approximations.
For scalar-valued (f):
[ \frac{\partial f}{\partial x_i} \approx \frac{f(x_i+\epsilon)-f(x_i-\epsilon)} {2\epsilon} ]
where (\epsilon) is a small perturbation.
import numpy as np
def numerical_gradient(fn, values, epsilon=1e-5):
values = np.asarray(
values,
dtype=np.float64
).copy()
gradient = np.zeros_like(values)
for index in np.ndindex(values.shape):
original = values[index]
values[index] = original + epsilon
positive = fn(values)
values[index] = original - epsilon
negative = fn(values)
values[index] = original
gradient[index] = (
positive - negative
) / (2.0 * epsilon)
return gradientnp.testing.assert_allclose(
analytical_gradient,
numerical_gradient_result,
rtol=1e-4,
atol=1e-6
)These tolerances are consistent with the inspected autograd test configuration, but should be adjusted when numerical conditions require it.
Finite differences may be unreliable near:
- Discontinuities.
- Non-differentiable points.
- Numerical overflow.
- Severe cancellation.
- Poorly scaled inputs.
Neural network layers should be tested independently and in combinations.
- Correct output shape.
- Parameter initialization.
- Forward computation.
- Backward gradients.
- Batch handling.
- Evaluation behavior.
- Numerical stability.
import everyo as eo
def test_linear_output_shape():
layer = eo.Linear(
4,
8,
seed=0
)
x = eo.zeros(16, 4)
output = layer(x)
assert output.shape == (16, 8)def test_sequential_model_shape():
model = eo.Sequential(
eo.Linear(4, 8, seed=0),
eo.ReLU(),
eo.Linear(8, 2, seed=1)
)
output = model(eo.zeros(16, 4))
assert output.shape == (16, 2)Optimizers and losses must produce mathematically meaningful results.
- Parameters update after a step.
- Zero gradients are handled.
- Optimizer state behaves correctly.
- Invalid hyperparameters are rejected.
- Updates remain numerically stable.
- Expected output shape.
- Known reference values.
- Gradient correctness.
- Target compatibility.
- Numerical stability.
Use simple functions with known solutions.
For example:
[ L(w)=(w-3)^2 ]
The optimum is:
[ w^*=3 ]
An optimizer test can verify that repeated updates reduce this objective under a suitable learning rate.
The data pipeline should preserve sample correctness and batch integrity.
import numpy as np
import everyo as eo
def test_dataloader_batch_count():
features = np.zeros(
(10, 2),
dtype=np.float32
)
targets = np.zeros(
10,
dtype=np.int64
)
dataset = eo.ArrayDataset(
features,
targets
)
loader = eo.DataLoader(
dataset,
batch_size=4
)
assert len(loader) == 3- Empty datasets.
- Invalid batch size.
- Incomplete final batch.
- Shuffling.
- Feature-target alignment.
- Reproducibility.
- Custom dataset collation.
Integration tests verify complete workflows.
Dataset
|
v
DataLoader
|
v
Neural Network
|
v
Loss Function
|
v
Autograd
|
v
Optimizer
|
v
Updated Model
- Complete training loop.
- Validation workflow.
- Callback execution.
- Checkpoint restoration.
- Prediction after training.
- Training history recording.
Integration tests should verify not only that execution completes, but that meaningful invariants hold.
For example, an appropriately configured model should demonstrate learning on a simple deterministic problem.
EveryO includes CPU and optional accelerator functionality.
The CPU path should remain testable without CUDA hardware.
CUDA-specific tests should:
- Check availability.
- Skip gracefully when unavailable.
- Verify supported operations.
- Compare numerical results with CPU.
- Test error handling.
from everyo.core.device import device
def test_cpu_device():
resolved = device("cpu")
assert resolved.type == "cpu"The repository defines pytest markers:
cuda
tensorflow
slow
Example:
import pytest
@pytest.mark.cuda
def test_cuda_specific_operation():
...Markers classify tests; they do not automatically implement environment checks or skipping.
Model serialization must preserve architecture and numerical behavior.
- Save a model.
- Load the archive.
- Compare parameters.
- Compare predictions.
- Verify metadata.
- Reject malformed files.
The repository includes:
tests/test_onnx.py
tests/test_onnx_trace.py
EveryO Model
|
v
ONNX Export
|
v
ONNX Runtime
|
v
Compare Predictions
|
v
Numerical Verification
np.testing.assert_allclose(
everyo_output,
onnx_output,
rtol=1e-5,
atol=1e-6
)Choose tolerances appropriate to the operation and backend.
Performance tests detect unintended slowdowns.
- Forward-pass latency.
- Backward-pass latency.
- Training throughput.
- Memory consumption.
- DataLoader throughput.
- Serialization time.
[ R= \frac{T_{new}-T_{baseline}} {T_{baseline}}\times100 ]
where (T) is elapsed time.
- Record a stable baseline.
- Use equivalent inputs.
- Warm up the workload.
- Run repeated measurements.
- Compare distributions.
- Investigate meaningful regressions.
Performance results from shared CI runners can be noisy.
A dedicated benchmark environment is preferable for enforcing strict performance thresholds.
Code coverage indicates which code was exercised during testing.
python -m pip install pytest-covpython -m pytest \
--cov=everyo \
--cov-report=term-missingpython -m pytest \
--cov=everyo \
--cov-report=htmlOpen:
htmlcov/index.html
| Area | Proposed Target |
|---|---|
| Core tensor operations | 95% |
| Autograd | 95% |
| Loss functions | 95% |
| Optimizers | 90% |
| Data utilities | 90% |
| Serialization | 90% |
| Overall project | 90% |
Note
These are proposed engineering targets, not measured or currently enforced EveryO coverage results.
High line coverage does not guarantee mathematical correctness.
Combine coverage with meaningful assertions, edge cases, numerical gradient checks, and integration tests.
EveryO uses Ruff for linting and formatting checks.
ruff check .ruff format --check .ruff format .The repository declares:
[tool.ruff]
line-length = 100
target-version = "py39"The development dependency pins Ruff to a specific version to reduce formatter drift between local development and CI.
- Resolve lint violations before submitting a PR.
- Avoid unrelated formatting changes.
- Keep imports organized.
- Prefer readable and testable code.
EveryO uses GitHub Actions for automated validation.
.github/workflows/
├── tests.yml
└── cuda-build.yml
The inspected tests.yml runs on:
- Pushes.
- Pull requests.
- Manual workflow dispatch.
| Job | Purpose |
|---|---|
test |
Python tests and doctests |
lint |
Ruff checks |
tensorflow |
TensorFlow integration |
examples |
Example scripts |
onnx |
ONNX round-trip testing |
build |
Package build and metadata validation |
The inspected workflow tests:
| Platform | Python Versions |
|---|---|
| Ubuntu | 3.9, 3.10, 3.11, 3.12 |
| macOS | 3.12 |
| Windows | 3.12 |
Push / Pull Request
|
v
GitHub Actions
|
+-- Unit Tests
|
+-- Integration Tests
|
+-- Doctests
|
+-- Ruff Lint
|
+-- Formatting
|
+-- TensorFlow Tests
|
+-- ONNX Tests
|
+-- Examples
|
+-- Package Build
View the current execution results:
Security checks should complement functional tests.
- Dependency vulnerability scanning.
- Secret detection.
- Static security analysis.
- Safe deserialization testing.
- Input validation.
- Least-privilege CI permissions.
A proposed local audit command is:
python -m pip install pip-audit
python -m pip_auditThis requires the external pip-audit package.
| Check | Proposed Tool |
|---|---|
| Dependency vulnerabilities | pip-audit |
| Secret scanning | Gitleaks |
| Python security patterns | Bandit |
| Dependency updates | Dependabot |
| Supply-chain review | GitHub dependency review |
These are recommendations; they are not claims that every check is already configured in EveryO.
Documentation examples must remain consistent with the source code.
The existing CI workflow runs:
python -m pytest \
--doctest-modules everyo -q \
--ignore=everyo/serialization/onnx_export.py \
--ignore=everyo/serialization/onnx_trace.pyThe ONNX exporters have dedicated doctest execution in the ONNX job.
- Use valid public APIs.
- Verify imports.
- Include correct expected outputs.
- Explain optional dependencies.
- Avoid fabricated benchmark values.
- Distinguish conceptual examples from executable code.
- Page title is accurate.
- Code examples are valid.
- API signatures match the source.
- Internal links are correct.
- Version requirements are documented.
- Mathematical formulas are verified.
- Limitations are explained.
Cross-platform testing helps identify operating-system and runtime differences.
- Linux.
- Windows.
- macOS.
- Filesystem path differences.
- Environment activation.
- Dependency installation.
- Numerical library behavior.
- Native extension compilation.
- Multiprocessing behavior.
Use platform-independent paths:
from pathlib import Path
output = Path("artifacts") / "model.evo"Avoid hard-coded platform-specific separators when unnecessary.
Reproducible tests produce consistent outcomes under controlled conditions.
EveryO's tests/conftest.py includes a seeded NumPy random generator fixture.
Example:
import numpy as np
import pytest
@pytest.fixture
def rng():
return np.random.default_rng(1234)- Explicit random seeds.
- Deterministic reference inputs.
- Stable test tolerances.
- Documented dependency versions.
- Controlled environment assumptions.
Do not depend unnecessarily on:
- Exact execution timing.
- Unstable sample ordering.
- External network services.
- Machine-specific paths.
- Uncontrolled random values.
The following gates are recommended for a formal EveryO release process.
| Gate | Recommended Requirement |
|---|---|
| Unit tests | All required tests pass |
| Integration tests | All required tests pass |
| Gradient checks | Within defined tolerances |
| Lint | No violations |
| Formatting | No violations |
| Documentation | Examples validated |
| Packaging | Build and metadata checks pass |
| Security | No unresolved critical findings |
| Compatibility | Supported matrix passes |
| Release review | Maintainer approval |
Candidate Release
|
v
Functional Tests
|
v
Numerical Validation
|
v
Compatibility Tests
|
v
Security Review
|
v
Package Verification
|
v
Maintainer Approval
|
v
Release Publication
These are recommended release criteria. They become enforceable only when adopted through repository governance, CI configuration, and branch protection or equivalent controls.
pytest cannot import EveryO
Install the package in editable mode:
python -m pip install -e ".[dev]"Confirm the intended Python environment is active.
Numerical gradient tests fail
Check analytical gradient formulas, input dtype, finite-difference epsilon, broadcasting behavior, and numerical tolerance.
CUDA tests fail without a GPU
Check that tests requiring CUDA skip appropriately when the required extension is unavailable.
Ruff fails in CI but passes locally
Confirm that the local Ruff version matches the version specified in the development dependencies.
ONNX tests fail
Install the ONNX optional dependencies and verify compatibility between the exporter and ONNX Runtime.
Coverage is lower than expected
Identify untested branches and edge cases. Prioritize meaningful tests rather than writing assertions solely to increase coverage percentages.
Before submitting a pull request:
- Understand the affected subsystem.
- Add tests for new behavior.
- Add regression tests for bug fixes.
- Verify numerical correctness where relevant.
- Run the relevant test files.
- Run the full test suite.
- Run Ruff linting.
- Run formatting checks.
- Update documentation.
- Review compatibility impacts.
- Confirm no credentials are committed.
- Describe validation in the PR.
python -m pytest -q
ruff check .
ruff format --check .
python -m compileall -q everyo
python -m buildThe final command requires the build package, which can be installed with:
python -m pip install build| Resource | Link |
|---|---|
| EveryO Repository | GitHub |
| Test Suite | tests/ |
| Test Fixtures | conftest.py |
| Autograd Tests | test_autograd.py |
| Integration Tests | test_integration.py |
| DataLoader Tests | test_dataloader.py |
| ONNX Tests | test_onnx.py |
| CI Workflow | tests.yml |
| CUDA Workflow | cuda-build.yml |
| Project Configuration | pyproject.toml |
| GitHub Actions | Workflow Runs |
| Issues | GitHub Issues |
Continue with EveryO's development and contributor documentation.
| Page | Focus |
|---|---|
| Development Setup | Contributor environment and tooling |
| Contributing | Contribution workflow |
| Coding Standards | Style and maintainability |
| Pull Request Guidelines | Review requirements |
| Release Process | Versioning and release management |
Wiki links become active after their corresponding pages are created.
Next Recommended Page: Development Setup →
Home · Performance Optimization · Automatic Differentiation · Contributing
EveryO — Open Machine Learning. Built for Developers.
Maintained By & Owner:
EveryO Contributors & @krishanth7
Open Source · MIT Licensed · Community Driven
© 2026 EveryO Contributors