Unit testing a software code is done by path testing, which is a white box testing method. It is ideal for understanding how software functions internally.