Testing, Testing and Then Testing

For a quick three-minute analysis of this blog post by two AIs generated by Google’s NotebookLM service, click on the audio player below.

I’m currently exploring how effective Claude 3.5 Sonnet is at creating, managing and expanding the test suite associated with my upcoming Wet Bulb Calculator app.

Having survived a brutal heat dome here in the Lower Mainland of BC during the summer of 2021, one that killed nearly 600 people from June 18 through to August 12, with 231 fatalities on June 29 alone, this is an app that’s more about personal survival than making money on the Apple App Store. Abrupt climate change is very real here on the West Coast, and, as the dark joke goes, “This year will be the coolest year for the rest of your life.”

My work with using Claude to generate, maintain, and enhance the test suite for the app has been a very productive experience. Just as Claude is adept at writing sophisticated code, it can also produce a rigorous test suite for its code.

I’ve structured the test suite to follow the Model-View-View Model (MVVM) architecture that Swift, SwiftUI, Combine, and Claude Love. This structure is also key to circumventing one of the biggest but logical constraints when using an AI like Claude to develop a professional-level app with a sophisticated touch-sensitive user interface.

Like all AIs, whether they tell you or not (and Claude does), Claude has a limited context window for each chat. Eventually, your conversation will grow to such a length that the AI neural net not only slows down but, no lie, starts to hallucinate. Writing and testing code in bits and pieces as discrete as possible is key. The smaller your unit of work is, the more focused your conversation can be since what’s in your context window is just the important stuff.

Plus, running the full suite of tests, which currently takes about five minutes for this pre-alpha version of the wet-bulb calculator, and getting nothing but green checkmarks gives me that warm and fuzzy feeling of confidence that motivates me to keep moving forward.

An app that calculates the wet bulb temperature in a rapidly warming world will help save people’s lives. However, it must be perfect before it is released into the wild. An attitude, in all honesty that should apply to any app.

Published by Douglas J Farmer

I'm a freelance developer of Apple ecosystem apps including the iPhone, iPad and Mac.

Leave a comment