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

2018-03-27 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Mar 27, 2018 at 09:27:16AM -0400, Steven Schveighoffer via Digitalmars-d-announce wrote: > On 3/26/18 9:26 AM, Atila Neves wrote: > > On Friday, 23 March 2018 at 14:54:57 UTC, Steven Schveighoffer wrote: [...] > > > It's simple. Unittests in imported modules should not be visible. > > >

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

2018-03-27 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/26/18 9:26 AM, Atila Neves wrote: On Friday, 23 March 2018 at 14:54:57 UTC, Steven Schveighoffer wrote: On 3/22/18 6:59 AM, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Atila It's simple. Unittests in imported modules should not be visible. They should be

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

2018-03-26 Thread Atila Neves via Digitalmars-d-announce
On Friday, 23 March 2018 at 14:54:57 UTC, Steven Schveighoffer wrote: On 3/22/18 6:59 AM, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Atila It's simple. Unittests in imported modules should not be visible. They should be compiled as if -unittest was not passed.

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

2018-03-25 Thread H. S. Teoh via Digitalmars-d-announce
On Sun, Mar 25, 2018 at 04:22:32PM +, pineapple via Digitalmars-d-announce wrote: > I really like `unittest`. It's my personal conviction that a developer > should not be able to view the documentation, tests, or implementation > for some part of a code base in isolation. `unittest` makes it

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

2018-03-25 Thread pineapple via Digitalmars-d-announce
I really like `unittest`. It's my personal conviction that a developer should not be able to view the documentation, tests, or implementation for some part of a code base in isolation. `unittest` makes it easier for me to work this way. Automated tests are vital for stability and

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

2018-03-24 Thread Jacob Carlborg via Digitalmars-d-announce
On 2018-03-23 21:43, H. S. Teoh wrote: Yep. As I mentioned elsewhere, recently I've had to resort to external testing for one of my projects, and I'm still working on that right now. And already, I'm seeing a liability: rather than quickly locating a unittest immediately following a particular

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

