In my case, sorry for the, I don't have any versioning number, so I cannot rely on, okay, this is the last version of, this is a previous one. So I may have some cases where the UI may flicker a little bit, let's say, but in the rule that I want in the UI is that at the end, after a given amount of time, I will always converge to something which is the real version.
Interesting. Cool. This is a great question. Is there any overhead or what is the overhead? Can you control this and how many iterations or permutations should you or can you or have you generated? By default, the framework will just run 100 times the assertion. The idea is not to run everything because the scope of possibilities is infinite because we are just thinking about any kind of user query, any kind of result. So basically, the framework is just saying, okay, let's try 100 of them. If it fails, it will just try to reduce and the overhead is like you run the test 100 times but you can reduce that, you can change the number of runs you want for your test if you need it. For the overhead, I will say like it's the cost to generate the value but normally, it should be rather limited because I try not to put that much complexity in the code that is doing the generation. I mean, the idea is to be as free as possible to do the generation stuff but it still has an overhead.
If the default is 100, is 100 like a good number to start with? Like does that work in a majority of cases? Yes, initially, I was a bit surprised when I started to do that. So the properties-based technique is not like related to JavaScript at all. It came from Haskell or other words and basically, I was a bit surprised that 100 runs could find something and when I gave it a try, actually with 100 runs, it's rather okay to find many bugs. If it's a very specific edge case, you will probably not fall into it in 100 runs but in that case, you have something very special to test and maybe you want to execute it more often to launch it on more tests. Yeah, sure. So 100 feels about right for many use cases. Yeah, and you will have your CI which will run it, etc. So you will be able to see. I feel like it depends is like a pretty safe answer for this one. Yeah. Yeah, yeah, yeah.
Will different runs of a test suite using random strings use different strings each, like all of the different runs? Sounds like it might be hard to reproduce failures though. That's a good question. I often get asked this one. Basically, by default, I'm saying by default, to see this as it will be changed all the time. So whenever you will run the test, you will have a new seed, so it means that new strings will be produced. And possibly from one run to another, you might have new bugs being detected. The philosophy behind it is that you don't want any bug in your application.
Comments