Skip to content

Project to stress-test solutions against randomly-generated input.

License

Notifications You must be signed in to change notification settings

albexl/stress-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stress-Tester

Code examples used for the A Tale of Debugging: The Competitive Programmer Approach (Part II) article in Hashnode.

Usage

In case you want to try the solution you can follow these steps:

  1. Replace the code in ./generators/random_generator.py for the test case generator suitable for your use case.

  2. Replace the code in ./solutions/solution.py with the code that you want to test.

  3. Replace the code in ./solutions/naive.py with the naive solution for the problem you are trying to solve.

  4. Run the checker scripts:

    • Using shell: Execute the following command in the root of the project.

      ./check.sh
    • Using python: Execute the following command in the root of the project.

      python3 check.py --test-cases 100 --generator-path ./generators/random_generator.py --solution-path ./solutions/correct.py --naive-path ./solutions/naive.py --tests-path ./test_cases

      The arguments in the python are customizable. For example, the --test-cases argument can be changed to try with more or less cases. The arguments that are paths can be changed as well. Be careful when doing this, the specified paths should exist.

Next steps

List of future improvements:

  1. Make it work not only for python solutions/generators.

About

Project to stress-test solutions against randomly-generated input.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published