Unit tests
Michael Feathers gives a description (https://www.artima.com/weblogs/viewpost.jsp?thread=126923) of what a unit test is not. According to Feathers, “If it talks to the database, it talks across the network, it touches the filesystem, it requires system configuration, or it can’t be run at the same time as any other test”, then it is not a unit test.
Unit tests defined this way will run incredibly quickly. They can run in parallel. They can be set up entirely in memory. Some testing schemes look at your code as you type and figure out what you touched, re-running unit tests. Others do that on check-in.
To help you learn how to perform unit tests yourself, we’ll write FizzBuzz with unit tests in Ruby, using a Ruby test framework called MiniTest
.
First, Matt used an open source tool he wrote called KataGenerator (https://github.com/heusserm/katas/blob/master/katagenerator.rb) to lay out the tests. KataGenerator takes a single word that describes...