UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

What's your advice on unit testing?

Recorded – watch the full episode on YouTube.

What are your thoughts on unit testing?" Because ultimately, we want to make sure we have high quality tested software. What approach do you take when teaching folks to build apps with SwiftUI to help them test code with unit testing?

Meng To: I have to be very honest with you. I haven't done a lot of unit testing at all. I live on the edge to be honest, and I'm not a fine example of someone who does testing for everything.

And I also like to work a lot by myself or with a very small team. Which means that I also don't work on big, big projects. I know the value of unit testing. We've we tried to do that at some point when I was working with senior iOS developers and we just couldn't get it to be deep enough for me to say, well, this is really crucial. But I understand the importance of it. I cannot offer a good opinion that would help anyone.

Paul Hudson: Obviously your code is perfect, right? It doesn't crash. So tests aren't required!

“And a lot of people, especially the juniors, they finish their work too quick. They don't really look after. They don't test 10 ways. For me, I'm paranoid. When I have to launch something I'm so paranoid. I would refresh it 10 times. I would go back into the design to make sure everything looks great.”

Meng To: No, it's just that to me, regardless if you're using unit testing or not, your QA should be here. In the team, we always speak about QA, everything you do. And it's one of the most difficult things to do, regardless if you're a developer or a designer.

You always tend to think, “okay, my work is done here.” You're always like, “hey, let's move to the next project” or “let's move to the next thing.” And a lot of people, especially the juniors, they finish their work too quick. They don't really look after it – they don't test 10 ways.

For me, I'm paranoid. When I have to launch something I'm so paranoid. I would refresh it 10 times. I would go back into the design to make sure everything looks great – the design system, the presentation, but especially testing. I have to look into my device. I have to spend so many times clicking everything, making sure that everything works.

So for me, because I have been doing this for more than 20 years, it feels like I test everything. And I've never found the huge need, at least for the size of my apps, to really get into the automation and the old unit testing and all that stuff. Again, I cannot offer a better opinion more than that, in terms of unit testing, but in terms of QA, I can definitely say that it's so, so important. And please test your design, test your app, make sure that everything's going to work well.

This transcript was recorded as part of Swiftly Speaking. You can watch the full original episode on YouTube, or subscribe to the audio version on Apple Podcasts.

Listen on Apple Podcasts

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.