TDD: why might it be wrong to let app code know it is being tested, not run?
In this thread , Brian (the only answerer) says "Your code should be written in such a fashion that it is testing-agnostic" The single comment says "Your code should definitely not branch on a global "am I being tested flag".". But neither gives reasons, and I would really like to hear some rational thoughts on the matter. It would be immensely easy (particularly given the fact that a lot of tests have package-private access to the app classes) to reach into a given app class and set a boolean to say "this is a test, not a run". All sorts of things which I find myself jumping through hoops