Why think unit tests should be in their own source code hierarchy instead of side-by-side

Basile B. b2.temp at gmx.com
Thu Mar 22 17:44:28 UTC 2018


On Thursday, 22 March 2018 at 13:50:39 UTC, Atila Neves wrote:
> On Thursday, 22 March 2018 at 11:19:46 UTC, Basile B. wrote:
>> On Thursday, 22 March 2018 at 11:00:31 UTC, Atila Neves wrote:
>>> On Thursday, 22 March 2018 at 10:59:56 UTC, Atila Neves wrote:
>>>> Blog post:
>>>>
>>>> https://atilanevesoncode.wordpress.com/
>>>>
>>>> Atila
>>>
>>> Direct link:
>>>
>>> https://atilanevesoncode.wordpress.com/2018/03/22/keep-d-unittests-separated-from-production-code/
>>>
>>> Sorry for the forum spam.
>>>
>>> Atila
>>
>> I don't agree at all. Everything is so much faster when 
>> unittest blocks are in the same module as the stuff that are 
>> tested. Generally i think that it makes things easier.
>
> Faster as measured by what? Projects definitely take longer to 
> build and iterate on.
>
> If you think it makes things easier, great! The blog post is my 
> opinion.
>
> Atila

I was able to reach almost 100% coverage (99.2263) in my project 
Yatol just because tests are next to the code. This project has 
really convinced me of the fact that unittest are better in the 
code. This is also very good for tooling, e.g workflow in my IDE 
relies on tests being with the code (there's an action called Run 
file unittests that allows to test + cover a single module that's 
part of bigger project.)

I honestly think that the project i mention would be less tested 
if the test suite was put apart.

I don't say you are wrong, but the two or three occasional issues 
you mention in your blog post are really marginal things IMO, 
although i don't deny they are possible.


More information about the Digitalmars-d-announce mailing list