Design Tech Talk Series Presents: OO Design for Testability

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ค. 2024
  • Google Tech Talk
    October 6, 2009
    ABSTRACT
    Presented by Miško Hevery.
    We design our code for performance, maintenance, simplicity, extensibility and other goals, but most of us do not think about testability as a design goal, yet verifying the correctness of our code is of great importance. What does it mean to have testable code, and what kind of trade offs does one have to think about when designing for testability. Turns out that testable code is well designed code, and it has many of the characteristics we search for such as low cohesion, separation of concerns, proper encapsulation and many others.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 36

  • @bugsthecat
    @bugsthecat 5 ปีที่แล้ว +40

    Ten years later now, the talk is still applicable industry-wide. Really good talk!

  • @amiramhalperin
    @amiramhalperin 5 หลายเดือนก่อน +1

    This talk will remain applicable as long as humans will continue to code.
    I enjoyed this talk when it just been published and I'm sharing it also today when teaching others.
    Misko thanks for that. 🙌

  • @amyh1112
    @amyh1112 4 ปีที่แล้ว +4

    When I did code review and noticed that the code in the constructor is very hard to test. I requested it needs to be refactored. The engineer who submitted the pull request arguing with me saying that is the right way to have implementation in the constructor. So I googled "how to write testable code" to see how other people explain to write testable code better, and I found your blog and this video. Thank you for this awesome presentation!!

    • @context177
      @context177 2 ปีที่แล้ว

      tried to write unit test to my ctor and I'm here too:)

  • @Curelet
    @Curelet 10 ปีที่แล้ว +3

    Great talk that summarizes and brings new twists to the topics of Misko's previous 2 Google Clean Code talks "Global state and singletons" and "Don't look for things". Main ideas:
    - Where to use the new keyword
    - What should be done in the constructor
    - Use of Global state and singletons is bad for testing due to side effects
    - The use of Service Locator should be avoided
    - Dependency Injection (DI) is the solution to the Law of Demeter violations.

  • @neohubris
    @neohubris 14 ปีที่แล้ว +1

    Misko thank you very much for doing these talks. Your clean code talks has helped my work tremendously.

  • @TankaNafaka
    @TankaNafaka 4 ปีที่แล้ว +1

    I dint know how, now I know where to start. Thanks for sharing!

  • @iosbfree1854
    @iosbfree1854 2 ปีที่แล้ว

    Great talk. Great presenter. Great developer. Great ideas!
    Thank you so much for sharing this!
    ❤🧡💛💙

  • @elvedrano
    @elvedrano 10 ปีที่แล้ว +24

    (long silence) "I forgot what this example was about... Let's just skip that!"
    Priceless :D

    • @bayantsinghkang67
      @bayantsinghkang67 6 ปีที่แล้ว

      Makes me laugh even after 3 years.....

    • @blackbindy
      @blackbindy 3 ปีที่แล้ว +1

      @@bayantsinghkang67 and after another 3 years

    • @phantruong1217
      @phantruong1217 13 นาทีที่ผ่านมา

      and after another 3 years

  • @vladimirvukanac
    @vladimirvukanac 9 ปีที่แล้ว +1

    This was really helpfull! This will be a "must see" for every code related person in my company.

  • @christianb6718
    @christianb6718 12 ปีที่แล้ว

    I've seen some videos from Miško Hevery. This helped me alot moving to the right direction.

  • @sumitvyas13
    @sumitvyas13 11 ปีที่แล้ว

    Awesome... For the 20 arguments problem the solution suggested is following SRP. Single Responsibility Principle takes care of simplifying the Object graph and code simplification.

  • @skeom21
    @skeom21 14 ปีที่แล้ว +1

    Thanks...
    I believe this is very helpful tip for all developers.

  • @move1649
    @move1649 3 ปีที่แล้ว

    Watched this 1st time 10 years ago, time flies

  • @LucianoMoretti1
    @LucianoMoretti1 14 ปีที่แล้ว

    Another Great Talk- a summary of his other "Clean Code Talks".
    The one thing I still lament that is not addressed well is how to simplify DI and Testing in C++.

  • @SaiGudigundla
    @SaiGudigundla 13 ปีที่แล้ว

    Thanks for the great presentation.

  • @pereznels
    @pereznels 13 ปีที่แล้ว

    Awesome presentation!

  • @yuskamify
    @yuskamify 10 ปีที่แล้ว

    A very nice talk.. thanks.

  • @espinchi
    @espinchi 14 ปีที่แล้ว

    Great talk!

  • @lingyongwang2817
    @lingyongwang2817 7 ปีที่แล้ว

    this is great!

  • @jalalsadeghi66
    @jalalsadeghi66 8 ปีที่แล้ว

    this was very helpful

  • @vaulttech
    @vaulttech 12 ปีที่แล้ว +4

    I've searched for the other 3 talks (since this is the fourh) but I couldn't find them. Can someone please give me the link?

  • @guilhermealveslopes
    @guilhermealveslopes 3 ปีที่แล้ว

    Oh my, you can see how all these developers attending to the conference are shy as hell,
    2021, still accurate

  • @24sevenmtb
    @24sevenmtb 10 ปีที่แล้ว +1

    Great talk!
    Does anybody know where (if) the slides can be found online?

  • @DotNetNukeVS
    @DotNetNukeVS 14 ปีที่แล้ว

    You are so awesome

  • @ErickDovale
    @ErickDovale 13 ปีที่แล้ว

    Very nice talk. A bit ambiguous with the term singleton. There is the singleton pattern as described in the Gof4 book which is the one that is problematic to test and there is the single instance of a class throughout the life of the application. There is nothing wrong with the latter IMO.

  • @ericcartmansh
    @ericcartmansh 11 ปีที่แล้ว +1

    at 23:04 wouldn't it make more sense to have the unit test create the Engine instance fakeEngine with getEngine() and pass in the engine factory and the model? Or is the call to getEngine assumed to be happening in the constructor of the Engine class?

  • @2Guruda
    @2Guruda 9 ปีที่แล้ว +6

    Google Car Drives itself. May be one day Google car will create its own Engine. :) Great lecture

  • @HansVanIngelgom
    @HansVanIngelgom 14 ปีที่แล้ว

    I also saw his previous "clean code talks" (it's been a while, so it was a good opportunity to refresh it), but am I wrong or did he change his mind about null objects? iirc, before he was a proponent of using null pointers.

  • @BryonLape
    @BryonLape 5 ปีที่แล้ว +1

    The problem is the corporate mind set.

  • @uris77
    @uris77 11 ปีที่แล้ว +1

    That is not the Law of Demeter. It is about types not dots.

  • @leanJDe
    @leanJDe 10 ปีที่แล้ว

    what is a friendly?