TheAlgorithms / TheAlgorithms/Rust
Redundant & different test cases for different algorithms solving the same problem
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 26.1k
- Forks
- 2.6k
- Avg merge
- 52m
- Merged PRs (30d)
- 1
Description
Consider e.g. the sorting algorithms: They all solve the same problem, yet each has its own test cases. This is only warranted if the tests are to test implementation details.
However, the better approach here is to write one comprehensive test suite - perhaps even using fuzzing - and testing all implementations against it. This will both increase coverage and reduce test duplication.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing test cases for the sorting algorithms and comparing which behavior they duplicate. Define a shared, comprehensive test approach, potentially including fuzzing, and verify that all implementations are covered without retaining unnecessary algorithm-specific duplication.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100