Structure and Interpretation of Test Cases • Kevlin Henney • GOTO 2022

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 45

  • @user-fe6vr1nu9r
    @user-fe6vr1nu9r 2 года назад +7

    The part of the talk on test naming was very instructive, thanks

  • @JeremyAndersonBoise
    @JeremyAndersonBoise 2 года назад +18

    This is the most concise version of this talk, and it contains lessons that may take multiple viewings to sink in. I loved it.

  • @StormB87
    @StormB87 2 года назад +8

    Kevlin took just a simple idea that it code is your documentation, and crafted just a spectacular speech! I enjoyed it

  • @hanif72muhammad
    @hanif72muhammad 2 месяца назад +1

    awesome talk, really wakes me up

  • @CJE-Software
    @CJE-Software 2 года назад +6

    Love This! This man is brilliant 👏 thank you for offering this to the community for free. OG programmers take scope and scale to a whole different level, it's enlightening.

  • @vibhanshubiswas8729
    @vibhanshubiswas8729 Год назад +2

    are all the talks this funny!! oh boy I would love to meet this person. or "Should" meet the person! :D

  • @radekBednarik
    @radekBednarik 2 года назад +2

    As a TAE, I like this very much ❤️

  • @peretch
    @peretch 2 года назад +3

    Thank you! Very interesting.

  • @sixbutton9
    @sixbutton9 21 день назад

    4 wasn't a leap year because they were not tracking leap years until 45 and then it was only the four year interval.

  • @adrianperez8695
    @adrianperez8695 2 года назад +2

    Parametrization in pytest is great for good descriptive test names.

  • @Yupppi
    @Yupppi 9 месяцев назад

    "You've always been breathing air"
    "I knew that..."
    "You've always been breathing argon, neon, methane, krypton"
    "????"

  • @RoamingAdhocrat
    @RoamingAdhocrat Год назад +2

    for some reason I'd believed it was a hard requirement to use `test_` at the start of test names, or something you could painstakingly configure around. But no - just needs to be in a _module_ named "test_*.py" or "*_test.py" for pytest , and xUnit uses the `[Test]` attribute obviously...

  • @STFU665
    @STFU665 Год назад

    As for the leap year thing. This can be solved very easily in the lowest set of chars, so to speak binary. You just need a start binary indicator and then resolve where the next one is + 100 (You only have to check if the starting point is a binary 100 in the first 3 places, if not, the next after adding binary 100 will never be a leap year). As an example we have year binary 0 then the next binary leap would be 100. If we got for example year 2000 as binary, which gives us 11111010000, by binary addition we get 11111010100. This even works for all the years before 1970 (see Microsoft SQL Server limitatons on dates). I actually don't know who began all the calculations in decimal systems for these types...
    Tests are nevertheless very usefull, you can easily find flaws or certain conventions of a language by tests, to check if they work as you expected or a update on the compiler changed your functions in the asserted results.
    Update: Just checked my statement again: it's a leap year if in binary the 3rd bit from the last significant bit is either 0 or 1 and the last 2 lower significant bits are not 1.

  • @w4750n
    @w4750n 2 года назад +4

    I know it's random, but I love the t-shirt :)

  • @brynyard
    @brynyard Год назад +2

    What, you have a Silver Bullet in another talk, then why am I listening to this one then?!

  • @RoamingAdhocrat
    @RoamingAdhocrat Год назад +1

    31:00 Is the year 4 CE a leap year, though? What does it mean to say "there was a Feb 29th in 4 CE even though no-one was using that calendar for centuries after"

  • @licg9999
    @licg9999 2 года назад +2

    The venn diagram looks really inspiring. Would someone just elaborate a bit more about the simple cases?

    • @bkkothari2255
      @bkkothari2255 Год назад +1

      simple cases meaning define the area / range you want to cover to test
      boundary cases meaning edge case extreme limit/lower limit of your range
      common cases meaning generally you have conditional statements results which should be passed
      error cases meaning your test case condition should produce the errors with given wrong inputs
      Hope this helps. Let me know if you have a different understanding

  • @logiciananimal
    @logiciananimal 2 года назад +4

    If algorithms + data structures = programs and also structure + interpretation = programs then algorithms + data structures = structure + interpretation . HmmMM!

    • @1Cry1987
      @1Cry1987 2 года назад +1

      Thereso
      algorighms = structure + interpretation - data structures
      data structures = structure + interpretation - algorithms
      structure = algorithms + data structures - interpretation
      interpretation = algorithms + data structures - structure

  • @BryonLape
    @BryonLape Год назад

    You have to paint the turtles all the way down.

  • @gr8john6
    @gr8john6 Год назад

    Class or No Class that is the question...

  • @noraosmena4997
    @noraosmena4997 Год назад

    what happened

  • @pollathajeeva23
    @pollathajeeva23 Год назад

    The key takeaway from this video is, "You must write the Test Cases to utilize 100% of the method with all the possible cases".

  • @BuffNerdInCa
    @BuffNerdInCa Год назад +2

    "We only have 90 minutes. " Unfortunately, those are spent more trying to entertain than inform. Much of this could be paired down into a far more concise presentation.

  • @sergebureau2225
    @sergebureau2225 2 года назад +3

    I am sorry, but I fail to see the value of Unit testing ! It was invented to support the stupid dynamic languages like Python

    • @redhotbits
      @redhotbits 2 года назад

      there is mostly no value in unit testing

    • @pepijnkrijnsen4
      @pepijnkrijnsen4 Год назад +9

      The idea of unit tests (if not necessarily test-first) has been around since the '70s. Kent Beck wrote the SUnit framework for unit testing Smalltalk code in 1989, the year Python 1 was released. JUnit and other xUnit frameworks were developed and widely used in the '90s before Python 2 was released in 2000. Claiming that unit testing was invented to support dynamic languages like Python is nonsense.

    • @KristoffelPirard
      @KristoffelPirard Год назад +1

      Not a very constructive way to formulate that you don't see value in dynamically typed languages.
      Just use the right tool for the job.
      If that's Haskell for you, great - you get lots of bugs detected for you by the compiler. If it's Lua, great: great flexibility with a small footprint - use automatic testing. If it's C: great, use a team of testers to find your bugs. The list goes on. Choose wisely, away with the disdain.

    • @sergebureau2225
      @sergebureau2225 Год назад

      @@KristoffelPirard I prefer a few tools for all the jobs. So many languages are to be destroyed, they give bad habits and are bug generators. That is what you recommend ?

    • @JohnnyAdroit
      @JohnnyAdroit Год назад +11

      What does the language have to do with the value of testing? Code that compiles cleanly can still do the wrong thing. bool is_leap_year(int year) { return year % 4 == 0; } is type-safe, cleanly compiles, and runs without error, and yet it does the wrong thing. Without specifically testing the behavior of the code, one cannot know whether the implementation of an algorithm is correct.Testing happens in the problem domain, not the source code.