Тёмный
No video :(

What is Unit Testing, Why We Use It, and Sample Test Cases 

Lets Build That App
Подписаться 204 тыс.
Просмотров 307 тыс.
50% 1

Unit testing is a huge part of Software Development, however it's one of those topics that is not easy to understand until you are given some proper examples and context. In this video, we explore a simple test case that prevents some embarrassing mistakes from being introduced into our production application.
Enjoy.
Instagram Firebase Course
www.letsbuildt...
Time Ago Algorithm Explanation
• Swift: How to Display ...
Facebook Group
/ 1240636442694543
iOS Basic Training Course
www.letsbuildt...
Follow me on Twitter: / buildthatapp

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 234   
@seanallen
@seanallen 7 лет назад
This is a very underserved topic. Thanks for putting out a video on it. All devs need to know this.
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Testing is definitely a topic that deserves attention from iOS developers. It's very interesting all the flaws you can find by just testing your own code.
@rumitification
@rumitification 6 лет назад
Thanks for the video Brian! Posting it here as both you and Sean post tutorials very actively. If you guys get a chance, could you please post a video on how to write cases to test HTTP requests and responses using something like OHTTPStubs? Thank you for all your posts. Cheers!
@aleksplats
@aleksplats 5 лет назад
rumitification good request)
@pappukhan7353
@pappukhan7353 4 года назад
Mera number hai koi
@demoncoco1386
@demoncoco1386 4 года назад
Thanks for the video
@JoseSalazar-cj3gd
@JoseSalazar-cj3gd 4 года назад
I know this video is three years old, but it's very educational about this topic of unit testing. Thank you!
@mattlarsen
@mattlarsen 3 года назад
Fantastic and quick introduction to something that is whispered in hushed tones amongst junior developers.
@thomaspatouillaud9063
@thomaspatouillaud9063 6 лет назад
Brian Voong you are to iOS what Andrew Ng is for Maching Learning : concise, clear, and brilliant !
@adamsmidov1014
@adamsmidov1014 3 года назад
First time I see such a simple way for the explanation. Great!
@ChordToday
@ChordToday 6 лет назад
Not aa iOS programmer here but your video explanation is so clear that I understand the concept anyway. Thank you!
@maklasik
@maklasik 7 лет назад
Not even coding in swift, but very interesting to watch. This channel is awesome. Talking about very important stuff for newbies. Much appreciated
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yeah this channel goes into more useful advanced topics that beginners should be aware of.
@jross3r
@jross3r 7 лет назад
First I heard of built in test functions. Reminds me of sales force development. Thank you.
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yep, all enterprise companies have very robust testing infrastructure that produces reliable code for their customers that are paying millions.
@anshuparihar3654
@anshuparihar3654 6 лет назад
Nice, elaborate and to the point. Need some advance examples but for gaining basic understanding this is superb.
@utberoxsobad
@utberoxsobad 7 лет назад
Yes please! Can you make unit testing videos! Especially for networking and requests and model objects as well!!
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yeah I think I'll make a unit test video on network requests.
@marcaupont9145
@marcaupont9145 7 лет назад
Very nice! I like the new effects! It gives your videos a polished look
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Thanks Marc, I'm still figuring my way out around Adobe Premiere.
@avoautomation8573
@avoautomation8573 Год назад
Unit testing is a way of testing one unit of a software application. A unit is the smallest piece of software that is isolated and tested as an individual for functioning. Avo Automation provides the best automated testing platform for all types of software testing, including unit testing
@sawyerburnett8319
@sawyerburnett8319 5 лет назад
I don't use swift, but this was a really helpful primer on unit tests! I've worked at too many companies that don't see the value in them, so I'm working hard to start integrating them into our code base
@arkter9568
@arkter9568 7 лет назад
Some of your videos made me convince to learn programming. Thank you! :)
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Hey thats great, hope you can see how simple it is when starting from scratch and building up a full product.
@yonasstephen
@yonasstephen 7 лет назад
I never bother to learn what's that UnitTesting in Xcode for before. thanks for this! nicely put along with real-life example use case. now that you mentioned about Continous Integration, would be great if you could talk more about it in your next video, what tools you're using, and so on! Cheers
@ehawkins730
@ehawkins730 7 лет назад
Perfect timing as always! Thank you Brian...much appreciated!
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Perfect timing? Exam? Job interview? You've piqued my interest.
@ehawkins730
@ehawkins730 7 лет назад
Lets Build That App Hey, Brian...this week's application assignment for school was creating an app that included UITest...Unfortunately, my teacher isn't the greatest, so see outside resources to further my education. So it was perfect timing...as I follow all of your videos anyway.
@ivangutowski-smith6514
@ivangutowski-smith6514 4 месяца назад
woah... from 7yrs ago instagram looked much the same !
@syedaurangzaib3861
@syedaurangzaib3861 6 лет назад
This topic is most important for us. I understand it clearly, because your teaching method is great :) please also make a video on test case for web services, api testing. I'm waiting for your kind video.
@krutomjer
@krutomjer 7 лет назад
Great video Brian, I always thought that testing is tedious but this really makes it logical and appealing.
@georgedubrik280
@georgedubrik280 7 лет назад
logically structured and informative presentation...thanks
@septronic2010
@septronic2010 7 лет назад
I really liked this video. I am relatively new to testing, and find it a big challenge sometimes, especially when it comes to UI. Can you do some more complex testing tutorial as well please?
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yeah, there are many aspects of testing that can be applied to apps. I'll plan out some more videos on this.
@HerbivoreJesus
@HerbivoreJesus 7 лет назад
Awesome video. Would love to see more about advanced unit testing
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yeah, looking to put some more testing videos out.
@heri_prieto
@heri_prieto 6 лет назад
I have a second interview in about two hours, thanks for this video! Wish me luck!
@patrarus6097
@patrarus6097 4 года назад
Thanks, Brian. This was excellent!
@Asyrafcruz
@Asyrafcruz 3 года назад
Sean Allen and Brian Basically The professor we dint have in collage
@rl-pavel
@rl-pavel 7 лет назад
I would *love* to see more videos about Unit Testing! Keep it up, please!
@claudiopaulo3269
@claudiopaulo3269 7 лет назад
Hey Brian, how you doing? Always pushing us further, few code lines at time. Thanks for enlightening us, the mere mortal beings struggling to be relevant in this iOS universe. ;-)
@makwanbarzan7085
@makwanbarzan7085 4 года назад
Made this topic clear to me in a just few minutes. Many thanks!
@antoniodifrancesco4844
@antoniodifrancesco4844 7 лет назад
Wooow! I was waiting for this!! Super!
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Glad to have finally been able to make a video on Unit Testing as it's very important in the real world of software development.
@brianleeson7402
@brianleeson7402 5 лет назад
Those pesky "junior developers"! Always breaking all the code that only I contribute to!
@LetsBuildThatApp
@LetsBuildThatApp 5 лет назад
Indeed, 100% of bugs were never my fault :)
@KangJangkrik
@KangJangkrik 4 года назад
We can't fully blame junior developers unless we taught the concept and they didn't care
@elifarr
@elifarr 5 лет назад
Thanks a lot for clear and easy explanation!!!!
@oleksandrsamsonov3067
@oleksandrsamsonov3067 7 лет назад
You made it when I wanted to ask you to do such a video
@cro1114
@cro1114 7 лет назад
This tutorial is super!!. Thank you, I understand it very easy
@ronborneo1975
@ronborneo1975 7 лет назад
Learned about Unit Tests and that you can create extensions on primitive types. I'm new to Swift haha. By the way, your content is awesome!
@elep4043
@elep4043 3 года назад
Thanks Brian!
@adithyavikram5426
@adithyavikram5426 6 лет назад
never knew test cases this much easier. Thanks for knowledge sharing 5*
@KelKrom
@KelKrom 5 лет назад
Excellent explanation!
@swamiips
@swamiips 7 лет назад
I can say only one thing.. He is a swift god
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
+Vijay Reddy oh rly
@boxer3617
@boxer3617 5 месяцев назад
great work
@lorenzol6393
@lorenzol6393 5 лет назад
very nice and easy to follow
@nikbelikov
@nikbelikov 6 лет назад
Very very clear! Thanks a lot!
@NurHidayatullah
@NurHidayatullah 2 года назад
thanks Brian, very usefull
@chetanmrane
@chetanmrane 7 лет назад
super like this video and much needed....waiting for your UI unit test video
@chetanmrane
@chetanmrane 7 лет назад
i wish one day you also start teaching us android with same fun :) [but iOS - first love would remains first] BDW I am glad to tell you that whenever i do swipe on my smartphones...i notice diff apps and started dreaming coding the same programatically....Brian you have impacted so +vely....FAN OF YOUR WAY OF TEACHING
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
That's excellent, I also find myself trying to break down the apps I use into components I can build. It's a lot of fun.
@HekaFOF
@HekaFOF 6 лет назад
Here is a video idea for you: Usually it is not hard to make tests. What is hard to determine is WHAT to test with unit testing. Because you don't want to test trivial things like square. What do you think of this idea? :)
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
If you're writing tests, a simple rule of thumb is to test every method that is public. This will help you determine what should be exposed and what should be kept private.
@seandougan8593
@seandougan8593 6 лет назад
Great vid man well done - only advice, step-by-step is always better, conciseness and simplicity are they keys to teaching skills. The least amount of words and points that say the most make knowledge acquirable for anyone in your medium.
@seandougan8593
@seandougan8593 6 лет назад
Examples to check out concretely would be anything from Chad Darby - dudes got the simple down
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Cool, chad goes at a much slower pace so it’s easier to understand. I’m not a big fan of preparing and reading from slides personally, I think I’m too lazy to actually do it.
@fardayekahmed7878
@fardayekahmed7878 6 лет назад
very explanatory! thanks a lot.
@jonathanmartins3816
@jonathanmartins3816 5 лет назад
This may seem a stupid question, and I apologize in advance for it, but I'll ask anyway: In your square function you used "3" for testing the square value, but let's say one uses "2" for testing; the result must be "4". But, if someone modifies the square function and "by mistake" changes the "self * self" to "self + self", if the testing value is "2" the result will still be "4". How does it assert that my function is right?
@erikschaepers
@erikschaepers 2 года назад
good explanation
@19glok
@19glok 5 лет назад
Thanks for creating this video.
@dudsaheb
@dudsaheb 6 лет назад
Very good explanation
@annamalairajj7705
@annamalairajj7705 6 лет назад
Thanks for the video. This enlightened us on why unit test required and how to write test cases. Could you teach us how to write UITests and Mocks?
@siewtany1174
@siewtany1174 7 лет назад
Your videos are excellent and great on teaching Swift. Please continue your hard work! Truly appreciate. Are you gonna teach Android in the future? If not, any recommendations who has best teaching on Android?
@ladedadedaschlobonmeknob7850
@ladedadedaschlobonmeknob7850 7 лет назад
Sweet and right to the point.
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
No fluff, just pure content.
@letaciogalvao9908
@letaciogalvao9908 Год назад
Great, thanks a lot!!
@KemaTheCreative
@KemaTheCreative 2 года назад
Hey do you think I can use this to make sure all my products are priced correctly on third party apps?
@zen_prog
@zen_prog 7 лет назад
Thanks Brian for all the amazing tuts. what should one unit test in a typical MVC iOS app, what parts should be covered by unit tests other than model layer and business logic?
@lucien5112
@lucien5112 3 года назад
write code to test code? what if you write bad tests?
@shiju861
@shiju861 6 лет назад
Thanks for the video Sir!!
@sindhuvannela4407
@sindhuvannela4407 6 лет назад
Awesome tutorial...Please explain about Automated UI testing in xcode objective-c
@gamedevsa
@gamedevsa 4 года назад
Hi there Brian, thanks for the great video, very informative. Just a tiny bit of constructive criticism. The audio compression ration of your voice is set veeeery high:) See if you can tone that setting down a bit - it will make your voice a bit more natural and reduce over-emphasizing of other unwanted noise. Again, thanks for the video, I especially like the fact that you use a very real world application!
@vamsikrishna8820
@vamsikrishna8820 4 года назад
How do we create tests for Watch App?
@lennartphilipp6699
@lennartphilipp6699 7 лет назад
Could you make a video about your setup? I'm really curious what tech you're using. Love your videos btw ^^
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
My development setup or recording setup?
@lennartphilipp6699
@lennartphilipp6699 7 лет назад
Lets Build That App Both but I'd be more interested in your development setup
@nadeasalvatore
@nadeasalvatore 6 лет назад
Thank you so much... This is very precious 😀
@AlqGo
@AlqGo 7 лет назад
Were test-driven development and agile common practices in your previous jobs? If they were, how did you implement tests in a short iterative development cycle?
@Mr_Jai_Kalra
@Mr_Jai_Kalra 5 лет назад
superb
@naveensoni6227
@naveensoni6227 7 лет назад
Awesome tutorial!!! I want to learn more about Unit testing. How can we use it for TDD approach? Recently I faced this in an interview, I got selected but still not feeling comfortable regarding TDD. Can you give us any tutorial for TDD approach with swift?
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
I have a friend that does testing for work and he's going to be coming out with his own channel so stay tuned.
@daniellaerachannel
@daniellaerachannel 7 лет назад
Amazing tut
@SenorQuichotte
@SenorQuichotte 6 лет назад
With playground you can build and test your much faster and quicker than compiling code all the time, especially when your app gets complicated. I use these only for pushing this buttons
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
How do you test your application UI code in playground?
@anilsk8561
@anilsk8561 6 лет назад
can you plz put some more content on TDD. thank you very much awesome video.
@V3ritas1989
@V3ritas1989 6 лет назад
sooo, in this case you compare the result of your square function to a build in square function. What do you do when you have a more complex function to test? recreate the complex function in your test script and compare it against the one writen in the project? I am not really sure I can follow what you do here. Or would you manually calculate with fixed input value and then hard code the result value while comparing it against the function when given this specific input value?
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
I'm not sure if you watched the entire video, but at the end we test a complex function that's in our project that prints out the timeAgoString. You simply create an instance of your objects and test the function calls with some inputs and verify the output is what you expect.
@joycelu962
@joycelu962 7 лет назад
You are the best!! Thank you so much!!
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Thanks Joyce, testing is a very fun topic.
@shivam1427
@shivam1427 4 года назад
Does the application needs to be built for the unit test to run? OR it’s just like calling functions in our code with some predefined data?
@ABC-xc9il
@ABC-xc9il 5 лет назад
excuse me, can you help me, i'm having a problem about error domain 9806 and 9807 requires a certificate of trust thank you
@LetsBuildThatApp
@LetsBuildThatApp 5 лет назад
Excellent.
@ABC-xc9il
@ABC-xc9il 5 лет назад
@@LetsBuildThatApp I have granted permission in info.plist file but failed, do you have any suggestions for me
@ianman6
@ianman6 7 лет назад
Super, thanks! What code editor are you using for app development? Do you do other development (Android, web) and if so, do you use the same environment? Thanks!
@gokul2226
@gokul2226 Год назад
All the junior dev's got attacked 2:14
@kaanozdemir8666
@kaanozdemir8666 7 лет назад
Heeyy what's up Brain ! Hope you are doing well ! I love your videos. We are learning so much things. I want to ask one question. Will you do some videos about the image processing in swift or do you think ?
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
When you say image processing are you referring to filters like instagram? I've written the code before and I could share it later on.
@kaanozdemir8666
@kaanozdemir8666 7 лет назад
Lets Build That App No, not like the instagram. Like using open cv, doing corner detection , tracking object, scanning documents etc. Because there are not lots of source about swift - opencv .
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
I see, I've never looked into opencv before, perhaps one day I'll do some research.
@kaanozdemir8666
@kaanozdemir8666 7 лет назад
Lets Build That App Okey, thank you Brain. we love you. You are awesome !
@pkasetti
@pkasetti 7 лет назад
I really like this video!
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
We really like it too!
@minchaejeong5010
@minchaejeong5010 7 лет назад
Woah... bryan you blew my mind!!! The square() on extension int is so cool!! But my question is, is there a reason why you did it on extension, instead of having function with arguments and returning square value??
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Well, with extension you can call it from anywhere in your project and its easy to use. Functions are quite clunky. Also, the extension makes for an excellent example of how to implement a simple Unit Test.
@minchaejeong5010
@minchaejeong5010 7 лет назад
I love you bryan
@aleksplats
@aleksplats 5 лет назад
Thanks Brian! Do we need to create separate file for each test? Or do we have to create file for group of tests, or file per logical module?
@programthis3805
@programthis3805 3 года назад
very cool!
@abhishekrajankar9818
@abhishekrajankar9818 5 лет назад
Please one video on UI testing
@esdrasevt
@esdrasevt 6 лет назад
Thank you for this brilliant and objective intro to XCTests
@tenminutetokyo2643
@tenminutetokyo2643 6 лет назад
Sometimes the TC code will introduce bugs which go away when you remove the code.
@tsmithcad
@tsmithcad 6 лет назад
Your awesome man!
@keshavdk3080
@keshavdk3080 4 года назад
Thank you for the video. I have worked for start up as “Internet of things developer” where my contribution was to design a prototype for our client where i programmed(C language) a microcontroller with sensor which is connected to AWS Internet of things cloud platform for a duration of 8 months which includes sending the sensor data from device to AWS IoT cloud. Now the company is not operating. Since I have less experience I now work in different domain to take care of myself as well as pay my bills. I am also learning python programming language from Udemy and also completed 6 small projects like building a website using Python flask, Open CV,Desktop database applcaition,Creating webmaps using Folium,Data analysis using pandas,numpy,webcam motion detector using webcam, Interactive Data Visualization with Bokeh. My query is, as a self taught programmer ,I would like to know from experience person like you that, will these projects help me land a job. I believe I can make a comeback and work even though I have gap in my career. But I would like to get suggestions on how can I apply with these skills in my resume,the duration of these above projects I can put in my profile. Also how can i start unit testing. Please correct me and suggest ,if I asked anything wrong.
@bighands69
@bighands69 3 года назад
Get involved in the open source community, Do consulting for small businesses , Build apps for different devices and use these different areas to try and network with people. You need to build your self a daily training routine so as to become a master in certain techniques the way an athlete does. Are you looking really to work with higher level programs or lower level such as embedded systems.
@crzyjocksstudio6015
@crzyjocksstudio6015 3 года назад
Which hardware is using in unit testing
@KunalKumar-lx9yg
@KunalKumar-lx9yg 5 лет назад
Can you make a video for CI/CD using JENKINS,GIT,
@anthonyschwartz1084
@anthonyschwartz1084 6 лет назад
I have a question as a Junior Developer: What kind of app should I bring to the app store to utilize as my resume app? How large, complicated, etc. should it be (are the good app examples that employers would like to see)? I have the basics down, the general requirements for a junior position and I have created 'mini' apps that are very simple in nature, but I don't know what I should create, or how since if it is too big I might be wasting my time (in a way 'wasting time' as in not actively working towards getting a complete app to use as a job resume). Any advice would be great :)
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
I would set a baseline of creating apps using core data and cloud db such as firebase. I create the paid courses on my website to help people land jobs. Go check them out, I’m sure you’ll find them useful like the rest of my students.
@anthonyschwartz1084
@anthonyschwartz1084 6 лет назад
Thank you for the quick reply! That is great news! Will take a look at your paid courses and will try to create something around core date and/or cloud db. I really appreciate the advice :)
@Zakawaka45
@Zakawaka45 7 лет назад
Could you do some Unit and UI testing tutorials?
@banderilllero
@banderilllero 6 лет назад
how you can display your phone on the PC? Some remote control ?
@pkasetti
@pkasetti 7 лет назад
Is there an iOS Objective-C channel which is as good as this one?
@Master--ku7ud
@Master--ku7ud 5 лет назад
*Let's built more apps with flutter*
@user-uy4en2ci3c
@user-uy4en2ci3c 7 лет назад
Thank you for the video, is great and it help a lot =)
@Phaeethon
@Phaeethon 7 лет назад
Hi Brian, can you make video about XMPP Chat services? At least quick information :)
@michaborski7383
@michaborski7383 6 лет назад
very profesional, thank you
@Olden2610
@Olden2610 6 лет назад
How we can test functions wich return Void?
@RohitKowadkar
@RohitKowadkar 6 лет назад
Hey Brian I am implementing unit test case in my project but I am facing issue while importing the testable module getting warning as "File 'MyProjectNameTests.swift' is part of module 'MyProjectName'; ignoring import". My project includes the both objective-c and Swift code and my test case target is in Swift. Please give me resolution if any.
@RohitKowadkar
@RohitKowadkar 6 лет назад
Also I am able to access some of swift files from my projects directly.
@suleymanomari2550
@suleymanomari2550 7 лет назад
Hey Brian. Nice job. Can you please share Spotify demo and tinder demo as a course I saw it on your device :) Testing is a big part in the development and we should focus more on that but We have so much more to learn on iOS and Swift app development e.g. if the app is inactive and goes to the background what kind of stuff can we do at that state etc.. . Can you please make more apps that is the best way to learn. An application where we have different UIViewControllers and other important stuff from Apples framework involved like MapKit etc. would be perfect. Thanks
@LetsBuildThatApp
@LetsBuildThatApp 7 лет назад
Yeah, unfortunately I'm a one man team here and preparing/recording everything is more than a full time job. We'll see what I can get done on my starbucks espresso coffee drinks.
@mattig4578
@mattig4578 5 лет назад
Jr Dev that just join the iOS team watching :v
@rebeloper
@rebeloper 7 лет назад
Awesome
@Asimov16
@Asimov16 6 лет назад
What if there is a bug in your unit test code, and do you have to do a unit test to test your unit test code, and then do you have to unit test your unit test ... infinitum or am I missing the point?
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Well there's always potential for bugs so testing isn't going to be 100% bug free most of the time. Furthermore, writing tests also makes you write code thats simple and easy to test. In the long run, it will save you many headaches.
@Asimov16
@Asimov16 6 лет назад
I've just got a boss who knows how to break things. Not sure how he does it, but he always finds my bugs LOL
Далее
Unit Tests and Test Doubles like Mocks, Stubs & Fakes
17:32
Wife habit 😂 #shorts
00:16
Просмотров 61 млн
When To Unit, E2E, And Integration Test
14:58
Просмотров 94 тыс.
Do we really need firebase in 2023
10:47
Просмотров 119 тыс.
Best Coding Practices to Show during Job Interviews
12:36
The ONLY REASON To Unit Test
8:26
Просмотров 77 тыс.
What is Test Coverage?
15:57
Просмотров 9 тыс.
Swift: How to Migrate MVC to MVVM & Intro Unit Testing
33:11
Stop Writing So Many Tests
10:02
Просмотров 87 тыс.