testMode flag - how to set automatically for Development/Distribution?

I’ve read some horror stories about people accidentally clicking on AdMob ads in their own app and then getting their AdMob account disabled and no longer receiving payments.    

Now, I notice we have the testMode flag for ads.show() so that it just shows dummy ads instead, but I’m worried I’ll build a Distribution version of my app and I accidentally deploy it with the testMode flag set to true.

Is there a way in the code to detect during run-time that the build is a “Development” version and thus set the testMode flag to true, without having to remember and set it manually to false when I’m ready to distribute the app?