Build bigger in less time: code testing beyond the basics - Predrag Gruevski | EuroRust 2024

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 12

  • @claasdev
    @claasdev 18 днів тому +6

    I’ve heard about deterministic testing but this is the first time that I actually see what it means concretely. Thank you

    • @maf_aka
      @maf_aka 15 днів тому +1

      bro spent 14 minutes redefining unit tests with dependency mocking smh

    • @claasdev
      @claasdev 15 днів тому

      @maf_aka yes it looks very similar but I think there are small differences that have a big impact

  • @AdamChalmers
    @AdamChalmers 18 днів тому +4

    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.

  • @porglezomp7235
    @porglezomp7235 16 днів тому +2

    The insight that snapshot testing can be used to make a test suite *faster* was fascinating. I had never considered that.

  • @ammaraz619
    @ammaraz619 17 днів тому +3

    I think this was of of the most valuable talks in EuroRust this year 🙌

  • @Mawkler
    @Mawkler 7 днів тому +1

    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?

  • @polares8187
    @polares8187 17 днів тому

    Amazing talk. Would love to use this paradigm in my development

  • @Vagelis_Prokopiou
    @Vagelis_Prokopiou 18 днів тому +1

    Excellent insights into testing.
    Thanks a lot.

  • @maf_aka
    @maf_aka 15 днів тому

    why is invariant testing only done in debug mode? are we saying the assertions will always be true in prod? what/ who enforces that?

    • @pmmeurcatpics
      @pmmeurcatpics 15 днів тому +2

      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

    • @TheBigWazowski
      @TheBigWazowski 11 днів тому +3

      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