|< How do you integrate components from UIKit into SwiftUI?||What are the most common design errors developers make? >|
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.
SPONSORED ViRE offers discoverable way of working with regex. It provides really readable regex experience, code complete & cheat sheet, unit tests, powerful replace system, step-by-step search & replace, regex visual scheme, regex history & playground. ViRE is available on Mac & iPad.
Link copied to your pasteboard.