No video

Unit testing in JavaScript Part 1 - Why unit testing?

  Рет қаралды 161,137

Fun Fun Function

Fun Fun Function

6 жыл бұрын

Today, we are going to start exploring unit testing in JavaScript.
I think of Unit testing as a software development technique where you break your software up into small, isolated units and write automated tests that ensure that each unit works as expected.
My main motivation for doing unit testing is to keep complexity from overwhelming me. And that is what we're going to explore in this first video - we're going to look at how a new piece of code always starts out simple but very quickly gets too much to keep all in our heads.
🔗 Discuss this video on the Fun Fun Forum
www.funfunforum.com/t/unit-te...
🔗 Code snippets from the episode
gist.github.com/mpj/c53f72984...
🔗 Reduce video
• Reduce basics - Part 3...
💛 Follow on Twitch and support by becoming a Subscriber
We record the show live Mondays 7 AM PT
/ funfunfunction
💛 Fun Fun Forum
Private discussion forum with other viewers in between shows. www.funfunforum.com. Available to patron members, become one at / funfunfunction
💛 mpj on Twitter
/ mpjme
💛 Wallaby (Show sponsor)
Wallaby.js runs your JavaScript tests immediately as you type and displays execution results in your code editor. It is insanely fast, because it only executes tests affected by your code changes and runs tests in parallel. Let them know you came from us by using this link:
wallaby.funfunfunction.com
💛 CircleCI (Show sponsor)
Robust and sleek Docker-based Continuous Integration as a service. I used CircleCI prior to them becoming a sponsor and I love that their free tier is powerful enough for small personal projects, even if they are private. Use this link when you sign up to let them know you came from here:
circleci.funfunfunction.com
💛 Quokka (Show sponsor)
Wonder how MPJ evaluates JavaScript inline his editor. Quokka is the answer - use this link when you buy to let them know you came from here:
quokka.funfunfunction.com
💛 FUN FUN FUNCTION
Since 2015, Fun Fun Function (FFF) is one of the longest running weekly KZbin shows on programming 🏅 thanks to its consistency and quality reaching 200,000+ developers.
🤦‍♂️ The Failing Together concept is what makes FFF unique. Most coding content out there focus on step-by-step tutorials. We think tutorials are too far removed from what everyday development is like. Instead, FFF has created a completely new learning environment where we grow from failure, by solving problems while intensively interacting with a live audience.
Tutorials try to solve a problem. Failing Together makes you grow as a developer and coworker.
📹 Each show is recorded live on Twitch in a 2-hour livestream on Mondays. The host, assisted by the audience, is tasked to complete a programming challenge by an expert guest. Like in the real world, we often fail, and learn from it. This, of course, reflects what the audience identifies with, and is one of the most praised aspects of the show.
⏯ On Fridays, an edited version of the show is adapted for and published on KZbin.
Content Topics revolve around: JavaScript, Functional Programming, Software Architecture, Quality Processes, Developer Career and Health, Team Collaboration, Software Development, Project Management