2018-03-24 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/23/18 9:54 PM, Tony wrote: I said my "original reply", meaning the one where I first mentioned Test-Driven Development. That was to something that Steven Schveighoffer said (although I did not reply directly to his message, but replied to his comment that was still in H.S. Teoh's

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

2018-03-23 Thread Tony via Digitalmars-d-announce
On Saturday, 24 March 2018 at 01:15:46 UTC, Jonathan M Davis wrote A number of us have nothing good to say about TDD. That's fine. That's why they have menus in restaurants. But saying it is an inferior method is different than saying it won't work or can't be used in a maintenance

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

2018-03-23 Thread Jonathan M Davis via Digitalmars-d-announce
On Saturday, March 24, 2018 00:51:07 Tony via Digitalmars-d-announce wrote: > On Saturday, 24 March 2018 at 00:12:23 UTC, Jonathan M Davis > > wrote: > > On Friday, March 23, 2018 22:42:34 Tony via > > > > Digitalmars-d-announce wrote: > >> On Friday, 23 March 2018 at 22:32:50 UTC, H. S. Teoh

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

2018-03-23 Thread Tony via Digitalmars-d-announce
On Saturday, 24 March 2018 at 00:12:23 UTC, Jonathan M Davis wrote: On Friday, March 23, 2018 22:42:34 Tony via Digitalmars-d-announce wrote: On Friday, 23 March 2018 at 22:32:50 UTC, H. S. Teoh wrote: > On Fri, Mar 23, 2018 at 09:45:33PM +, Tony via > > Digitalmars-d-announce wrote: >> On

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

2018-03-23 Thread Jonathan M Davis via Digitalmars-d-announce
On Friday, March 23, 2018 22:42:34 Tony via Digitalmars-d-announce wrote: > On Friday, 23 March 2018 at 22:32:50 UTC, H. S. Teoh wrote: > > On Fri, Mar 23, 2018 at 09:45:33PM +, Tony via > > > > Digitalmars-d-announce wrote: > >> On Friday, 23 March 2018 at 20:43:15 UTC, H. S. Teoh wrote: > >>

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

2018-03-23 Thread Tony via Digitalmars-d-announce
On Friday, 23 March 2018 at 22:32:50 UTC, H. S. Teoh wrote: On Fri, Mar 23, 2018 at 09:45:33PM +, Tony via Digitalmars-d-announce wrote: On Friday, 23 March 2018 at 20:43:15 UTC, H. S. Teoh wrote: > On Friday, 23 March 2018 at 19:56:03 UTC, Steven > Schveighoffer wrote: > > I've worked on

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

2018-03-23 Thread H. S. Teoh via Digitalmars-d-announce
On Fri, Mar 23, 2018 at 09:45:33PM +, Tony via Digitalmars-d-announce wrote: > On Friday, 23 March 2018 at 20:43:15 UTC, H. S. Teoh wrote: > > > > > I've worked on a project where the testing was separated from the > > > code, and it was a liability IMO. Things would get missed and not > > >

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

2018-03-23 Thread Tony via Digitalmars-d-announce
On Friday, 23 March 2018 at 20:43:15 UTC, H. S. Teoh wrote: I've worked on a project where the testing was separated from the code, and it was a liability IMO. Things would get missed and not tested properly. That's where Test Driven Development comes in. Yep. As I mentioned elsewhere,

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

2018-03-23 Thread Jonathan M Davis via Digitalmars-d-announce
On Friday, March 23, 2018 13:43:15 H. S. Teoh via Digitalmars-d-announce wrote: > Yep. As I mentioned elsewhere, recently I've had to resort to external > testing for one of my projects, and I'm still working on that right now. > And already, I'm seeing a liability: rather than quickly locating

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

2018-03-23 Thread H. S. Teoh via Digitalmars-d-announce
On Fri, Mar 23, 2018 at 03:56:03PM -0400, Steven Schveighoffer via Digitalmars-d-announce wrote: [..] > Note that a frequent complaint of std.datetime (at least when it was > one module) is that the file was too big. While it does hold a lot of > functionality, the majority of the file size is

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

2018-03-23 Thread H. S. Teoh via Digitalmars-d-announce
On Fri, Mar 23, 2018 at 07:46:34PM +, Johan Engelen via Digitalmars-d-announce wrote: > On Thursday, 22 March 2018 at 15:18:40 UTC, Jacob Carlborg wrote: [...] > > I completely agree. Although my reason is mostly because there will > > be too much code in a single file if the regular code and

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

2018-03-23 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/23/18 3:46 PM, Johan Engelen wrote: On Thursday, 22 March 2018 at 15:18:40 UTC, Jacob Carlborg wrote: On Thursday, 22 March 2018 at 11:00:31 UTC, Atila Neves wrote: Direct link: https://atilanevesoncode.wordpress.com/2018/03/22/keep-d-unittests-separated-from-production-code/ I

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

2018-03-23 Thread Johan Engelen via Digitalmars-d-announce
On Thursday, 22 March 2018 at 15:18:40 UTC, Jacob Carlborg wrote: On Thursday, 22 March 2018 at 11:00:31 UTC, Atila Neves wrote: Direct link: https://atilanevesoncode.wordpress.com/2018/03/22/keep-d-unittests-separated-from-production-code/ I completely agree. Although my reason is mostly

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

2018-03-23 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/22/18 6:59 AM, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Atila It's simple. Unittests in imported modules should not be visible. They should be compiled as if -unittest was not passed. Even Walter and Andrei are supportive:

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

2018-03-23 Thread bauss via Digitalmars-d-announce
On Friday, 23 March 2018 at 00:47:20 UTC, Tony wrote: I think unittest blocks are good for write-once and quick-and-dirty projects, or as a first-cut of testing that ultimately gets moved to a full-grown test suite in a separate project. I'd prefer not to read source code that has unittest

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

2018-03-22 Thread Tony via Digitalmars-d-announce
I think unittest blocks are good for write-once and quick-and-dirty projects, or as a first-cut of testing that ultimately gets moved to a full-grown test suite in a separate project. I'd prefer not to read source code that has unittest blocks inter-mixed with the actual code.

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

2018-03-22 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Mar 22, 2018 at 05:29:52PM +, Anton Fediushin via Digitalmars-d-announce wrote: [...] > Oh heck yeah! I think that dub is only one of the D tools which never > disappoints me. I'm glad you found dub to your liking. I'm afraid I can't say the same, though for reasons not really

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

2018-03-22 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Mar 22, 2018 at 05:21:41PM +, Atila Neves via Digitalmars-d-announce wrote: > On Thursday, 22 March 2018 at 16:30:37 UTC, H. S. Teoh wrote: [...] > > being tested, was a big slowdown for me. I have to stop to think > > about which subdirectory under test/ I should put the relevant >

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

2018-03-22 Thread Dmitry Olshansky via Digitalmars-d-announce
On Thursday, 22 March 2018 at 10:59:56 UTC, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Agreed on most counts though I’d say D simply produced a language without regard for build tools and large projects. Many small annoying things like version(unittest) stem from

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

2018-03-22 Thread Basile B. via Digitalmars-d-announce
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:

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

2018-03-22 Thread Atila Neves via Digitalmars-d-announce
On Thursday, 22 March 2018 at 17:09:55 UTC, Marco Leise wrote: I understand your opinion and I think it is all reasonable. You talk about longer compile times since every D module is like a C++ header. That touches one of my pet peeves with the language or eco system as it stands and I wonder

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

2018-03-22 Thread Anton Fediushin via Digitalmars-d-announce
On Thursday, 22 March 2018 at 17:15:55 UTC, Anton Fediushin wrote: So? Am I wrong about dub? Let me investigate I'm not wrong! It works as expected: only package you are working with compiles with `-unittest` option. Test repo:

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

2018-03-22 Thread Atila Neves via Digitalmars-d-announce
On Thursday, 22 March 2018 at 16:30:37 UTC, H. S. Teoh wrote: On Thu, Mar 22, 2018 at 10:59:56AM +, Atila Neves via Digitalmars-d-announce wrote: Blog post: https://atilanevesoncode.wordpress.com/ [...] I realize this is your opinion, but I disagree with them because: Disagreeing is

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

2018-03-22 Thread Atila Neves via Digitalmars-d-announce
On Thursday, 22 March 2018 at 16:54:18 UTC, Anton Fediushin wrote: On Thursday, 22 March 2018 at 16:30:37 UTC, H. S. Teoh wrote: As for the dub-specific problems introduced by version(unittest): IMO that's a flaw in dub. I should not need to contort my code just to accomodate some flaw in

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

2018-03-22 Thread Anton Fediushin via Digitalmars-d-announce
On Thursday, 22 March 2018 at 17:08:18 UTC, Jonathan M Davis wrote: I could be wrong, but I am _quite_ sure that dub builds all dependencies with their test targets when you build your project with its test target. I thought so too, but I just checked and it doesn't do that. I'd better

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

2018-03-22 Thread Anton Fediushin via Digitalmars-d-announce
On Thursday, 22 March 2018 at 13:58:50 UTC, Atila Neves wrote: On Thursday, 22 March 2018 at 12:26:14 UTC, Anton Fediushin Tests in their own file is something from 90-s. It's 2018 and I want to be able to write tests anywhere I want. You _can_ write them wherever you want. I'm not arguing

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

2018-03-22 Thread Marco Leise via Digitalmars-d-announce
I understand your opinion and I think it is all reasonable. You talk about longer compile times since every D module is like a C++ header. That touches one of my pet peeves with the language or eco system as it stands and I wonder if you would agree with me on the following: Libraries should be

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

2018-03-22 Thread Jonathan M Davis via Digitalmars-d-announce
On Thursday, March 22, 2018 16:54:18 Anton Fediushin via Digitalmars-d- announce wrote: > On Thursday, 22 March 2018 at 16:30:37 UTC, H. S. Teoh wrote: > > As for the dub-specific problems introduced by > > version(unittest): IMO that's a flaw in dub. I should not need > > to contort my code just

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

2018-03-22 Thread Jonathan M Davis via Digitalmars-d-announce
On Thursday, March 22, 2018 09:30:37 H. S. Teoh via Digitalmars-d-announce wrote: > 2) Compilation times: perhaps if your unittests are too heavy, > compilation times could become a problem, but IME, they haven't been. Personally, I agree with you, but Atila is one of those folks who gets

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

