Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
Vytenis edited this page Nov 4, 2017 · 1 revision

Why tests are important

Each type of testing differs and have specific purposes.

  1. Tests allows you to make big changes to code quickly. You know it works now because you've run the tests, when you make the changes you need to make, you need to get the tests working again. This saves hours.
  2. TDD helps you to realize when to stop coding. Your tests give you confidence that you've done enough for now and can stop tweaking and move on to the next thing.
  3. TDD helps with coding constipation. When faced with a large and daunting piece of work ahead writing the tests will get you moving quickly.
  4. Unit Tests help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outputs you'd expect from that.
  5. Good unit tests can help document and define what something is supposed to do
  6. Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again.

Unit Testing

validates that each unit of the software performs as expected.

Integration Testing

Ensures that the units work good together

User Interface Testing (End-to-end Testing)

Tests the application interfaces by the user perspective

Test Driven Development (TDD)

  1. Code visual part of a component including styles
  2. Write tests with snapshots
  3. Write Tests before coding
  4. Code until tests pass
  5. Refactor
  6. Find a bug? Write a unit test for it, fix the bug.