TheAlgorithms / TheAlgorithms/Rust

Redundant & different test cases for different algorithms solving the same problem

Open
#462 8 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dont-close
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.