This is very generic question, please find mine input over this query.
Every software is tested from the various ways such as unit testing, module integration testing, system validation testing, conformance testing, inter operability testing, regression testing and load testing. When some piece of code is changed, developer tests correcting unit test cases (positive and negative test cases) and testing team identifies and executes their test cases to ensure stability of software. Usually regression testing is done to ensure that there is no memory leak in software under test and load testing to ensure software is meeting the promised no. of supported instances/context.