The Dopefly Tech Blog

<< The Dopefly Tech Blog Main page

How do you organize your unit tests

posted under category: ColdFusion on April 18, 2015 at 3:32 pm by MrNate

In my rush to make unit tests on my work primary development application, I've been putting unit test files all over the place. I don't think this is necessarily bad, as I've been telling myself it's better to have unit tests in the first place. Certainly unorganized unit tests is better than no unit tests whatsoever. I have a somewhat organized unit test runner, and my tests all fall into a larger test suite that provides the illusion of organization, yet still the files themselves are not organized.

So what is the best method? Unit test files in the same package (CF term for a folder) as the files they are testing? Tests in a central location? Mixed in with the model? Outside of the application you publish?

My current mode of thinking is to pull them out into a separate project, sort of a "project-contrib" project, for things like documentation and unit tests that I need, but don't want to deliver to the production web server. What do you think? What's worked for you?

TIA.

Post A Comment!
On Aug 28, 2017 at 8:48 AM Nathan Strutz (www.dopefly.com) said:
Sorry about the missing comments! I had a bit of a database snafu in 2017 and rehosting dopefly meant losing some data.
Post A Comment!