why mock testing in isolation is easier as mentioned in the introductiontesting unit (whether that is classa functiona module etc is easier in isolation then when dependent on external classesfunctionsmodules etc the real thing is not available in many cases it is necessary to mock out part of system or an interface to another system because the real thing is just not available this could be for several reasons including that it has not been developed yet in the natural course of software development some parts of system are likely to be developed and ready for testing before other parts if one part relies on another part for some element of its operation then the system that is not yet available can be mocked out in other situations the development team or test team may not have access to the real thing this may because it is only available within production context for exampleif software development house is developing one subsystem it may not have access to another subsystem as it is proprietary and only accessible once the software has been deployed within the client organisation real elements can be time consuming we want our tests to run as quickly as possible and certainly within continuous integration (cienvironment we want them to run fast enough that we can repeatedly test system throughout the day in some situations the real thing may take significant amount of time to process the test scenario as we want to test our own code we may not be worried about whether system outside of our control operates correctly or not (at least at this level of testingit may still be concern for integration and system testingwe can therefore improve the response times of our tests if we mock out the real system and replace it with mock that provides much faster response times (possibly because it uses canned responsesthe real thing takes time to set up in continuous integration (cienvironmentnew builds of system are regularly and repeatedly tested (for example whenever change is made to their codebasein such situations it may be necessary to configure and deploy the final system to suitable environment to perform appropriate tests if an external system is time consuming to configuredeploy and initialise it may be more effective to mock that system out difficult to emulate certain situations it can be difficult within test scenario to emulate specific situations these situations are often related to error or exceptional circumstances that should never happen within correctly functioning environment howeverit may well be necessary to validate that if such situation does occurthen the software can deal with that scenario if these scanners are related to how external (the unit under testsystem fail or operate incorrectly then it may be necessary to mock out these systems to be able to generate the scenarios we want repeatable tests by their very nature when you run test you either want it to pass or fail each time it is run with the same inputs you certainly do not want tests that pass sometimes and fail other times this mean that there is no confidence in the tests and people often start ignoring failed tests this situation can