The Beginners Guide to Unit Testing with Xcode

Wayne Bishop
Swift Algorithms & Data Structures
4 min readDec 20, 2018

--

Software construction is a complex process. Beyond mastering the various tools and programming languages, there’s also understanding various software development roles. As most of us know, great projects don’t just involve coding. Large projects also involve other resources for requirements gathering, prototyping and testing.

The process of validating code is often referred to as Quality Assurance. However, the phrase is somewhat misleading. Instead of assuring code quality, the real objective is to measure it — often as the project evolves. Also known as test-driven development (e.g. TDD), this subtle difference can be seen when examining the quality function roles. These include the following:

WHY UNIT TESTS?

As shown, quality measurement is often grouped into automated and manual activities. As someone interested in algorithms, additional code known as unit tests work to test your primary software project. Unit tests are usually written by developers and are the focus in a TDD environment. For example, unit tests are essential in the development of this book. Using the iOS XCTest Framework, let’s review how unit testing works in Swift.

--

--

Wayne Bishop
Swift Algorithms & Data Structures

I write about Swift Development & Computer Science. Get more tips on technical interview preparation at — www.waynewbishop.com