2018-03-22 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Mar 22, 2018 at 10:59:56AM +, Atila Neves via Digitalmars-d-announce wrote: > Blog post: > > https://atilanevesoncode.wordpress.com/ [...] I realize this is your opinion, but I disagree with them because: 1) I've found that having unittests built into the language is a big win,

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

2018-03-22 Thread Jacob Carlborg via Digitalmars-d-announce
On Thursday, 22 March 2018 at 11:00:31 UTC, Atila Neves wrote: Direct link: https://atilanevesoncode.wordpress.com/2018/03/22/keep-d-unittests-separated-from-production-code/ I completely agree. Although my reason is mostly because there will be too much code in a single file if the regular

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

2018-03-22 Thread Atila Neves via Digitalmars-d-announce
On Thursday, 22 March 2018 at 12:26:14 UTC, Anton Fediushin wrote: On Thursday, 22 March 2018 at 10:59:56 UTC, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Atila I *love* built-in unittests. Putting them right after each function makes things so much easier. If

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

2018-03-22 Thread Atila Neves via Digitalmars-d-announce
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:

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

2018-03-22 Thread Seb via Digitalmars-d-announce
On Thursday, 22 March 2018 at 12:25:59 UTC, bauss wrote: On Thursday, 22 March 2018 at 11:47:34 UTC, Alexandru Ermicioi 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,

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

2018-03-22 Thread Anton Fediushin via Digitalmars-d-announce
On Thursday, 22 March 2018 at 10:59:56 UTC, Atila Neves wrote: Blog post: https://atilanevesoncode.wordpress.com/ Atila I *love* built-in unittests. Putting them right after each function makes things so much easier. Tests in their own file is something from 90-s. It's 2018 and I want to

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

2018-03-22 Thread bauss via Digitalmars-d-announce
On Thursday, 22 March 2018 at 11:47:34 UTC, Alexandru Ermicioi 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:

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

2018-03-22 Thread Alexandru Ermicioi via Digitalmars-d-announce
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:

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

2018-03-22 Thread Basile B. via Digitalmars-d-announce
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: