Legacy source code is the code that was written by you or someone else usually without tests or using an old framework, architecture, or technology. Such a code base can be difficult to rewrite or maintain. It can sometimes be tangled code that cannot be easily read and understood and as such is very difficult to change.
When faced with the daunting task of maintaining a legacy code base, especially a code base written without adequate or proper testing, writing unit tests for such code can be difficult, and a waste of time, and can result in a lot of hard work. However, using a mocking framework can greatly simplify the refactoring process, as the new code being written can be isolated from the existing code and tested ...