Блог пользователя NeroZein

Автор NeroZein, история, 4 года назад, По-английски

Since our TST is near (25 / 4), I was thinking about a way to stress test my code on windows without having to write a messy code or a 100 lines script, is this possible in some way ?

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
4 года назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Hi!

First of all, good luck on the TST!

Now, I can only tell you how I usually do stress testing, which I don't think it's particularly messy. I usually have two functions, the bruteforce and the buggy solution, to which you pass the input as parameters. I don't think it can get much cleaner than this without scripts.

All you have to do is generate the input in main and pass it to the functions, until you find some input for which the answers are different.

I don't know if this is what you wanted to know, feel free to ask if not. Also, I can't find an example right now but if you're really interested I can try to look more in depth.

»
4 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Check this blog

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have a .bat file that does it for me

Spoiler

and i run it from cmd window

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You can use Codepal for stress test.

»
4 года назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

If you don't want to write code, you're gonna need to use a tool, which is unallowed. Just write code on your own. Also I remember Coach Geo told me that we're not going to use our computers. Not sure though.

»
4 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I think this bash script might be what you are looking for (easy and clean):

for((i = 1; ; ++i)); do echo $i ./gen $i > int diff -w <(./a < int) <(./brute < int) || break done