Welcome to the project testing documentation. This guide provides comprehensive information about testing practices, conventions, and guidelines for your multi-platform project.
This testing strategy supports multi-platform architectures with:
- Core Tests: Business logic tests that verify core functionality
- Platform-Specific Tests: Platform-specific implementation tests
- UI Tests: Automated UI testing for each platform
- Integration Tests: End-to-end testing with external services
Note: For specific technology stacks (e.g., Kotlin Multiplatform), see relevant guides in docs/modules/
- Unit Testing - Writing and running unit tests across platforms
- UI Testing - Automated UI testing for iOS and Android
- Integration Testing - Testing external service integrations
- Test Coverage - Coverage requirements and measurement
- Troubleshooting - Common issues and solutions
# Example commands - adapt to your build system and platform
# Run all tests
./run-tests.sh --all
# Run platform-specific tests
./run-tests.sh --platform=<platform-name>
# Run specific test suite
./run-tests.sh --suite=unit
./run-tests.sh --suite=integration
./run-tests.sh --suite=uiSee platform-specific documentation for detailed test commands.
A typical multi-platform project structure:
your-project/
├── core/ # Core business logic
│ └── tests/ # Core tests
├── platform-a/ # Platform A implementation
│ ├── tests/ # Platform A unit tests
│ └── ui-tests/ # Platform A UI tests
└── platform-b/ # Platform B implementation
├── tests/ # Platform B unit tests
└── ui-tests/ # Platform B UI tests
Adapt this structure to your specific project needs and technology stack.
We follow the test pyramid approach:
- Unit Tests (70%): Fast, isolated tests for individual components
- Integration Tests (20%): Tests for component interactions
- UI Tests (10%): End-to-end user flow tests
Ensure equivalent test coverage across platforms:
- Shared business logic tested in common tests
- Platform-specific implementations tested separately
- UI behaviors tested on both iOS and Android
Use descriptive test names that clearly indicate:
- What is being tested
- Under what conditions
- What the expected outcome is
Example patterns:
testFunctionName_WhenCondition_ExpectedBehaviorfunction_shouldBehavior_whenConditiongiven_when_thenformat
Consult your language/framework conventions for specific naming guidelines.
- Each test should be independent and not rely on other tests
- Use proper setup and teardown methods
- Avoid shared mutable state between tests
Our CI/CD pipeline runs tests automatically:
-
Pull Request Checks
- All unit tests must pass
- Code coverage must meet minimum thresholds
- UI tests run on key user flows
-
Main Branch Protection
- No direct commits to main
- All tests must pass before merge
- Coverage reports generated automatically
- Check the Troubleshooting Guide for common issues
- Review platform-specific guides for detailed instructions
- Consult the example tests in the codebase
When adding new features:
- Write tests first (TDD approach encouraged)
- Ensure tests pass on all platforms
- Update documentation if testing approach changes
- Include tests in your pull request
- Unit Testing Guide - Start here for writing your first tests
- UI Testing Guide - Learn about automated UI testing
- Test Coverage - Understanding our coverage requirements