Your First iOS App: Coding in Swift

Jul 28 2026 · Swift 6.3, iOS 26, Xcode 26

Lesson 03: Intro to Test-Driven Development

Intro to Test-Driven Development

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Now that you understand the basics of Unit Testing, I want to introduce you to a way of writing apps that some developers enjoy: Test-Driven Development.

func testScorePositive() {
  var guess = game.target + 5
  var score = game.points(sliderValue: guess)
}
  XCTAssertEqual(score, 95)
func testScoreNegative() {
  var guess = game.target - 5
  var score = game.points(sliderValue: guess)
  XCTAssertEqual(score, 95)
}
See forum comments
Cinema mode Download course materials from Github
Previous: Intro to Unit Testing Next: Challenge: How to Calculate the Difference