Activity › Forums › Salesforce® Discussions › What is the difference between Mock and Stub in testing in Salesforce? Salesforce® Discussions What is the difference between Mock and Stub in testing in Salesforce? Posted by Deepak on May 13, 2020 at 8:58 AM What is the difference between Mock and Stub in testing in Salesforce? Anjali replied 6 years ago 2 Members · 1 Reply 1 Reply Anjali Member May 13, 2020 at 11:26 AM Stub: a dummy piece of code that lets the test run, but you don’t care what happens to it. Mock: a dummy piece of code, that you VERIFY is called correctly as part of the test. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me