Skip to content

TESTING.md

CeloHT edited this page Jul 31, 2026 · 1 revision

Testing

This document describes the testing strategy used throughout the CeloHT ecosystem.

Testing is essential to ensure that every release is secure, reliable, and production-ready.


Philosophy

CeloHT follows a test-first mindset.

Every new feature, bug fix, or improvement should be validated through automated and manual testing before being merged.

Our goals are:

  • Reliability
  • Security
  • Stability
  • Performance
  • Maintainability

Testing Pyramid

                 Manual Testing
                      ▲
             Integration Tests
                      ▲
                Unit Tests

Unit tests should represent the majority of all tests.


Types of Tests

Unit Tests

Unit tests verify individual functions and components.

Examples:

  • Utility functions
  • React components
  • Smart contract methods
  • API services

Example:

npm test

Integration Tests

Integration tests verify that multiple components work correctly together.

Examples:

  • Wallet connection
  • Smart contract interaction
  • Database communication
  • API requests

End-to-End (E2E) Tests

E2E tests simulate real user behavior.

Examples:

  • Connect wallet
  • Register an agent
  • Complete an education course
  • Submit a governance vote

Recommended tools:

  • Playwright
  • Cypress

Smart Contract Tests

Every smart contract must include automated tests.

Example:

npx hardhat test

Tests should verify:

  • Expected behavior
  • Access control
  • Edge cases
  • Invalid inputs
  • Security protections

Security Testing

Security testing includes:

  • Static analysis
  • Dependency scanning
  • Secret detection
  • Access control validation
  • Smart contract vulnerability testing

Recommended tools:

  • Slither
  • Mythril
  • OpenZeppelin Defender
  • GitHub Advanced Security

Performance Testing

Performance tests measure:

  • API response time
  • Page load time
  • Database performance
  • Smart contract gas usage

Accessibility Testing

The CeloHT platform should follow accessibility best practices.

Areas to verify:

  • Keyboard navigation
  • Screen reader compatibility
  • Color contrast
  • Responsive layouts
  • Form accessibility

Test Coverage

Recommended minimum coverage:

Area Coverage
Utilities 95%
Components 90%
Services 90%
Smart Contracts 100%
API 90%

Running Tests

Run all tests

npm test

Run coverage

npm run coverage

Run smart contract tests

npx hardhat test

Run E2E tests

npm run test:e2e

Continuous Integration

Every Pull Request automatically runs:

  • Dependency installation
  • Type checking
  • Linting
  • Unit tests
  • Smart contract tests
  • Build verification
  • Security checks

A Pull Request cannot be merged if any required check fails.


Manual Testing Checklist

Before every release verify:

  • Wallet connection
  • Navigation
  • Responsive design
  • Forms
  • Documentation links
  • Smart contract interactions
  • Transaction confirmation
  • Error handling

Bug Reporting

A good bug report should include:

  • Environment
  • Browser
  • Operating System
  • Steps to reproduce
  • Expected behavior
  • Actual behavior
  • Screenshots (if applicable)
  • Logs (if available)

Best Practices

  • Write tests before fixing bugs.
  • Keep tests independent.
  • Avoid flaky tests.
  • Test edge cases.
  • Use meaningful test names.
  • Maintain high code coverage.
  • Review failing tests before merging.

Future Improvements

Planned enhancements include:

  • Visual regression testing
  • Load testing
  • Chaos engineering
  • AI-assisted test generation
  • Cross-browser automation
  • Mobile device testing
  • Continuous performance monitoring

Conclusion

Testing is a core part of the CeloHT development process.

Every contributor shares responsibility for delivering secure, reliable, and high-quality software that supports the project's mission of financial inclusion, education, and sustainable development.

Welcome to the official CeloHT documentation. This knowledge base provides comprehensive documentation for users, developers, contributors, partners, researchers, and ecosystem participants. Explore architecture, APIs, smart contracts, developer guides, governance, security, educational resources, roadmap, transparency reports, and community initiatives. Built with openness, collaboration, and long-term sustainability in mind, the CeloHT documentation follows international open-source documentation standards to make learning, building, and contributing accessible to everyone.

Clone this wiki locally