🚀 Does TDD Really Lead to Good Design? (Sandro Mancuso)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

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

  • @RmaxTwice
    @RmaxTwice 2 ปีที่แล้ว +5

    What an unbelievable amount of raw concentrated developer experience directly distilled into our brains. Bravo

  • @TheOceanLoader
    @TheOceanLoader 2 ปีที่แล้ว +3

    This guy wrote a book called Software Craftsmanship. It's one of my favourite books. I remember working with him at Valtech many years ago.

  • @RoamingAdhocrat
    @RoamingAdhocrat 2 ปีที่แล้ว +3

    Just to say I really appreciate this camera setup - the fixed view showing the whiteboard clearly, and the second view of the presenter.

    • @edgeeffect
      @edgeeffect 9 หลายเดือนก่อน

      It'd be better if they could improve the camera tracking. .... and the grading.... and maybe give it a miss when there's nothing to see on the whiteboard - it's quite "seasick" at that point.

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

    I just want to add another commentary that this talk is absolutely golden. It teaches a LOT MORE than you'll find in pretty much any other TDD talk. Prove me wrong please, and link me another talk of the same caliber.

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

      Check out "Improving your Test Driven Development in 45 minutes - Jakub Nabrdalik" . I found it good too.
      th-cam.com/video/2vEoL3Irgiw/w-d-xo.html

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

      @@kevinfleischer2049 Thank you, I'm curious to see how he used C4 model!

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

      Check out this one : vimeo.com/68375232. best ever

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

      I agree. I could have listened to this guy for much longer. But nice bait, asking for similar quality material ;)

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

      th-cam.com/video/EZ05e7EMOLM/w-d-xo.html here's another TDD talk of a very high caliber. Enjoy :)

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

    Finally a talk with an answer to the question where to use mocks and how to choose your units.

  • @detaaditya6237
    @detaaditya6237 3 ปีที่แล้ว +21

    Finally a clear image of how TDD is applied in real world problems. Thanks man, that was a great explanation!

  • @murates
    @murates 8 วันที่ผ่านมา

    Absolutely great talk! First time I see someone that can go into such great detail and address the real issues as opposed to just giving some basic principles without considering the implications in a real world scenarios

  • @shashanksharma900
    @shashanksharma900 2 ปีที่แล้ว +1

    pointed out the exact point of Concern
    rather than beating the bush
    Felt very Clear and Empowered in the end
    Thanks Again Loved it

  • @ruixue6955
    @ruixue6955 3 หลายเดือนก่อน

    6:03 there are different types of TDD
    6:07 classist by Kent Beck
    6:16 outside-in
    7:07 *emergent design*
    7:52 4 rules of simple design
    7:59 pass all the tests, reveal intention, no duplication, fewer elements
    10:14 just-in-time design
    12:04 *classist* approach
    14:36 challenging problem
    15:34 mock is rarely used in classist approach
    15:47 beauty of this type of TDD: no upfront design
    17:12 cases when there is very complex logic
    17:46
    18:02 feature 2
    19:08
    21:58 another problem when unit under tests is becominh very big
    23:58 how to define the size of a unit
    24:57

  • @eduardocosta9078
    @eduardocosta9078 5 ปีที่แล้ว +22

    Amazing talk in the classic old school style, a white board, a pen and the ideas bubbling up in the mind! Congrats.

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

    Refactor is not only for the code but for the test as you describe in 20.45, whenever this happens we isolate C separately and its behavior separately. To fill the space we just use test double instead of mocks. No matter we do test double with pure class or mocks, It is crucial to ensure the behavior of these are consistent and matches with the original class / function.
    I have seen multiple code bases where the mocks for the same behaviour are spread across in multiple places, and then it gets divergent from original class. In case of another test double we add one more test for the test-double to ensure that is always up to date.
    Another quality of code is changing the code without affecting the behavior should not fail the test.
    Mockists leads you to assert Called Once, called Twice etc. which becomes a barrier in refactoring.
    Lesson: Use Mocks more carefully, prefer classists, Refactor your tests as well, not only the code ..:)

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

    Excellent talk! He practically explained what I've been using myself for the past 25 years when developing systems, always starting from a test, making the design decisions, and refactoring until requirements and domain constraints are met. My favorite part of this talk is when he briefly spoke about optimizing for the future and deciding what the inflection point should be at the current stage of the system evolution. Many times, this is a hard decision that needs to be based on a lot of business information items involving time constraints, product life-cycle expectations, future scalability and expandability, minimum initial functionality requirements, and so on, just to begin with. Many times it feels like trying to divine the future. I generally don't do the failing test part, but I do insist on strict adherence to enforcement of preconditions, postconditions, invariants, S.O.L.I.D, and this has led to very stable and scalable systems.

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

      25 years. That's a long time. :D does it finally get easier after that long. Congratz man.

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

      @@cesar_zapata When I asked this same question to one of my professors back at university, he smiled and said: "I am a student of computer science, and learning does not have a visible horizon". This answer left an impression on me.

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

      @@dimitriostsobanopoulos7 that's brilliant. It totally makes sense.

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

    That is a mind blowing actually. One of the best talks I have seen in 2021.

  • @gzoechi
    @gzoechi 10 หลายเดือนก่อน

    For me the biggest advantage is that wtiting tests pushes me into the view of the user (caller) of the code. This helps to get it right the first time.

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

    Very good talk. Some points I would like to come back:
    1. I don't like when everybody like to speak about the Single Responsibility Principle. Speaking about cohesion and coupling is enough, and is self explanatory. What does the SRP is claiming that "one" reason to change should be only allowed, which is totally arbitrary and doesn't make sense because this decision depends on the context. The SRP is a useless abstraction hiding important details from the concepts coupling / cohesion. It's confusing, especially for beginners.
    2. Mocking as a design decision is good. I think however that anything external you call, you should call it in its own method / function. Then, the result should be dispatched. If there is absolutely no logic in this method, there is no need to test it, so there is no need to mock these external calls.
    3. Finally, I like TDD, but I never write the failing test. I know I will test what I'm doing, and I test it as the first smallest iteration of my solution. What's missing from TDD too is the "thinking" part between green and refactor. We should stop at that point, ask ourselves if the direction we take is faithful from the design we decided earlier on, fix our assumptions and continue.

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

      @@milfex-lostex3984 As soon as someone says "always" or "must" or similar statements I disagree on principle. All of those things are tools to help us write better code, but we should also know when to apply them and when not to.

  • @youssefmourchid9149
    @youssefmourchid9149 2 ปีที่แล้ว +1

    thank you Sandro for demystifying this subject, it's a pragmatic way to practice TDD, brilliant

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

    This talk is a must-watch for all devs! Thank you!

  • @hartmannsson
    @hartmannsson 2 ปีที่แล้ว +3

    Two more hours of this would’ve been great!

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

    Three years ago, still GREAT talk! Thanks a lot.

  • @chauchau0825
    @chauchau0825 4 หลายเดือนก่อน

    I am glad he spent entire talk demonstrating TDD does not lead to good design. Good Design Decision does.

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

    It would have been nice if you only had one camera. So it could take up the whole screen and be easier to see, and then do a split screen if he moved to like a podium... Just a suggestion, I'm also watching on my phone tho... But great vid.

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

    optimal, curious though of what uncovered things were on those cards, perhaps next time stretch the presentation duration if neccesary, give it a min and max limit instead of a fixed one , change presentation strategy if surpassed min limit (ex. accelerate, skip eamples.....just to cover those notions)

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

    I love TDD but this idea that TDD makes the application design itself never worked for me, all it did was leave me with a bunch of very stable methods and no idea how to best put them together. I had a lot more success by first planning the entities, then writing a round of pseudocode and only then using TDD to write the individual methods once I understand what the methods are. That pseudocode stage is where a lot of those decisions end up being made, it's where I find most redundancies and logic errors.

    • @pixelslate9979
      @pixelslate9979 2 ปีที่แล้ว +1

      Instead of using pseudocode you can use mocks to evolve your design.

  • @aalbero
    @aalbero ปีที่แล้ว

    The second half of this video is simply brilliant

  • @lzszl
    @lzszl 2 ปีที่แล้ว +2

    Love the Talks, the music at the end needs the gain turned down, blew out my headphones

  • @jayoolong279
    @jayoolong279 5 หลายเดือนก่อน

    Such a good talk, I am sad that there wasn't enough time!!

  • @jorgeolive9605
    @jorgeolive9605 3 ปีที่แล้ว +6

    43:00 - He incidentally is jeopardizing the whole classicist school cargo cult. I absolutely agree that TDD won't give you a perfect architecture as some suggest - or that it will naturally move your system to industry proven architectectures for the matter - and you DO need to do some design upfront unless you want to spend an eternity rewriting and refactoring. Classicist might be good for StringCalculators and BankAccounts, but complex systems with lots of I/O dependecies? Yet to find a reasonable example on that style.

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

      I'm no expert on TDD but Bob Martin and Kent Beck certainly advocate lots of use of interfaces to allow for testing of single methods without dependencies like databases. It that mocking?

  • @F2H16
    @F2H16 ปีที่แล้ว

    Incredible, it's all raw experience that has been put into this talk. Hats off 👍👍👌👌

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

    This talk is divine as it solves the problems which bugs almost everyone. Should you evolve design through TDD or you design first and complement it with TDD to evolve it further? Is evolutionary design sufficient or even possible without having any up front design? Sometimes when you are already deep dived in the code, it becomes difficult to look at holistic view. Moving bottom-up (TDD to design) is not that easy and always put a question mark in front of me. Things over here make a lot of sense. Thanks.

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

    Nice talk, a whiteboard and a pen seem to be even better than slides. I wish I would have watched this video when I started to use TDD. I reached the same conclusions the hard way in real projects when I started to encounter many problems, but I have never thought about the strategies I follow in the same way he did in the video. Only after two years of consistently adopting the TDD that I finally started to see clean and good designs and very simple and understandable tests, even for very complex features, and definitely not through just the pure classicist way. Also, I might say, many of the things he says about the second TDD approach, the outside-in I think he calls, result from Kent Beck's book, even if not that much explicit.

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

    I can't see how TDD is related with the design, TDD is related with the generated code AFTER the Domain Driven Design is finished. It's impossible to capture the Domain with TDD.

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

      Interesting. Can you please explain in detail?

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

      @@NarendraPathai I think what he meant is - domain driven design should be done before writing any code - you go, talk to your domain expert and decide what entities, events etc you have, then you can code it in TDD manner and i agree with it. DDD is about how you design your product, how it's working etc, TDD is the clean way to implement what you designed.
      You can as well do DDD on on paper without any line of code.

  • @HenrikVendelbo
    @HenrikVendelbo 2 ปีที่แล้ว +1

    It does! if you consider verification to be your only quality to optimise for.

  • @juliakirshina4244
    @juliakirshina4244 3 ปีที่แล้ว +2

    Sandro is my hero )

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

    Awesome talk.
    I wanted to add that one can avoid the problem of domain concepts mixing up together by using the Open Closed principle a bit more fiercely. So that in the example Sandro gave, the class "C" would not be modified and get bigger, it would instead be passed another class as some sort of "strategy" in its constructor, having the one used by the class "A" by default and the one used by class "D" as a new one. Those strategies should obviously be specific to their types of consumer.

  • @victorserranobargues
    @victorserranobargues 8 หลายเดือนก่อน

    Amazing I have learned many new things

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

    To be fair, XP has TDD, yes, but it also has architectural Spikes.

  • @davidtakac4088
    @davidtakac4088 ปีที่แล้ว

    Incredible talk.

  • @ДмитрийК-н7и
    @ДмитрийК-н7и 3 ปีที่แล้ว +1

    interesting code, nice work with white board

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

    Superb talk...no words

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

    I've learned a lot from you Sandro

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

    At 20 mins if you are having problems like that then it's because you are not following SRP. TDD is dependent on implementing SOLID.

  • @FlaviusAspra
    @FlaviusAspra 2 ปีที่แล้ว +2

    TDD helps newbies not make great mistakes, but it also slows down great teams from making great designs.

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

    Sandro is so awesome

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

    Perfect!. Thanks

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

    You can talk forever and I can listen forever :)

  • @elyesbenfarhat859
    @elyesbenfarhat859 5 ปีที่แล้ว +2

    fantastic talk!

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

    This was great!

  • @Tony-dp1rl
    @Tony-dp1rl ปีที่แล้ว +1

    Not a lot of evidence here that TDD leads to good design. Interesting talk all the same, even if it is opinion.

  • @Pablo_IF
    @Pablo_IF 4 หลายเดือนก่อน

    For God's sake! Let this man speak as much as he wants to!!!

  • @LittleSingerVivanshrivastava
    @LittleSingerVivanshrivastava ปีที่แล้ว

    Complete

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

    I've seen TDD work very well for hello world. I've never seen it work for a real oroject.

    • @gzoechi
      @gzoechi 10 หลายเดือนก่อน +2

      It works perfect for algorithms or other rather complicated logic. It works less for rather boring code where just framework parts are wired up on backend or frontend. There tests can't add much value relative to the effort.
      TDD also works great for creating good APIs where the tests are the first user of the API.
      With TDD it's usually like with Agile. Most do it completely wrong and then complain that it doesn't work.

    • @donwald3436
      @donwald3436 10 หลายเดือนก่อน

      @@gzoechi Yea in the real world that's maybe 5% of the code base the rest is all glue and business rules.

    • @gzoechi
      @gzoechi 10 หลายเดือนก่อน +1

      @@donwald3436 That really depends on what projects you work on. You are right. The glue code is often better tested using integration tests.