Along with NO-VLNS (see our blog), TNT (Tiny Network Tests) is the other half of Archain’s testing framework. While the strength of NO-VLNS is in the broadband nature of its bug detection in terms of being able to run large, time-scaled network simulations, TNT takes a fine-grained approach for the testing of specific, edge case behaviour. These two approaches combined yield a framework for comprehensive network testing.
TNT utilises EUnit, a unit testing system for Erlang, along with core, highly abstract, Archain network manipulation functions and network simulation abilities. The use of EUnit allows for a lightweight and unobtrusive means of easily launching tests while using the core Archain functions allows us to define a precise, non-automined test for specific behaviour without unnecessary overhead.
Below is an example test that can be found in ar_node.erl that sets up a network, mines a block, causes a node to forget the block and tests that a truncated node can still verify and accept new blocks correctly. The testis one of many designed to make sure sharding works correctly.
In this way, it is easy to build up a large library of tests that ensures that core functionality runs as expected.
You can run the tests yourself by checking out the Archain Github repository and running