The two obvious places I can think of would be some sort of "testing" folder right next to the code I'm working on. So something like:
\project-code
\my-feature
\production-code
\testing
***my tests***
\co-workers-feature
\production-code
\testing
Or I could split out the testing code a completely separate hierarchy. So something like:
\project-code
\my-feature
\co-workers-feature
\testing-project-code
\my-feature
***my tests***
\co-workers-feature
I've seen a lot of frameworks use the second approach, but recently we've been putting our testing code within the production code mostly for convenience. Is one approach much better than the other or is there a best practice here?
Put them where it is most convenient for you. You can set up your build system to remove them from the final product, if desired. Testing is a "best practice". Anything that makes testing easier without reducing its effectiveness is simply improving on a best practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With