Description
Many CLI-based projects in this repository do not properly validate user input, which can cause crashes when invalid values are entered. Additionally, several modules lack automated tests, making it difficult to detect regressions and ensure reliability.
Proposed Improvements
Input Validation
- Validate all user inputs before processing.
- Handle invalid numeric inputs gracefully.
- Prevent crashes caused by
ValueError and similar exceptions.
- Display clear error messages and prompt users to retry.
- Create reusable helper functions for common validation tasks.
Testing
- Add comprehensive PyTest test cases.
- Cover normal cases, edge cases, and invalid inputs.
- Add tests for mathematical utilities, generators, and reusable helper functions.
- Aim for at least 80% code coverage.
Code Quality
- Refactor duplicated validation logic into reusable functions.
- Add type hints where appropriate.
- Improve exception handling.
- Ensure executable scripts use:
if name == "main":
main()
Acceptance Criteria
Benefits
- Improved user experience
- Reduced runtime errors
- Better maintainability
- Easier future contributions
- Increased confidence through automated testing
Description
Many CLI-based projects in this repository do not properly validate user input, which can cause crashes when invalid values are entered. Additionally, several modules lack automated tests, making it difficult to detect regressions and ensure reliability.
Proposed Improvements
Input Validation
ValueErrorand similar exceptions.Testing
Code Quality
if name == "main":
main()
Acceptance Criteria
Benefits