|
| 1 | +# Testing Plan |
| 2 | + |
| 3 | +## Overview |
| 4 | +This document provides a comprehensive outline of our application's current test coverage, identifies areas that require immediate testing attention, and guides future test development priorities. |
| 5 | + |
| 6 | +## Note on Test Coverage |
| 7 | +The percentages of test coverage reported below are derived using the `coverage` tool. This tool generates a coverage report as part of the Run Full Test Suite, which triggers every time a commit is made to a branch for which there is an open PR. Observations from these reports can be viewed directly in the terminal. |
| 8 | + |
| 9 | +## Testing Categories and Current Coverage |
| 10 | + |
| 11 | +### Configuration and Setup |
| 12 | +- **Critical and Untested**: |
| 13 | + - `config/settings/local.py` (0%): Environment-specific settings for local development. |
| 14 | + - `config/settings/production.py` (0%): Environment-specific settings for production environments. |
| 15 | + - `config/wsgi.py` (0%): WSGI configuration for deployment. |
| 16 | +- **Partially Tested**: |
| 17 | + - `config/urls.py` (71%): URL dispatching and routing configurations. |
| 18 | +- **Tested**: |
| 19 | + - `config/settings/base.py` (100%): Base settings including middleware, database configurations, etc. |
| 20 | + |
| 21 | +### Model Layer |
| 22 | +- **Critical and Undertested**: |
| 23 | + - `sde_collections/models/collection.py` (65%): Core model for handling collections, requires deeper testing due to its critical role in data management. |
| 24 | + - `sde_collections/models/pattern.py` (46%): Handles complex pattern matching logic, significantly under-tested. |
| 25 | + - `feedback/models.py` (64%): Involves important logic for managing feedback, requires additional coverage to ensure robust data integrity and operations. |
| 26 | +- **Tested**: |
| 27 | + - `environmental_justice/models.py` (97%) |
| 28 | + - `sde_collections/models/candidate_url.py` (82%) |
| 29 | + - `sde_collections/models/collection_choice_fields.py` (86%) |
| 30 | + - `sde_collections/models/delta_patterns.py` (89%) |
| 31 | + - `sde_collections/models/delta_url.py` (77%) |
| 32 | + - `sde_indexing_helper/users/models.py` (100%) |
| 33 | + |
| 34 | +### Views and Controllers |
| 35 | +- **Critical and Undertested**: |
| 36 | + - `sde_collections/views.py` (38%): Central component for application's user interface logic, critically under-tested. |
| 37 | +- **Tested**: |
| 38 | + - `environmental_justice/views.py` (100%) |
| 39 | + - `feedback/views.py` (100%) |
| 40 | + |
| 41 | +### Data Serialization and APIs |
| 42 | +- **Critical and Undertested**: |
| 43 | + - `sde_collections/serializers.py` (75%): Essential for API interaction, requires further testing to ensure robust data serialization. |
| 44 | +- **Tested**: |
| 45 | + - `environmental_justice/serializers.py` (100%) |
| 46 | + - `feedback/serializers.py` (100%) |
| 47 | + |
| 48 | +### Admin Interface |
| 49 | +- **Critical and Undertested**: |
| 50 | + - `sde_collections/admin.py` (66%): Admin interface for managing application data, requires additional tests. |
| 51 | +- **Tested**: |
| 52 | + - `environmental_justice/admin.py` (100%) |
| 53 | + - `feedback/admin.py` (100%) |
| 54 | + |
| 55 | +### Utilities and Helpers |
| 56 | +- **Critical and Undertested/Untested**: |
| 57 | + - `sde_collections/utils/github_helper.py` (19%) |
| 58 | + - `sde_collections/utils/health_check.py` (14%) |
| 59 | + - `sde_collections/utils/bulk_github_push.py` (0%) |
| 60 | + - `sde_collections/utils/generate_deployment_message.py` (0%) |
| 61 | + - `sde_collections/utils/slack_utils.py` (79%) |
| 62 | + - `sde_indexing_helper/utils/storages.py` (0%) |
| 63 | + |
| 64 | +### Testing Infrastructure |
| 65 | +- **Tested with Gaps**: |
| 66 | + - `sde_collections/tests/*.py` |
| 67 | + - `sde_indexing_helper/users/tests/*.py` |
| 68 | + |
| 69 | +### Database and Migration Scripts |
| 70 | +- **Critical and Mostly Untested**: |
| 71 | + - `config_generation/*.py`: Most scripts involved in database configuration and migration scripts are critically under-tested, posing a risk to data integrity and application setup. |
| 72 | + |
| 73 | +### Task Automation and Background Jobs |
| 74 | +- **Critical and Undertested**: |
| 75 | + - `sde_collections/tasks.py` (44%): Handles background tasks and automation, significantly under-tested considering their operational importance. |
| 76 | + |
| 77 | +## Critical Areas for Immediate Testing |
| 78 | +1. **Configuration Files**: Immediate testing for `config/settings/local.py` and `config/settings/production.py` to ensure they function correctly across different environments. |
| 79 | +2. **Core Business Logic in Models and Views**: Focus on significantly under-tested `sde_collections/models/collection.py` and `sde_collections/views.py`. |
| 80 | +3. **Utility Scripts and Background Jobs**: Address the lack of tests for critical utilities such as `sde_collections/utils/github_helper.py` and `sde_collections/tasks.py`. |
| 81 | + |
| 82 | +## Recommended Actions |
| 83 | +- **Expand Unit Tests**: For critical configuration files and complex models. |
| 84 | +- **Integration Tests**: Enhance coverage for views and serializers to ensure complete application workflows. |
| 85 | +- **Continuous Integration Improvements**: Implement tests during CI processes and enforce coverage thresholds. |
| 86 | + |
| 87 | +## Conclusion |
| 88 | +This plan highlights critical testing needs and outlines a structured approach to addressing immediate testing gaps while setting a long-term foundation for continuous quality assurance. By following this plan, we aim to improve the robustness and reliability of our application systematically. |
0 commit comments