Testing Code Changes With Diff

Most people use the tool called “diff” to track code changes or build patches to apply to various pieces of code. A buddy of mine introduced me to a technique of using a diff almost like a unit test, where you create a set of “green bar” (known good output) files, then make changes to your code, then run diff against the newly generated output vs your green bar files.  I implemented this technique to make sure I don’t break something as I work my way through all the refactoring I want to do on boxologic’s code.  Curious about how it’s done?  Check out the test target in the make file and the bash script it runs.

Leave a Reply

Your email address will not be published. Required fields are marked *