dv-rastogi / Stress-Test

A stress-testing util to test optimized solutions against brute solutions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STRESS TEST

A stress testing script in order to test your solutions against brute solutions.

What is stress testing?

I shall speak here in reference with Competitve Programming.

For optimization problems sometimes your optimized code tends to fail on corner cases which are rather hard to figure out leading to a series of WA/TLE verdicts.

To overcome such annoying issues of brainstorming the aforementioned corner cases yourself, the naive idea of stress testing comes into play.

For the very same problem, you quickly code out a brute solution and hopefully with the help of the script and a random case generator (User parameter), you compare your output against the brute output (User parameter) and hope for a fail verdict and voilà, you get the test case your code was failing on!

Please refer user.py for modelling required user parameters!

Preview

OK verdicts

Fail verdicts

How to use

  • Set your configuration in user.py.
    • This includes configuration parameters such as logs, number of test cases, etc.
    • Create your gen_case function.
    • Create your checker function.
  • Code an optimized solution for the problem. Code it in sols/main.cpp.
  • Code a brute solution for the problem. Code it in sols/brute.cpp.
  • Run make stress & wait to hopefully retrieve a corner case, lol.
Currently supported on Linux/Mac

All contributions are welcomed! ✋

About

A stress-testing util to test optimized solutions against brute solutions.

License:MIT License


Languages

Language:Python 87.7%Language:C++ 6.7%Language:Makefile 5.7%