A software test is a piece of software, which executes another piece of software. It validates if that code results in the expected state (state testing) or executes the expected sequence of events (behavior testing).
Software tests help the developer to verify that the logic of a piece of the program is correct.
Running tests automatically helps to identify software regressions introduced by changes in the source code. Having the highest coverage of your code allows you to continue developing features without having to perform lots of manual tests.