Requiring Namespaces
A test namespace has a singular purpose to test a matching application namespace. Therefore the idiomatic approach is to :refer
specific functions from clojure.test
as those functions are used.
The namespace to be tested is referred using the alias SUT
meaning system under test.
The alias highlight the exact functions being tested in the body of the code. This provides a visual way to separate functions under test with other test functions, especially if there are helper functions or vars used for test data.
In the above example it is easy to see which namespaces the functions being tested are from. The dictionary
namespace is a source of data for those tests.
SUT alias - system under test
The alias SUT
, meaning system under test, is a common convention in software testing. Using the SUT alias makes it easier for developers to see which functions from the application are being tested at a glance.