Let me try to summarize a bit more with a simple example:
You're building a large application, a user portal for example, with feeds, news, account management, and a whole range of difference features.
During development it's decided you need to implement mocked data, for either ease of testing, or perhaps because the APIs you are communicating with are unreliable.
Should you ever need to make changes to your core application in order to accommodate for the use of mock data, or should your application remain pure and agnostic to how it is being used, and should you instead force your mock data to find a way to inject itself into the application?
I am of the mindset that an application should not concern itself with how the outside wants to use or test it, and that to add conditional statements in the application checking whether it is mocked or not is not just bad practice, it's terrible practice. It's a complete coupling that should never even be entertained, no matter how difficult it is to get mock data into the application.
On a current assignment I'm seeing literally hundreds of references throughout the entire code base that will do different things depending on the context of data being used. This sort of stuff makes me want to cry, but maybe I just have it all wrong and there is a legitimate benefit in this?
What are some arguments for why this tight coupling could ever be a good thing?
What are your general thoughts and experience with tightly ingraining mock-data usage into the application itself?