Пікірлер: 360
@theresao6675
@theresao6675 6 жыл бұрын
"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 2 жыл бұрын
3:57
@neooofish
@neooofish 6 жыл бұрын
Love this format ! It looks way more like a show, the new personas are a really nice asset. Keep on rockin'
@funfunfunction
@funfunfunction 6 жыл бұрын
glad you like them!
@david59675
@david59675 6 жыл бұрын
”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"
@dostler001
@dostler001 6 жыл бұрын
The inner dialog between feelings, benefits, and the guy in the sunglasses in this episode is hilarious and insightful. This show rocks!
@Powerslacker
@Powerslacker 6 жыл бұрын
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 жыл бұрын
MPJ, you are the best author of video lessons I ever see. Fun, short, motivated and very energetic videos. You are AWESOME!
@bryanjhickey
@bryanjhickey 6 жыл бұрын
Fantastic episode. Loved the different characters arguing out their respective positions. Great work MPJ
@iam13islucky
@iam13islucky 6 жыл бұрын
I love the characters thrown in about reduce, super fun! :)
@funfunfunction
@funfunfunction 6 жыл бұрын
+iam13islucky glad you liked them!
@minademian
@minademian 6 жыл бұрын
The staging of the inner conversations in a developer is just brilliant. Helps validate the chaos often experienced. Tack! 😀
@akasharojee8569
@akasharojee8569 3 жыл бұрын
You put the fun in function 😁 Great content - informative and entertaining. Love the delivery and energy!
@Francisco-ph4bp
@Francisco-ph4bp 4 ай бұрын
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 ❤
@KimHogeling
@KimHogeling 6 жыл бұрын
Dat cliffhanger 🤘 This was done really well! Looking forward to next week 👋☺️
@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.
@amgdeg4897
@amgdeg4897 Жыл бұрын
This felt less like learning and more like a fun journey... A fun fun journeeeey
@doubledoorsd4
@doubledoorsd4 6 жыл бұрын
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 :)
@craftonrobert5236
@craftonrobert5236 6 жыл бұрын
Probably one of your best episodes, love the personas - you need to bring them more into your series!
@pdowner1
@pdowner1 6 жыл бұрын
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!
@mutosui
@mutosui Ай бұрын
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 Ай бұрын
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
@IanEdington
@IanEdington 6 жыл бұрын
I'm so excited for this episode and hopefully the series this kicks off!!!
@singhbaljeet_
@singhbaljeet_ 5 жыл бұрын
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.
@ingyukoh
@ingyukoh Жыл бұрын
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.
@kevinb1594
@kevinb1594 6 жыл бұрын
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.
@nicholasnewell3358
@nicholasnewell3358 6 жыл бұрын
Fantastic video! Loved the characters and thinking processes going on. Thanks for approaching stuff with a easily digestible format for us scrubs :)
@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 2 жыл бұрын
"Doesn't this mean that I'm dumb?" Never a more relatable sentiment in this whole career change journey... Thank you for this!
@a.v.n8783
@a.v.n8783 9 ай бұрын
this is so fun to watch! i dont get sleepy learning new stuff, thank you for this awesome content
@k12i
@k12i 6 жыл бұрын
I really appreciate these mini episodes, thanks for inspiring me :D
@MelaniesMemos
@MelaniesMemos 5 жыл бұрын
Seriously you nailed it the battle on the code reviewers. The different personalities you played.
@jakubrpawlowski
@jakubrpawlowski 6 жыл бұрын
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 6 жыл бұрын
And the multi-mpj thingy kept it fresh (? hahaha
@Hookahbeastface
@Hookahbeastface 6 жыл бұрын
I learned about MPJ's schizophrenia
@socrates6511
@socrates6511 Жыл бұрын
no one asked
@williamantonioruiz
@williamantonioruiz 6 жыл бұрын
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.
@funfunfunction
@funfunfunction 6 жыл бұрын
ooh did not think of that!
@cotillion137
@cotillion137 6 жыл бұрын
Thanks for going full time! Love this stuff
@sreid70
@sreid70 6 жыл бұрын
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...
@davidnagli
@davidnagli 6 жыл бұрын
I’ve been waiting for some good videos from you about Unit Testing! Finally :)
@ISTefrain
@ISTefrain 4 жыл бұрын
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!
@deveren
@deveren 3 ай бұрын
You're one of the best teachers i've ever encountered in my life
@tmstani23
@tmstani23 6 жыл бұрын
I love your show! The juggling analogy was really clear and useful for understanding the problem at hand ;p
@WorkingJ
@WorkingJ 6 жыл бұрын
LOOOOOOVE this new intro!!! awesome work, @mpjmwe! :D
@mmsikoras
@mmsikoras 6 жыл бұрын
Example with joggling is just great! MPJ you are becoming better and better performancer, really nice actor skills :)
@Geomaverick124
@Geomaverick124 6 жыл бұрын
I love the quirkiness you sir earned my subscription! Keep up the good work :)
@niebboycyrax
@niebboycyrax 6 жыл бұрын
Definitely you rock on teaching man! Many thanks and keep this awesome work! Peace from Brazil!
@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
@lsd22252
@lsd22252 6 жыл бұрын
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.
@dEsTiNy3HaCkEr
@dEsTiNy3HaCkEr 6 жыл бұрын
love the new intro, and the hair ofc :D, i also really like the background music used. keep it up!!
@willl0014
@willl0014 2 жыл бұрын
Dear sir this discussion with yourself was one of the most interesting conversation i have ever heard about complexity
@RedEyedJedi
@RedEyedJedi 4 жыл бұрын
I absolutely love this show! It's entertaining and informative.
@khyatichoprakc
@khyatichoprakc 6 жыл бұрын
This was the most enjoyable technical discussion :) Bravo man !
@heliomoonwave
@heliomoonwave 6 жыл бұрын
Loving it - bring on the unit testing!
@liamsutton6202
@liamsutton6202 6 жыл бұрын
Love all your videos, but the multiple view points expressed through the wacky characters really made this video amazing!
@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':-)
@hotmandead1
@hotmandead1 4 жыл бұрын
Great video and love the intro lol kaffe drop was hilarious !
@matheusd.rodrigues429
@matheusd.rodrigues429 6 жыл бұрын
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
@SimPwear84
@SimPwear84 4 жыл бұрын
Very insightful! Thanx so much MJ
@ryangill9518
@ryangill9518 6 жыл бұрын
This gave me a serious case of deja vu. Good stuff.
@AlexBonillas
@AlexBonillas 6 жыл бұрын
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
@robincEPtion
@robincEPtion 6 жыл бұрын
Amazing.. like you're reading my mind live. Thank You!
@KevinOsterkilde
@KevinOsterkilde 6 жыл бұрын
This was fantastic!
@tourk1234
@tourk1234 6 жыл бұрын
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 6 жыл бұрын
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.
@fugixi
@fugixi 6 жыл бұрын
I freaking love this episode. Hilarious! 😀
@bigbonker9864
@bigbonker9864 6 жыл бұрын
Good episode. Loved the new format. The only problem is that the music was way too loud.
@Gor523
@Gor523 6 жыл бұрын
Great work. This format is awesome
@QiMU01
@QiMU01 6 жыл бұрын
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!
@Krazness
@Krazness 6 жыл бұрын
Excellent video man! Thanks
@MrSpenceju
@MrSpenceju 6 жыл бұрын
Well done! I like your different characters!
@JuliaRakitina
@JuliaRakitina 4 жыл бұрын
Awsome hello from 2020! Searching for a great tutorial for juniors and found this! You are brilliant))
@patrykchrobak7107
@patrykchrobak7107 2 жыл бұрын
Year: 2022. Still valid, still funny, still valuable. Thank You for lesson.
@LukeAvedon
@LukeAvedon 5 жыл бұрын
You are a fantastic teacher. Thank you.
@MaxPicAxe
@MaxPicAxe 4 жыл бұрын
Wow great video. I miss these types of videos
@attamjotsinghkhurana4473
@attamjotsinghkhurana4473 4 жыл бұрын
You are my favourite after devtips. Very entertaining and informative
@sreid70
@sreid70 5 жыл бұрын
Great introduction into unit testing
@growwor
@growwor 6 жыл бұрын
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.
@mmahgoub
@mmahgoub 5 жыл бұрын
You hit every thought I have when coding!
@jsimp8540
@jsimp8540 4 жыл бұрын
This is the best thing I've ever seen!
@happylittlesynth
@happylittlesynth 3 жыл бұрын
love your stuff!
@adobedustindehaven7935
@adobedustindehaven7935 6 жыл бұрын
Such a good episode. Deserves more views.
@SuricataFpv
@SuricataFpv 6 жыл бұрын
Nice characters! Keep on the hard work. :D
@spherinder5793
@spherinder5793 6 жыл бұрын
The skits are hillarious, especially if you're swedish! Keep up the good work!
@stacydavis9979
@stacydavis9979 6 жыл бұрын
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?
@ADiLHaddaoui
@ADiLHaddaoui 6 жыл бұрын
Ouch Man !! you are a legend (y) you deserve a 100m subscribers !!
@illusionarybliss
@illusionarybliss 3 жыл бұрын
excellent thoughts on how you would break up a function; you would need to be able to break it up conceptually
@codingmorrison7957
@codingmorrison7957 6 жыл бұрын
First time watcher, subscribed. Lets do this!
@ancoopa
@ancoopa 6 жыл бұрын
Can't wait for the next Monday. ^^
@fadlihidayatullah3465
@fadlihidayatullah3465 5 жыл бұрын
I love your videos dude!
@rampage241
@rampage241 5 жыл бұрын
Awesome channel bro!
@danieldouglas210
@danieldouglas210 5 жыл бұрын
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!
@monocheddars1709
@monocheddars1709 6 жыл бұрын
Thanks man, great stuff
@antonioaugustocastanheira5966
@antonioaugustocastanheira5966 6 жыл бұрын
Awesome! Really helpful
@NicholasMarshall
@NicholasMarshall 6 жыл бұрын
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.
@peterst6906
@peterst6906 6 жыл бұрын
This was brilliant
@fragrantbloom
@fragrantbloom 2 жыл бұрын
Great video!!!
@johongirrahimov2343
@johongirrahimov2343 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
@coderinprocess2678
@coderinprocess2678 10 ай бұрын
when & where we use TDD?
@producdevity
@producdevity 6 жыл бұрын
You're an awesome programmer and an acteur man. You should mix those thing and start some kind of programming show :)
@InPlainEnglishHQ
@InPlainEnglishHQ 3 жыл бұрын
So so good!
@VeslorTV
@VeslorTV 6 жыл бұрын
This is amazing!!
@bundyfx
@bundyfx 6 жыл бұрын
Nice one MPJ!
@xmelsky
@xmelsky 4 жыл бұрын
Yeah. incredibly useful as always.
@Defrost2157
@Defrost2157 5 жыл бұрын
You're very good at explaining things :)
@alixmauro9707
@alixmauro9707 6 жыл бұрын
You support putting dragon's in cages ! You monster ! Fantastic episode BTW !
@vladimirkrylov4947
@vladimirkrylov4947 6 жыл бұрын
love the way you explain. :)
@ok.google
@ok.google 6 жыл бұрын
thanks for evaluation plugin, looks like handy tool
@michaelfaelan5958
@michaelfaelan5958 4 жыл бұрын
This guy has value. How am I so late to the show?
Unit testing in JavaScript Part 2 - Your first tests
23:38
Fun Fun Function
Рет қаралды 90 М.
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 512 М.
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 71 МЛН
1,000 Diamonds! (Funny Minecraft Animation) #shorts #cartoon
00:31
toonz CRAFT
Рет қаралды 41 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 20 МЛН
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 10 МЛН
Fun Fun Function Returns: Dawn of the Data Developer (and funfun.email)
24:37
Unit tests vs. Integration tests - MPJ's Musings - FunFunFunction #55
28:04
How AI could help us talk to animals
9:06
Vox
Рет қаралды 508 М.
var, let and const - What, why and how - ES6 JavaScript Features
19:19
Fun Fun Function
Рет қаралды 180 М.
Stop Writing So Many Tests
10:02
Web Dev Simplified
Рет қаралды 85 М.
async / await in JavaScript - What, Why and How - Fun Fun Function
24:00
Fun Fun Function
Рет қаралды 252 М.
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Рет қаралды 341 М.
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 71 МЛН