Unit testing in JavaScript Part 1 - Why unit testing?

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

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

  • @theresao6675
    @theresao6675 7 ปีที่แล้ว +145

    "it's completely normal to be afraid of the new things but remember that new things become less scary the more you use them" ❤

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

      3:57

  • @neooofish
    @neooofish 7 ปีที่แล้ว +218

    Love this format !
    It looks way more like a show, the new personas are a really nice asset.
    Keep on rockin'

  • @dostler001
    @dostler001 7 ปีที่แล้ว +41

    The inner dialog between feelings, benefits, and the guy in the sunglasses in this episode is hilarious and insightful. This show rocks!

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

    I've been wanting this series since I started watching! The multiple personalities is a nice touch. Thanks for all your hard work, mpj!

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

    MPJ, you are the best author of video lessons I ever see.
    Fun, short, motivated and very energetic videos.
    You are AWESOME!

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

    at 5:30, you said "even with this reduce, I am not comfortable with, because it's new". I laugh so much. It speaks my heart. Awesome, it make the show entertaining!

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

    Fantastic episode. Loved the different characters arguing out their respective positions. Great work MPJ

  • @iam13islucky
    @iam13islucky 7 ปีที่แล้ว +43

    I love the characters thrown in about reduce, super fun! :)

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

      +iam13islucky glad you liked them!

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

    FunFunFunction motivates me to write unit testing in everyday development with prior test target setup with triangulation. Unit tests provide results, which provide immediate feedback to develop codes in flow(zen) modes. More than great lectures, FunFunFunction stimulates me to love coding passionately. Awesome work. Thanks.

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

    The staging of the inner conversations in a developer is just brilliant. Helps validate the chaos often experienced. Tack! 😀

  • @mutosui
    @mutosui 7 หลายเดือนก่อน +1

    The part on how you should think about when deciding if you should break a function in smaller ones is absolutely amazing (and it's no even the main topic!)

    • @funfunfunction
      @funfunfunction  7 หลายเดือนก่อน +1

      Thanks! In a way it’s a sub topic, but in away it’s the main one for me. It’s very easy to fool yourself into thinking that you’ve modularized something if you don’t actually test it as a module

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

      ​@@funfunfunctionIt really was an amazing explanation! I've always wondered how small you can/should go with modularization, gone a bit crazy over modularization in general and the details that are more intuitive and seem obvious to some programmers but that they never truly explain to others learning (how they know to do something, when they know do it, and when to stop - when enough is enough), and this answered part it for me. This makes it very practical.

  • @puny-camera
    @puny-camera 10 หลายเดือนก่อน

    Loved this one. I liked the emphasis on feelings and the argument about the way of thinking "a rockstar programmer could keep this function on their brain" not being scalable is so true and I never thought about it. Super helpful and epiphany inducing video. Big theater kid vibes haha ❤

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

    Clever use of the pause button. So relatable. Coding drives you crazy and you've fully embraced the feeling. Maybe those voices in your head are worth reducing to a total of one in the interest of sanity. You're a one man party . . . keep up the good work.

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

    This felt less like learning and more like a fun journey...
    A fun fun journeeeey

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

    Man that "doesn't that mean that I'm dumb" bit. This is so me. Really uplifting to hear you say that man! .. and yeah a great start to understanding unit testing :)

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

    You put the fun in function 😁 Great content - informative and entertaining. Love the delivery and energy!

  • @MelaniesMemos
    @MelaniesMemos 5 ปีที่แล้ว

    Seriously you nailed it the battle on the code reviewers. The different personalities you played.

  • @ISTefrain
    @ISTefrain 5 ปีที่แล้ว

    I would like to find what is the best word to describe how excellent this video is but I think it doesn't exist. Thanks a lot, mpj!

  • @jakubrpawlowski
    @jakubrpawlowski 7 ปีที่แล้ว +36

    This episode aims at fans who didn’t see all previous episodes. Diehard followers like myself learned nothing new, although I leave a like because I’m excited for part 2 and also because I missed you mpj! Have a great week!

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

      And the multi-mpj thingy kept it fresh (? hahaha

    • @Hookahbeastface
      @Hookahbeastface 7 ปีที่แล้ว +1

      I learned about MPJ's schizophrenia

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

      no one asked

  • @Digital963
    @Digital963 5 ปีที่แล้ว

    I’m half way through the video and I am crying laughing - and learning . This is what made me so hooked on this Ch. I often wonder why you have not exploded - the quality of your content is amazing. Truly a show and not a tutorial.

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

    "Doesn't this mean that I'm dumb?" Never a more relatable sentiment in this whole career change journey... Thank you for this!

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

    You're one of the best teachers i've ever encountered in my life

  • @matheusd.rodrigues429
    @matheusd.rodrigues429 7 ปีที่แล้ว

    you're way funnier in your natural habitat, I came from DevTips and I don't intend to go anywhere until I finish watching every single video you make xD

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

    Man! I wish I didnt have to wait for the next video. Thank you so much for breaking this down like this and starting with the Why first, you've really helped me to wrap my head around it. I have so many questions after watching this video and thats a good thing!

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

    Probably one of your best episodes, love the personas - you need to bring them more into your series!

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

    Really enjoyed the dialog between all the abstracted selves. Keep that up!

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

    Watched a video first time on this channel and just love the presentation which made the concepts stick into the head with the help of creative visuals.

  • @IanEdington
    @IanEdington 7 ปีที่แล้ว +1

    I'm so excited for this episode and hopefully the series this kicks off!!!

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

    Love all your videos, but the multiple view points expressed through the wacky characters really made this video amazing!

  • @a.v.n8783
    @a.v.n8783 ปีที่แล้ว

    this is so fun to watch! i dont get sleepy learning new stuff, thank you for this awesome content

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

    Dear sir this discussion with yourself was one of the most interesting conversation i have ever heard about complexity

  • @fmkoba
    @fmkoba 4 ปีที่แล้ว

    years later to the party, but the video was genius, the discussion follows exactly the thought process we face when working on these cases

  • @david59675
    @david59675 7 ปีที่แล้ว +62

    ”even with reduce, that I’m uncomfortable with - because it’s new” 🙄😂🤣
    (Unfortunately a very realistic statement 😥)

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

      I saw .reduce, paused, googled it, came back, was still feeling that feel a bit. "AH NEW THINGS"

  • @mmsikoras
    @mmsikoras 7 ปีที่แล้ว +13

    Example with joggling is just great! MPJ you are becoming better and better performancer, really nice actor skills :)

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

    I need Part 2! I hope this is a long/in depth series because even though I know the WHY of unit testing, I've never been able to get the 'how' with javascript. I really want to get my head around TDD + javascript.

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

    Hey MPJ! I love the characters. It helps me better understand conflicting views, and how/why some decisions come about. It’s like Plato’s style for the Allegory of the Cave, applied to coding, and I love it. Thanks again for all you do.

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

    Dat cliffhanger 🤘
    This was done really well!
    Looking forward to next week 👋☺️

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

    LOOOOOOVE this new intro!!! awesome work, @mpjmwe! :D

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

    Love this episode! It was informative, addresses software by design, was very entertaining and eccentric in the best possible way. Thanks MPJ.

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

    I’ve been waiting for some good videos from you about Unit Testing! Finally :)

  • @tourk1234
    @tourk1234 7 ปีที่แล้ว +1

    MPJ, you outdone yourself :) Congratulations. Good stuff.
    I would like to add that sometimes when project is manageable size, with limited expectation of project growth and you are almost positive that you are going to develop that project only by yourself. Then unit testing makes more sense for really hard to test parts of project only. Overtesting in that particular situation is possible waste of time. Exception to that is requirement that project must work 100% of the time.

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

      Yeah, absolutely. I agree with you 100%. I actually had a segment about that, but ended up deleting it as it diluted the narrative, and I ended up focusing on the reason that applies to all devs, not just teams.

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

    I really appreciate these mini episodes, thanks for inspiring me :D

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

    I loved how the MPJMEs changed wardrobe mid show, got all confused on who was the one wearing sunglasses, funny as hell, give this guy an Emmy

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

    I was searching for "testing' in your channel and saw this video, started to search for part 2 until realized this video has just published a few hours before that.

  • @attamjotsinghkhurana4473
    @attamjotsinghkhurana4473 4 ปีที่แล้ว

    You are my favourite after devtips. Very entertaining and informative

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

    Fantastic video! Loved the characters and thinking processes going on.
    Thanks for approaching stuff with a easily digestible format for us scrubs :)

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

    This was the most enjoyable technical discussion :)
    Bravo man !

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

    Definitely you rock on teaching man! Many thanks and keep this awesome work! Peace from Brazil!

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

    The skits are hillarious, especially if you're swedish! Keep up the good work!

  • @JuliaRakitina
    @JuliaRakitina 5 ปีที่แล้ว

    Awsome hello from 2020! Searching for a great tutorial for juniors and found this! You are brilliant))

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

    Loved the idea with the different personas. Hope to see more of this format but, just an advice, it can become stressful for you. So use it with measure :)

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

    Wallaby is telling me you have already wrote your tests and they are pretty good ;-) Anyway awesome videos and refreshing to see a developer having fun with it!

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

    First time watcher, subscribed. Lets do this!

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

    love the new intro, and the hair ofc :D, i also really like the background music used.
    keep it up!!

  • @topDragon-f9t
    @topDragon-f9t 8 หลายเดือนก่อน +9

    Anyone from The Odin Project?

    • @noice1006
      @noice1006 6 หลายเดือนก่อน

      yes

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

      Yes 🥰

  • @tmstani23
    @tmstani23 7 ปีที่แล้ว +1

    I love your show! The juggling analogy was really clear and useful for understanding the problem at hand ;p

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

    Great video. Enjoy how you explain the "why" of unit testing. Can't wait for then next video. I don't do ANY unit testing, mostly because I don't work in a team environment. I can see how unit testing would be useful, but I haven't been able to justify the extra time it takes when I am working against deadlines on my own. I realize it should be done, however, I've been getting away without doing it....so far...

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

    OMG I'm only 1:14 in and I'm addicted. KEEP IT UP!! 🙌 🤹‍♂️

  • @joshuaGmartin2023
    @joshuaGmartin2023 21 วันที่ผ่านมา

    The Beakman's World of programing. Great stuff!

  • @AndriyMarkov
    @AndriyMarkov 5 ปีที่แล้ว

    Your videos are very cool and useful. You cover different points of view and that's how it happens in real life. I wish you keep going with your 'Fun Fun Function':-)

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

    SUMMARY:
    1. Unit testing is a software development technique where you divide software up into smaller isolated parts and write tests for each of those isolated parts to verify that they work as expected
    2. In order to break larger function into smaller isolated functions, you have to be able to break that function conceptually as well otherwise you are just spreading the problem into different places which increases complexity instead reducing
    ADDITIONAL INFO:
    In TDD, we write automated tests for the code before that code is written.
    In Unit testing, we write tests before or while writing ode, or after writing code

  • @KevinOsterkilde
    @KevinOsterkilde 7 ปีที่แล้ว +20

    This was fantastic!

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

    I love the quirkiness you sir earned my subscription! Keep up the good work :)

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

    Thanks for going full time! Love this stuff

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

    This episode felt like it was completely talking to me! This is exactly what happens... This is too simple to unit test, ain't nobody got time for that.... Then over time the code becomes super complex and then it's too hard or too much time to go back and write unit tests... Or maybe I'm looking at it wrong? Would love for you to address this in the next episode.... What if you are in deep, how do you crawl yourself back out with unit tests?

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

    Such a good episode. Deserves more views.

  • @jsimp8540
    @jsimp8540 4 ปีที่แล้ว

    This is the best thing I've ever seen!

  • @hotmandead1
    @hotmandead1 5 ปีที่แล้ว

    Great video and love the intro lol kaffe drop was hilarious !

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

    This channel will have 1M subscribers soon, guaranteed.

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

    One of the best channels in TH-cam

  • @bigbonker9864
    @bigbonker9864 7 ปีที่แล้ว +7

    Good episode. Loved the new format.
    The only problem is that the music was way too loud.

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

    Year: 2022. Still valid, still funny, still valuable. Thank You for lesson.

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

    I have been coding in hs for about a month, i come from a c++ background, i use map, filter and forEach pretty commonly reduce is not one i use much. I hope i fix that great channel bud keep it up!

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

    Loving it - bring on the unit testing!

  • @ryangill9518
    @ryangill9518 7 ปีที่แล้ว +1

    This gave me a serious case of deja vu. Good stuff.

  • @michaelfaelan5958
    @michaelfaelan5958 4 ปีที่แล้ว

    This guy has value. How am I so late to the show?

  • @RedEyedJedi
    @RedEyedJedi 5 ปีที่แล้ว

    I absolutely love this show! It's entertaining and informative.

  • @PeterGfader
    @PeterGfader 5 ปีที่แล้ว

    I like the format of the video and the fun moments.
    I have some problems with the content though:
    - Could you explain the "Why of Javascript Unit Testing" without an example?
    - i would not calculate something like "orderTotal" in the client. That's a server responsibility for me.
    - You write production code and later you think about how to test it
    - The special cases in minute 7:30 should be driven by tests
    - Minute 10 -> "I executed this in my head" --> This is why we do Test First ;)
    - Is there only 1 answer to the "why"?

  • @MaxPicAxe
    @MaxPicAxe 5 ปีที่แล้ว

    Wow great video. I miss these types of videos

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

    Great work. This format is awesome

  • @SimPwear84
    @SimPwear84 5 ปีที่แล้ว

    Very insightful! Thanx so much MJ

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

    Well done! I like your different characters!

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

    You hit every thought I have when coding!

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

    I freaking love this episode.
    Hilarious! 😀

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

    A prime example of why the two dudes talking is a common format. Using two dudes requires less hats. On the other hand, it was neat once accepted that you were sharing your inner monolog.

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

    You support putting dragon's in cages ! You monster !
    Fantastic episode BTW !

  • @nudigitalvibe
    @nudigitalvibe 4 ปีที่แล้ว

    excellent thoughts on how you would break up a function; you would need to be able to break it up conceptually

  • @sreid70
    @sreid70 5 ปีที่แล้ว

    Great introduction into unit testing

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

    Wow MPJ!!! Best one yet!

  • @ADiLHaddaoui
    @ADiLHaddaoui 7 ปีที่แล้ว +1

    Ouch Man !! you are a legend (y) you deserve a 100m subscribers !!

  • @wxmachinegun
    @wxmachinegun 10 ชั่วโมงที่ผ่านมา

    After inventing the reverse microwave, Brandon DiCamillo moves to Denmark to begin a new life as a content creator.

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

    You are a fantastic teacher. Thank you.

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

    Excellent video man! Thanks

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

    Hah, I love the personas, I paused right before they came up like "what is this reduce thing... ah well, maybe he'll clarify but this is new..." and then Feelings said what I felt. To the functional programming videos I go!

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

    woah you make testing fun. subscribing.

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

    OMG you are so fucking hilarious and educational to watch. I clicked that subscribe button mid way through the video.

  • @stacydavis9979
    @stacydavis9979 6 ปีที่แล้ว +1

    Amazing, amazing videos! So glad you address these topics.
    I just watched the second video, and I'm curious: Is writing in a TDD behavior ultimately mainly for writing API, or is it also just general good habit for everyday coding?

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

    Can't wait for the next Monday. ^^

  • @xmelsky
    @xmelsky 4 ปีที่แล้ว

    Yeah. incredibly useful as always.

  • @mostafaelgayar
    @mostafaelgayar 7 ปีที่แล้ว +7

    When you wore the sunglasses you looked like Robert Downey Jr. for a moment :D

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

      I thought he looked like Tony Start within the first few seconds of watching the video...