1.Developer should prepare the test cases at the same time when they are writing the code.
2.Together with source code all test cases should be stored.
3.Use continous integration and execute tests every time the code is chnaged.
4.Avoid using rooted devices and emulators.