What is Unit Testing, Why We Use It, and Sample Test Cases
Вставка
- Опубліковано 3 кві 2017
- 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.letsbuildthatapp.com/cour...
Time Ago Algorithm Explanation
• Swift: How to Display ...
Facebook Group
/ 1240636442694543
iOS Basic Training Course
www.letsbuildthatapp.com/basi...
Follow me on Twitter: / buildthatapp
This is a very underserved topic. Thanks for putting out a video on it. All devs need to know this.
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.
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!
rumitification good request)
Mera number hai koi
Thanks for the video
Great video Brian, I always thought that testing is tedious but this really makes it logical and appealing.
I know this video is three years old, but it's very educational about this topic of unit testing. Thank you!
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
Fantastic and quick introduction to something that is whispered in hushed tones amongst junior developers.
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. ;-)
First time I see such a simple way for the explanation. Great!
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
Brian Voong you are to iOS what Andrew Ng is for Maching Learning : concise, clear, and brilliant !
Nice, elaborate and to the point. Need some advance examples but for gaining basic understanding this is superb.
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?
Yes please! Can you make unit testing videos! Especially for networking and requests and model objects as well!!
Yeah I think I'll make a unit test video on network requests.
This tutorial is super!!. Thank you, I understand it very easy
Perfect timing as always! Thank you Brian...much appreciated!
Perfect timing? Exam? Job interview? You've piqued my interest.
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.
woah... from 7yrs ago instagram looked much the same !
Very nice! I like the new effects! It gives your videos a polished look
Thanks Marc, I'm still figuring my way out around Adobe Premiere.
Thanks, Brian. This was excellent!
Some of your videos made me convince to learn programming. Thank you! :)
Hey thats great, hope you can see how simple it is when starting from scratch and building up a full product.
First I heard of built in test functions. Reminds me of sales force development. Thank you.
Yep, all enterprise companies have very robust testing infrastructure that produces reliable code for their customers that are paying millions.
Not even coding in swift, but very interesting to watch. This channel is awesome. Talking about very important stuff for newbies. Much appreciated
Yeah this channel goes into more useful advanced topics that beginners should be aware of.
I would *love* to see more videos about Unit Testing! Keep it up, please!
never knew test cases this much easier. Thanks for knowledge sharing
5*
Not aa iOS programmer here but your video explanation is so clear that I understand the concept anyway. Thank you!
Thanks a lot for clear and easy explanation!!!!
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?
logically structured and informative presentation...thanks
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?
Yeah, there are many aspects of testing that can be applied to apps. I'll plan out some more videos on this.
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.
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!
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?
Very very clear! Thanks a lot!
You made it when I wanted to ask you to do such a video
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?
Wooow! I was waiting for this!! Super!
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.
Thank you so much... This is very precious 😀
very explanatory! thanks a lot.
Thanks for creating this video.
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!
Thanks for the video Sir!!
Awesome video. Would love to see more about advanced unit testing
Yeah, looking to put some more testing videos out.
Excellent explanation!
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?
Awesome tutorial...Please explain about Automated UI testing in xcode objective-c
Thank you for the video, is great and it help a lot =)
how you can display your phone on the PC? Some remote control ?
thanks Brian, very usefull
can you plz put some more content on TDD. thank you very much awesome video.
You are the best!! Thank you so much!!
Thanks Joyce, testing is a very fun topic.
Great, thanks a lot!!
I have a second interview in about two hours, thanks for this video! Wish me luck!
very nice and easy to follow
Thanks Brian!
I do have one more question, if I may. If you happen to have a list (which I haven't been able to find online) of 'how proficient' someone needs to be in Swift as a language to say they can code as a Novice Xcode/Swift programmer? (With this I mean, are there certain things I need to know other than the basics of Types, Variables, Methods, Classes, If+For Loops, Switches, Strings, Arrays, Dictionaries, etc.?) Been looking online what would be considered 'proficient' as a Junior iOS Developer. I know that API's is something everyone needs to look up, but what would you say, I a junior Developer should know before applying concerning Swift as a programming language? Again, any advice would be great :) [ps. I have been doing CodeFights.com]
Can you make a video for CI/CD using JENKINS,GIT,
Amazing tut
Is there an iOS Objective-C channel which is as good as this one?
Could you do some Unit and UI testing tutorials?
Sweet and right to the point.
No fluff, just pure content.
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.
Examples to check out concretely would be anything from Chad Darby - dudes got the simple down
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.
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
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?
Your awesome man!
I really like this video!
We really like it too!
Hey do you think
I can use this to make sure all my products are priced correctly on third party apps?
very profesional, thank you
great work
Hi Brian, can you make video about XMPP Chat services? At least quick information :)
How we can test functions wich return Void?
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?
I have a friend that does testing for work and he's going to be coming out with his own channel so stay tuned.
Very good explanation
super like this video and much needed....waiting for your UI unit test video
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
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.
Could you make a video about your setup? I'm really curious what tech you're using. Love your videos btw ^^
My development setup or recording setup?
Lets Build That App Both but I'd be more interested in your development setup
Those pesky "junior developers"! Always breaking all the code that only I contribute to!
Indeed, 100% of bugs were never my fault :)
We can't fully blame junior developers unless we taught the concept and they didn't care
Thank you for this brilliant and objective intro to XCTests
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??
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.
I love you bryan
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?
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.
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.
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.
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 ?
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.
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 .
I see, I've never looked into opencv before, perhaps one day I'll do some research.
Lets Build That App
Okey, thank you Brain. we love you. You are awesome !
Sometimes the TC code will introduce bugs which go away when you remove the code.
Hey Brian! Are you going to WWDC this year and planning to make a video about it?
Hey Tom, unfortunately my budget doesn't allow for a WWDC ticket. Perhaps I'll attend alt conf or some other nearby meetup.
Thank you for another great video. What book, or swift cast would you recommend if we want to dive deep into TDD??
Just a quick question: Can we test the request types which we make on urls, this came in my mind because I use to test controllers in Ruby on Rails for the same. Thanks
There are a few different ways to test requests, some easy some hard depending on how you setup your calls.
Yes, you can mock your requests made to urls, look up the cocoapod MockingJay which lets you mock NSURLSession
I can say only one thing.. He is a swift god
+Vijay Reddy oh rly
Sean Allen and Brian Basically The professor we dint have in collage
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.
Also I am able to access some of swift files from my projects directly.
good explanation
superb
How do we create tests for Watch App?
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?
very cool!
If you are a Qa/test software engineer, is this the work the person would do?
thanks
subbed😁
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
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.
Finally!
Which hardware is using in unit testing
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 :)
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.
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 :)
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
How do you test your application UI code in playground?
Please one video on UI testing
Do a vid on scratch creater
Hey, can you please tell us how to write user interface testing for google sign in?
That sounds like something that would best be suited to an automated testing tool like Selenium IDE which is used for UI testing and is available for Firefox and Chrome.
Thank you
write code to test code? what if you write bad tests?