Skip to main content
added 3 characters in body
Source Link
Robbie Dee
  • 9.8k
  • 2
  • 25
  • 54

A unit test typically tests some aspect of a class (in OO languages). There is a school of thought that a unit test tests some behaviour across layers but this isn't correct (that is an integration test).

Good unit tests have a number of features - defined by the FIRST acronym.

Fast

Unit tests should be fast

Independent

It should be possible to run them independently of any dependencies

Repeatable

A test should be repeatable with no manual cleardown or set up

Self-checking

A test should be able to check its own result automatically

Timely

Tests should be written at the same time as the code under test (CUT)

A unit test typically tests some aspect of a class (in OO languages). There is a school of thought that a unit test tests some behaviour across layers but this isn't correct (that is an integration test).

Good unit tests have a number of features - defined by the FIRST acronym.

Fast

Unit tests should be fast

Independent

It should be possible to run them independently of any dependencies

Repeatable

A test should be repeatable with no manual cleardown or set up

Self-checking

A test should be able to check its own result automatically

Timely

Tests should written at the same time as the code under test (CUT)

A unit test typically tests some aspect of a class (in OO languages). There is a school of thought that a unit test tests some behaviour across layers but this isn't correct (that is an integration test).

Good unit tests have a number of features - defined by the FIRST acronym.

Fast

Unit tests should be fast

Independent

It should be possible to run them independently of any dependencies

Repeatable

A test should be repeatable with no manual cleardown or set up

Self-checking

A test should be able to check its own result automatically

Timely

Tests should be written at the same time as the code under test (CUT)

Source Link

A unit test typically tests some aspect of a class (in OO languages). There is a school of thought that a unit test tests some behaviour across layers but this isn't correct (that is an integration test).

Good unit tests have a number of features - defined by the FIRST acronym.

Fast

Unit tests should be fast

Independent

It should be possible to run them independently of any dependencies

Repeatable

A test should be repeatable with no manual cleardown or set up

Self-checking

A test should be able to check its own result automatically

Timely

Tests should written at the same time as the code under test (CUT)