Too Long; Didn't Read
The main purpose of testing is to save money and time. Testing software is necessary in order to make sure that the program or certain parts of it meet specific requirements. Testing is easier because microcontrollers are mainly designed for simple tasks. The main difficulty is that the environment where the program executes depends on the model and manufacturer of the controller. There are three main options for running tests on embedded systems: local testing (on the host machine), simulation, testing the MCU in simulation and testing the firmware on real MCU.