Levelling up TDD Swift Development with GitHub Copilot

AI We Go

Steven Curtis
10 min readFeb 27, 2023
Photo by Nguyen Dang Hoang Nhu on Unsplash

TDD is awesome. You catch bugs before you’ve written them. You’re forced to think about code design. Your code is well-tested from the beginning.

GitHub Copilot is also awesome.

So can I combine the two?

You bet. Let’s dive in.

Difficulty: Beginner | Easy | Normal | Challenging

Prerequisites:

It would be good to setup GitHub Copilot first.

A calculator example

I always recommend that new iOS developers study CS193p https://cs193p.sites.stanford.edu/ which is not only free, but is fantastic. In one variation of that course they go through a calculator App.

It’s a student classic. So am I able to create a simple calculator by using Copilot and TDD?

The steps

I created a new project in Xcode and then opened the same project in Visual Studio Code.

The project? A SwiftUI Project.

--

--