Hello Everyone,
I have created a handy tool for running two codes against an input or stress testing them against random inputs. This can be helpful in hacking some simple problems and get possible faults, and also in finding wrong test cases for your solutions.
Link to Github Repo: Link
I know this isn't perfect so if you feel that I can improve something or add some feature then do let me know and feel free to contribute as well.
Great, thanks! Hope you get high rated! :)
You created tool by writing more than 200 lines of code for thing which you can do with few simple BASH commands? O_o
Definitely the biggest bicycle invention which I saw in the last time.
It doesn't include multithreading and stress testing. Also, I created it as a start point and was looking for possible improvements/features with help from the community.
Hmm, it IS stress testing — comparing your solution (
A.cpp
) with some kind of bruteforce (B.cpp
) on many random testcases (input.txt
).Here, by stress testing, I meant to keep testing until you find a case where the outputs do not match for both the inputs. To put it simply, generating random cases again and again until outputs mismatch. If you are using a really big file, then you may have to:
In bash:
And about multithreading: it is just useless in python because of GIL. So, actually, you don't run tests parallelly in such a way.
Indeed you're correct about multithreading and thanks for that, but I can include multiprocessing to get the desired boost. I am not saying that I invented something and i am sure you can very well create a script in bash to get the desired function, the sole purpose is to share with anyone who may find it useful. You do know, that one can learn while building that already invented bicycle.
The multithreading in this case does work, because most of the work is done in the spawned subprocesses.
True, trying to find a way to fix that as well.
i think this can be useful ! suggestion : add tle checker