I did some researches and i found out that :
Sanity Testing is the type of software testing, that is performed after a software build is received with changes in functionality and code. Sanity testing is performed in order to assure that the bugs have been fixed and there are no other bugs originated with the new changes.
Regression testing is testing existing software features to make sure that a change or addition hasn't broken any existing functionality
I can't see the difference between these two testing techniques? Any clarification?
Sanity testing means checking that the application functionality still appears normal and is not obviously nonsensical. If you try the simplest happy path and the result is incorrect, it failed the sanity test.
A sanity check or sanity test is a basic test to quickly evaluate whether a claim or the result of a calculation can possibly be true. It is a simple check to see if the produced material is rational (that the material's creator was thinking rationally, applying sanity). The point of a sanity test is to rule out certain classes of obviously false results, not to catch every possible error. A rule-of-thumb or back-of-the-envelope calculation may be checked to perform the test. The advantage of performing an initial sanity test is that of speedily evaluating basic function.
Regression testing means thoroughly going over anything that could be impacted to make sure no functionality changed and no new bugs were introduced. It means figuring out all functions affected by the changed code and exercising not just the happy path but alternate flows as well.
Regression testing (rarely non-regression testing[1]) is re-running functional and non-functional tests to ensure that previously developed and tested software still performs after a change.[2] If not, that would be called a regression. Changes that may require regression testing include bug fixes, software enhancements, configuration changes, and even substitution of electronic components.[3] As regression test suites tend to grow with each found defect, test automation is frequently involved. Sometimes a change impact analysis is performed to determine an appropriate subset of tests (non-regression analysis[4]).
Sanity tests are superficial. Regression testing should be in-depth.