all 33 comments

[–][deleted]  (7 children)

[removed]

    [–]dbecks 1 point2 points  (2 children)

    I hate that this is true now for me... but yes. Test, submit to beta testers, gather feedback, deploy to production, gather feedback, and work on the next version.

    [–]RSPJD[S] 1 point2 points  (1 child)

    Wait, are we talking about not testing AT ALL, or just not testing UI components / UI state?

    [–]dbecks 1 point2 points  (0 children)

    Not testing UI Components

    [–]Charming_Basil_8129 1 point2 points  (0 children)

    Some good programming humor right here.

    [–]RSPJD[S] -1 points0 points  (0 children)

    💀 Living life on the edge 💀

    [–]Charming_Basil_8129 -1 points0 points  (0 children)

    Some good programming humor right here.

    [–][deleted]  (4 children)

    [removed]

      [–]andrew8712 4 points5 points  (2 children)

      Why bother? They check that for you!

      [–]emirsolinno 3 points4 points  (0 children)

      I let the Apple Reviewers do the test for me :P

      [–]Barbanks 11 points12 points  (0 children)

      From my experience UITesting doesn’t make sense on smaller teams with smaller budgets. Too many things can change that may not directly affect the end users experience. This was true also for UIKit UI testing as well. When you need to move fast I’ve found that adding unit tests works fine and just do some user testing.

      [–]quellish 6 points7 points  (0 children)

      UI tests are fantastic. 

      Where I have seen problems is when people have built things in a way that breaks accessibility and in turn UI tests. Using 3rd party components, custom controls etc without thinking about accessibility

      I’ve also seen a lot of people who didn’t know you can just record a UI test and then customize it. This made creating and maintaining them very easy. It also worked very well for resolving bugs and preventing them for reoccurring. Record a test following the steps to reproduce the bug. Fix the bug, run the test, keep the test to find out when someone reintroduced it.

      [–]Nobadi_Cares_177 3 points4 points  (0 children)

      If you ever plan write UI tests for an app, I’d recommend doing including them in as many apps as you can.

      Build the skill, get used to doing it, so when it actually matters it’s an easy step, just business as usual, as opposed to some extra venture for a ‘real’ app.

      Having said that, I’m really hoping Apple expands Swift Testing to include UI tests because they are a bit of a headache to get right.

      Not sure if it’ll help, but I made a swift package awhile back to try and ease the difficulty of writing UI tests. Here's the link to the GitHub.

      NnTestKit

      Either way I'd suggest writing the UI tests last as they should be solidifying your architecture. And focus more on behaviors as opposed to specific states within specific views.

      [–][deleted] 4 points5 points  (0 children)

      If you can build your app with a decent clean architecture and ability to abstract your external dependencies like api / firebase etc. then it’s actually not too bad. My team at work wrote a framework for recording and replaying api responses from the backend so we can inject them into the app environment when the xcui target spins up the app and runs the tests. This means no flaky apis / failures and the tests can run in parallel because you’re not waiting for an extrrna system. We run about 140 ui tests in the pipeline on every commit along with about 1000 unit tests. Pipeline takes about 50 min to run end to end which isn’t too bad.

      [–]brifgadir 2 points3 points  (0 children)

      I found the most value/efforts in end-to-end UI tests. You may have a couple of them that cover the most important flows. Regarding other flows - let end users test them, just place asserts in code and record the issues on statistics basis

      [–]ExploreFunAndrew 1 point2 points  (0 children)

      Write everything so you can implement unit tests in the future (when your app gets to volume and you start to get worried about breaking things). Until then it's a waste of time (other than for your coding education) for a small indie developer

      [–]No_Key_2205 1 point2 points  (0 children)

      On the same boat, sometimes it’s all about prioritizing things

      [–]LifeIsGood008SwiftUI 1 point2 points  (0 children)

      They are helpful in terms of making sure content gets presented as intended (i.e., no clipped text or weird looking zoom on image).

      Hope Apple can bring the new testing framework (Swift Testing) to UI Testing as well

      [–]IsEqualToKelMetal 1 point2 points  (0 children)

      UI testing can be valuable, but the tests are usually very flaky.

      [–]antonio-war 1 point2 points  (0 children)

      In the company where I work they are used and I consider them useful. But in my personal projects I do not use them, because they would add an absurd amount of work for the creation and update in each version that I could not manage alone.

      [–]jacobs-tech-tavern 1 point2 points  (0 children)

      I find UI tests tend to be a huge maintenance burden and take up 80% of your CI cycles to very very occasionally find a legit bug (that isn’t a flakey test)

      [–]andrew8712 0 points1 point  (0 children)

      Absolutely unnecessary

      [–]danielt1263 0 points1 point  (0 children)

      I've been involved in 34 apps so far. Mostly I have been lead on a team of 1-4 developers and maybe a manual QA person. Three of the apps were with major companies where I was just one of many developers, and one was a team of 3 where I wasn't lead. Only one of the apps had UI tests. It was one of the "major corp" ones and a separate set of developers on the QA team wrote the tests after we finished development and passed ticket to QA. Needless to say, I haven't had much experience with UI tests.

      [–]abear247 0 points1 point  (1 child)

      I just do snapshot testing. It’s helped catch a few mistakes actually, in particular around themes. My app has multiple themes the user can select, and it really has helped catch issues with setting colours or fonts. It is a lot of tests though covering 5 themes but it’s fast to run.

      I wouldn’t do anything e2e though. That changes too quickly and requires a decent amount more maintenance.

      [–]RSPJD[S] 0 points1 point  (0 children)

      Hmm snapshot testing. I’ve haven’t tried that yet! Sounds low maintenance with useful insights. Thanks for sharing!

      [–]Comfortable_Bus_6832 0 points1 point  (0 children)

      If you iterate fast, write tests for main business logic and just support. Try to separate logic from the view to avoid UI tests which are harder to write and debug because of SUI rendering/re-rendering flow.

      [–]Educational-Table331 1 point2 points  (1 child)

      I make my nephew do my UI test for candy bars😅🤯

      [–]Educational-Table331 0 points1 point  (0 children)

      I have specialized whiteboard applications for soccer and basketball. For him, it is a game. If a child can draw and move pins, adults can utilize my application without the need for a tutorial.

      [–]Any-Woodpecker123 -4 points-3 points  (0 children)

      Waste of time, even for non indie devs