Тёмный
No video :(

Getting Started With Unit Testing | XCTest | Swift 

Kilo Loco
Подписаться 37 тыс.
Просмотров 53 тыс.
50% 1

Today, Kilo Loco covers how to get started with unit testing using XCTest in Swift.
He will cover how to refactor code out of view controllers, what code is best to start testing, and how to implement several different unit tests using functions like XCTAssertTrue and XCTAssertEqual.
Anyone looking to reduce the amount of bugs in their code and increase the amount of code coverage in their codebase should watch this tutorial.
** Show Notes and Links **
Project Files:
kilo-loco.teac...
Need Help?
kiloloco.com/m...
Kilo Loco on Social Media:
www.kiloloco.com
RU-vid- / kiloloco
Twitter- / kilo_loco
Instagram- / kilo_loco
--------GEAR ------
Code Passionately T-Shirt
a.co/d/53OkIu0
Laptop - 2017 MacBook Pro
amzn.to/2tk5yLr
Keyboard - Anne Pro 2
amzn.to/2RvBcRZ
Microphone - Blue Yeti
amzn.to/34swmdC
DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, we’ll receive a small commission. This helps support the channel and allows us to continue to make videos like this. Thank you for the support!
#swiftlang #xctest #unittest

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

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 116   
@felipenka
@felipenka 4 года назад
you had me with "Real World ....", there are thousands of videos with iOS content, but it is always the same and with very basic examples, it is what the community lacked, more content creators who gave real examples , with context. And with your charisma and way of teaching it becomes very easy to understand everything. I discovered your channel recently, and you're already one of my favorite swift devs! I wish you success in everything you do !!!
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks Felipe, I really appreciate it!! I'm definitely going to be focusing on real world examples more often, so hopefully you continue to enjoy the content that's on its way
@TheHy6xD
@TheHy6xD 4 года назад
I love your IDE setup and theme, I remember those days a few years ago when I just was learning from you and now I work full-time. Thank you, Kyle!
@SudhanshuSrivastavaIndia
@SudhanshuSrivastavaIndia 4 года назад
I think this is the most detailed and practical video on Unit Tests.. Thanks Kilo
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha Glad you liked it!!
@immmax
@immmax 2 месяца назад
Thanks for this video. Good clear way to dive into testing. 👍
@BharathGuntupalli
@BharathGuntupalli 5 месяцев назад
Comprehensive at the same time more detailed. Thanks for making this video, this helped me a lot :-)🙂
@sneakyfoxstudio
@sneakyfoxstudio 4 года назад
I was just learning this last night just to finish my project! haha good timing!
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha crazy timing!! Hopefully this video helped
@stephinline
@stephinline 4 года назад
Just when I needed this! 🙌🏽 Thanks for the great content as usual.
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks!! I’m glad that I could help!! 😁
@mikaelacaron4694
@mikaelacaron4694 4 года назад
Great tutorial Kyle! I just started learning Unit Testing. Loved the real world examples!
@Kilo_Loco
@Kilo_Loco 4 года назад
Hahaha Glad you liked it Mikaela. Also hmu if there are topics that you want covered. You've been following for a while now and i would like to return the favor of you supporting the channel
@xtcrpk9316
@xtcrpk9316 4 года назад
The second part of testing video would be great! With some more specific use cases and real life examples (more complex, mb?) But yep, thanks for the video, its just in time!
@Kilo_Loco
@Kilo_Loco 4 года назад
I'll definitely do more on testing. Looking to get into other real world examples
@sashamakedonskii
@sashamakedonskii 4 года назад
@@Kilo_Loco It will be nice to test network calls 👍🏾
@finalpets
@finalpets 4 года назад
Love it!, maybe UITest and one more UnitTest but with MockUp Server, will be more realistic because every APP has a network request and its hard to Unit Test that Layer, thanks!!
@bdaralan
@bdaralan 4 года назад
Learnt capture error in assert throw and how to check code coverage. Thank you. 😃
@Kilo_Loco
@Kilo_Loco 4 года назад
My pleasure!! Hopefully I can keep providing you more value in the future
@MultiSimransingh
@MultiSimransingh 4 года назад
9:21 Option + shift + Enter
@lukassbeataddicts
@lukassbeataddicts 2 года назад
I laughed so hard when you said very sexy. Made my day bro. You made horror of unit testing enjoyable.
@matthew11092
@matthew11092 2 года назад
Great introduction to XCTest! Thank you.
@faizanawaz75
@faizanawaz75 2 года назад
Thank you so much. You made my day by explaining it this easy way.
@LittleTanner3
@LittleTanner3 4 года назад
This is the best intro to unit testing video! Could you please create a video on using a page view controller, all the tutorials I have seen are really old.
@emmanuelecorporente
@emmanuelecorporente 4 года назад
just great !
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks!
@ignaciobrambilla7126
@ignaciobrambilla7126 2 года назад
Great video! Thanks!!
@sudheerlogicloop9590
@sudheerlogicloop9590 4 года назад
Great video, thank you, i want UITest Cases also in next video
@Kilo_Loco
@Kilo_Loco 4 года назад
I will add UITests to the list of topics
@chuyinreyes
@chuyinreyes 3 года назад
I love how u explain everything. Tks for the tips bro
@Kilo_Loco
@Kilo_Loco 3 года назад
Happy to help! 😁
@americo770602
@americo770602 3 года назад
Thank you Kilo Loco, it is useful video. Great job!
@aurontz
@aurontz 3 года назад
Just earned my sub. Very nice. I look forward to watching and learning more of your material. Thank you and God bless.
@JasonMitchellAZ
@JasonMitchellAZ 4 года назад
Awesome walkthrough for starting out unit testing. You covered a lot of great stuff from start to finish in this video.
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha glad I could help 😁
@sorinmiroiu9404
@sorinmiroiu9404 4 года назад
Very cool video Kilo. When i heard the words "reusable code" i thought to myself "now, that's sexy". Keep up the good work and i hope you have a great experience at your new job. :D
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha Hell YEA!!
@amari9773
@amari9773 3 года назад
Learned a lot from this video. Much appreciated, Kilo.
@AmitThakur-eg8kb
@AmitThakur-eg8kb 4 года назад
OMG it's amazing kilo, i was deperately waiting for such type of video. Thanks man.
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha glad that i could help
@AviramNetanel
@AviramNetanel Год назад
great video ! very helpful!
@sathishkumardsk
@sathishkumardsk 4 года назад
Great!. Your codes are clean and simple.Thanks for sharing your knowledge.Keep going.
@Kilo_Loco
@Kilo_Loco 4 года назад
Glad that you liked it 😁
@subinkk1000
@subinkk1000 2 года назад
Very informative 👍👍
@JuanGarcia-ok4tq
@JuanGarcia-ok4tq 4 года назад
Thanks! Nice video. Hopping to watch more videos regarding Unit Test 🙂
@Kilo_Loco
@Kilo_Loco 4 года назад
I can definitely go deeper with Unit Testing
@kpsv7702
@kpsv7702 2 года назад
Nicely explained brother. Please explain autolayout with different scenarios.
@DipperSlipper
@DipperSlipper 4 года назад
Hi Kyle, I enrolled for the membership and waiting for the invitation to the awesome slack community. :)
@Kilo_Loco
@Kilo_Loco 4 года назад
Please DM your email and I'll double check
@brandonb6175
@brandonb6175 4 года назад
This is an excellent video Kilo!
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks!! I'm glad that you liked it! Now make sure you start adding in tests to your project 😉
@shiaulis
@shiaulis 4 года назад
In some TDD approaches "validation" will be called as "sut" - system under test. Sometimes it is convenient to see a system under test in any test file. But anyway thanks for those examples, true help for beginners in unit tests
@Kilo_Loco
@Kilo_Loco 4 года назад
Yea, I considered using the word sut, but I figured it would cause more confusion than simply giving it the name “validation”
@ianrust3785
@ianrust3785 3 года назад
Thanks, very clear and practical.
@Kilo_Loco
@Kilo_Loco 3 года назад
My pleasure
@ThuongNguyenManh
@ThuongNguyenManh 2 года назад
Love the video and I love your IDE setup + theme. But I don't know how to configure my IDE like that As control + shift + enter does not work on my side 😫
@Ni7ram
@Ni7ram 4 года назад
amazing brother! you won a subscriber
@TheFloydPinkus
@TheFloydPinkus 4 года назад
Another great video, we learn so much. Just one thing I was missing - that KIlo Loco talk you do in a lot of your videos. You we're a bit too serious this one :)
@leledeveloper
@leledeveloper 3 года назад
Amazing video! Thanks ❤️
@nikolakrstevski3339
@nikolakrstevski3339 3 года назад
That was great! Thank you very much!
@Jock3R87
@Jock3R87 4 года назад
Mate firstly many congrats on your new job... any thoughts on Protocol oriented programming using Dependency injections ... which is in demand
@Kilo_Loco
@Kilo_Loco 4 года назад
Yes, I think that protocol oriented programming is a very important concept, especially for making things easier to test. I actually put together a course on POP kilo-loco.teachable.com/p/pop
@Jock3R87
@Jock3R87 4 года назад
Kilo Loco mate I am UK based so not sure how can I enroll for this...
@chimeiwangliang
@chimeiwangliang 4 года назад
I was just watching John Sundell’s lecture on unit testing, what a coincidence!
@Kilo_Loco
@Kilo_Loco 4 года назад
Haha, pretty crazy since we just had that podcast we recorded earlier this week
@willasaskara
@willasaskara 3 года назад
thanks!
@diakojafari2107
@diakojafari2107 2 года назад
thanks
@666MrGamer
@666MrGamer 4 года назад
Nice video! Definitely helpful for beginners and a great starting point. Just a suggestion - I would make the XCTAssertTrue(username.count == 20) change to username.count >= 20 that way the test is less restrictive and does not fail for even longer usernames. Also I think testing the expectedError description is redundant. Since the above XCTAssertEqual will only pass when the error and expected error are of the same type it implies that the descriptions will be the same. I would probably just check it against a struct that keeps hold of all the app messages and test it against that. That way we test if we have the correct message for each error.
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks for the tips, I appreciate them 😊 Yea it definitely would have been better to do >= 20 to future proof it a little more. As for the error description, it definitely is redundant, but I thought it would be a nice way to show how to chip away at the coverage. Also, I think there are instances when things like this could actually be useful due to inconsistencies caused by conformance/inheritance
@DhavalHNena
@DhavalHNena 3 года назад
Brilliant! BAM..
@hustlas4ever
@hustlas4ever 3 года назад
Thank you!
@villagelove6504
@villagelove6504 4 года назад
Could you please make video on "How to write test cases for higher order functions or closures".
@kollokvium
@kollokvium 3 года назад
The color scheme is super juicy
@ubaidillahahmad25
@ubaidillahahmad25 3 года назад
thank you! (sorry this is the 101st comments haha)
@wesleybritob
@wesleybritob 4 года назад
awesome
@Kilo_Loco
@Kilo_Loco 4 года назад
Thanks!
@Denis-pq9kq
@Denis-pq9kq 3 года назад
Woooow awesome man! Do you have any plans for a UI testing video?
@jakubgawecki4264
@jakubgawecki4264 3 года назад
Hey guys. I am still in the phase of getting to know unit testing. Can anyone explain to me what was the purpose of creating methods, then checking them in a simulator, and then, after all, writing tests. Should tests not be done first? What I mean is, if we testing in a simulator first, what is the purpose of further testing in a Unit testing case? Thanks!
@am13476
@am13476 4 года назад
Can you create more videos about Unit Testing, especially about API testing, network calls etc
@Kilo_Loco
@Kilo_Loco 4 года назад
Absolutely
@prahladreddy6839
@prahladreddy6839 4 года назад
Hi kilo, can you make more n more videos on unit testing please
@Kilo_Loco
@Kilo_Loco 4 года назад
Absolutely! Which aspects of unit testing are you interested in?
@denisp.7850
@denisp.7850 4 года назад
thank you, Kilo 🤛 btw is it me or there's something wrong with the sound? it seems to be shifted a bit to the right.
@Kilo_Loco
@Kilo_Loco 4 года назад
Hmmm I didn’t notice it but I will definitely try to be more vigilant in the future to make sure this doesn’t pop up
@galahador
@galahador 3 года назад
Very nice!!
@jessie5096
@jessie5096 3 года назад
how to unit test without the simulator show up and running? Thanks
@harshhungund5556
@harshhungund5556 3 года назад
Great tutorial Kyle. The best to get started on Unit Testing with practical scenario example. Request you to please make one on UI testing as well. If already made then can you please share the link of that video 👍
@sathishkumardsk
@sathishkumardsk 4 года назад
Hey can you do a video about NSOperationQueue?
@Kilo_Loco
@Kilo_Loco 4 года назад
Yes I most certainly can!! It’s on its way soon 😉
@shanthl1150
@shanthl1150 4 года назад
suprbbbb
@Timisenman
@Timisenman 3 года назад
Too damn good
@saeedalobidi4195
@saeedalobidi4195 4 года назад
Thank u😁
@Kilo_Loco
@Kilo_Loco 4 года назад
Thank YOU for watching 😁
@denniswhite6779
@denniswhite6779 4 года назад
any chance of you covering more in unit testing but with mocking a protocol (interface)?
@Kilo_Loco
@Kilo_Loco 4 года назад
Yes!! More unit testing is on its way 😉
@multitudes389
@multitudes389 4 года назад
We don’t wanna be in the tutorial trap right? Now there is plenty to do 😁👍
@Kilo_Loco
@Kilo_Loco 4 года назад
Absolutely! Action is where its at
@javedsiddique6016
@javedsiddique6016 4 года назад
hi I want tutorial on generics like we have. function with parameter as sturture object and as per tht when we call function it should parse the data as per the type we want do database or some other functions as per that structure type we want
@Kilo_Loco
@Kilo_Loco 4 года назад
Great topic to cover. Thanks for the suggestions
@SOFYSoOo
@SOFYSoOo 4 года назад
CI/CD please :D
@Kilo_Loco
@Kilo_Loco 4 года назад
Absolutely! Some good stuff is on its way
@user-gn1jr3ju1t
@user-gn1jr3ju1t 4 года назад
How did you set xcode elements to be purple? Looks nice!
@macasasa2009
@macasasa2009 4 года назад
This is actually system preferences. Go to System preferences -> General -> Accent colour.
@Kilo_Loco
@Kilo_Loco 4 года назад
Yes, this is part of the operating system and @Nikolay Ukolov is explains it perfectly
@nizz4m
@nizz4m 4 года назад
Its Kilo Loco official color
@DipperSlipper
@DipperSlipper 4 года назад
9:19 Control+Shift+Enter does not work. Can you please tell me the name of the shortcut so that I can configure in Xcode keybinding preference?
@hurshhazari2300
@hurshhazari2300 4 года назад
option+Shift+Enter
@Kilo_Loco
@Kilo_Loco 4 года назад
I think @Hursh Hazari is correct. There are lists of shortcuts online though
@DipperSlipper
@DipperSlipper 4 года назад
Thanks @Hursh and @Kilo
@ClutchKillers
@ClutchKillers 2 года назад
"No such module
@alexpascal5403
@alexpascal5403 Год назад
PETER PULLER PETER PULLER. MY SISTERS A PETER PULLER PETER PULLER. SHE PULLS PETERS.
@FxxxnChris
@FxxxnChris 3 года назад
Very sexy video. 😂
@GorillaDev417
@GorillaDev417 2 года назад
Great content but can’t lie…it’s a bit awkward and cringey using the term sexy during your tutorial bro 🤷🏽
@hardipgajera2316
@hardipgajera2316 3 года назад
I hate when you repete sexy-sexy
Далее
Migrating to Combine
22:51
Просмотров 19 тыс.
А ВЫ УМЕЕТЕ ПЛАВАТЬ?? #shorts
00:21
Просмотров 880 тыс.
Laid Off, AI is Coming
13:06
Просмотров 3,5 тыс.
Svelte 5's Secret Weapon: Classes + Context
18:14
Просмотров 18 тыс.
STOP Using Classes In JavaScript | Prime Reacts
14:02
Просмотров 234 тыс.
microsoft doubles down on recording your screen
10:00
Unit testing Asynchronous Code In Swift ✅
36:01
Просмотров 2,9 тыс.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Intro to Unit Testing in Swift
17:34
Просмотров 33 тыс.