Unit Testing
26 October, 2020
You have made great strides in your ability to author software free of syntax errors. It's a wonderful feeling when a program runs successfully for the first time!
How do you know, though, when you are truly done solving a defined puzzle or problem? How do you know that your code is free of logical errors?
That's where unit testing comes in, and that's what this series of tutorials are all about.
Manual Unit Testing
For The Cell Sell puzzle, here is a test plan for verifying a solution.
Read more about how to conduct manual unit testing here.
Automated Unit Testing
While manual unit testing is the easiest to do, it is quite tedious.
It is also prone to error. What if we make a mistake when entering input? Or fail to correctly check that the output matches what is expected?
Computers are great at not making these kinds of mistakes. Learn how to use and author automated unit tests.
Creating a New Unit Testing Target
There is a little bit of work required to set up a new group of automated unit tests for an existing puzzle.
This tutorial explains how to use Xcode to add a new unit testing target.