DEV Community

Discussion on: Where Should Tests Live?

Collapse
 
jacmoe profile image
Jacob Moen

I quite like that testing is part of the specification, and I especially like how it works with Racket.
There, you write the specification, including docstring, template, test cases and then the implementation.

Python has something similar.

I wouldn't follow the same approach for PHP projects, C or C++ - ie any code base that is using a framework, or frameworks. Then the tests are going to be separate, but ideally supported by the frameworks I use.

Yes, it depends :)

I like the idea of thinking about the test cases while doing the spec, although it is not always possible to have that cake and eat it at the same time.