Really great talk, I've already put it to use and built deterministic simulation tests for my project. OK the deterministic part is a bit aspirational. But it's definitely helped a lot.
This whole talk was very interesting. I would love to see a deep dive into deterministic simulation testing with a more concrete but also simple example, but I can't find any good resource online. I get the general idea, but I'm a little confused on the specifics. How do I go from a random seed to a test case for my app? Should I write specific tests for specific user input myself, or is it more like fuzzing with random input? If it's the former, what's a good technique for creating a specific test case? Do I turn my simulator into a giant builder pattern?
The way I understood it: Say you're developing something against a library offering this binary search function. For it to work correctly, your code should uphold the invariant required by the function, i.e. that your input array is sorted. If your code somehow passes an unsorted array into the function, it's your code that is incorrect, i.e. buggy. Which is exactly when you need to get this error - during the development and debugging of your program. Then you resolve the bug (most obviously by sorting the array beforehand), and your now-production code is correct. And since it is correct, the assertion is no longer needed
I think his example focused more on the cases where you want to assert something but you don’t want the performance hit in production, but if you can afford the asserts in production it’s better to keep them
I’ve heard about deterministic testing but this is the first time that I actually see what it means concretely. Thank you
bro spent 14 minutes redefining unit tests with dependency mocking smh
@maf_aka yes it looks very similar but I think there are small differences that have a big impact
Really great talk, I've already put it to use and built deterministic simulation tests for my project. OK the deterministic part is a bit aspirational. But it's definitely helped a lot.
The insight that snapshot testing can be used to make a test suite *faster* was fascinating. I had never considered that.
I think this was of of the most valuable talks in EuroRust this year 🙌
This whole talk was very interesting. I would love to see a deep dive into deterministic simulation testing with a more concrete but also simple example, but I can't find any good resource online. I get the general idea, but I'm a little confused on the specifics. How do I go from a random seed to a test case for my app? Should I write specific tests for specific user input myself, or is it more like fuzzing with random input? If it's the former, what's a good technique for creating a specific test case? Do I turn my simulator into a giant builder pattern?
Amazing talk. Would love to use this paradigm in my development
Excellent insights into testing.
Thanks a lot.
why is invariant testing only done in debug mode? are we saying the assertions will always be true in prod? what/ who enforces that?
The way I understood it:
Say you're developing something against a library offering this binary search function. For it to work correctly, your code should uphold the invariant required by the function, i.e. that your input array is sorted. If your code somehow passes an unsorted array into the function, it's your code that is incorrect, i.e. buggy. Which is exactly when you need to get this error - during the development and debugging of your program. Then you resolve the bug (most obviously by sorting the array beforehand), and your now-production code is correct. And since it is correct, the assertion is no longer needed
I think his example focused more on the cases where you want to assert something but you don’t want the performance hit in production, but if you can afford the asserts in production it’s better to keep them