Skip to content

Instantly share code, notes, and snippets.

@SteveBarnett
Last active March 16, 2017 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveBarnett/96da7478bc7ac13aef734cab9545c368 to your computer and use it in GitHub Desktop.
Save SteveBarnett/96da7478bc7ac13aef734cab9545c368 to your computer and use it in GitHub Desktop.
A few quick thoughts on testing

Why write tests?

  • Have more confidence that the code works. Important since the business depends on it.
  • Reduces the number of bugs.
  • Make changes and refactor more easily / at lower cost.
  • Save time in the long run.
  • Understand the code and make better design choices.
  • Gives you a form of documentation.

How to do it with existing code

  • Add tests for new stuff.
  • Add tests for pieces of old stuff that the new stuff touches.
  • Add tests for old stuff where you fix bugs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment