[Unit Testing] Unit Test as a Bug Report

When a test fails, that test failure report should be your best place to find what went wrong and give you clues to tracking the root cause.

What's in a good Test Failure Bug Report?

  1. What are you testing?
  2. What should it do?
  3. What was the output (actual behavior)?
  4. What was the expected output (expected behavior)?
(Example of good failure report)

In the screenshot above, it's clear that we are testing 'compose()'.

What is should do is to 'return a function'.

It also shows expected, and actual, addition to the operator for our assert method.

Resources:

https://medium.com/javascript-scene/what-every-unit-test-needs-f6cd34d9836d

Comments

Popular posts from this blog

[Redis] Redis Cluster vs Redis Sentinel

[Unit Testing] Test Doubles (Stubs, Mocks....etc)

[Node.js] Pending HTTP requests lead to unresponsive nodeJS