Multiple books have been written on testing. There are a dozen ways to build apps using tests and/or test-driven development, and these books cover them well. So, we aren't going to dive into testing as deep as these books do. I personally lean toward doing functional tests and continuous integration testing. However, this subject also requires one complete book.
All we are going to do is cover the basics of how to do tests for your application and the particularities of doing tests with NativeScript. So, without further ado, let's get to it.