Keyboard Shortcuts
Likes
Search
Re: Swift UI for iOS Apps - What I'm learning...
On Sun, Feb 14, 2021 at 3:08 PM <david@...> wrote:
Welcome! A card flipping App doesn't have much business logic nor Obj model - but has lots of views in the SwiftUI world.? So testing the View layer is the primary need.? Trying to learn the UI testing layer inside of Xcode is very difficult... can't seem to find much documentation.? All the examples of course WORK... but my attempts do not... so learning from "canned examples" is not fruitful. My primary advice to anyone in this position would be to separate Learning Tests from test-driving behavior in your application. I tend to write my Learning Tests in a separate _project_, the copy/paste my learning. The flow goes like this: - Intend to build some UI for feature F - Do some incremental UI building with "microtesting" by manual inspection - Something unexpected happens or I can't figure out immediately how to do something - Switch to my "Learn Swift UI Toolkit" project - Try to do it there, complete with automated tests, even if they are slow and crappy - Get a minimal example of what I want working - Clean up before moving on: write some documentation (just bullet points) of what I've learned while it's fresh - Make coffee - Switch back to my application project - Do more incremental UI building with manual "microtesting" and see that it now just works I'm assuming, by the way, that writing automated view implementation tests in Swift sucks. It usually does. If it doesn't, then I rely more on automated tests, but I still do the learning in a separate project where I force myself to understand more clearly what I'm trying to do. That helps me avoid falling into the hole of having something "happen to work" because Their Framework has some Big Dependency that I didn't know about. Do you do anything like this? Would you? What do you think about it? When I don't do this, I typically regret it eventually.
Excellent! BTW, please update your front page: > Fridays in November about 5:30pm CT we are going to develop a Baseball App with TDD - you are welcome to join in. I know how easy it is not to notice those things. :) I want to promote this. What exactly do you want eyeballs on right now? I'll send as many as I can. J. B. (Joe) Rainsberger :: ?:: :: -- J. B. (Joe) Rainsberger :: :: :: Teaching evolutionary design and TDD since 2002 |