November 10, 2002 Unit tests | ||||
---|---|---|---|---|
| ||||
Hi, I've been watching D for a bit now, and I do like what I see. I have a quick observation about unit tests.. I write unit tests for most of my code (using JUnit for java), and I find them very useful. The idea of making it part of the language is interesting, but I should warn you about putting it alongside the code you're testing. Personally, and I know some people might agree, I wouldn't want to have a whole bunch of unit tests sitting in my production code. The files would just be so long, cluttered, and hard to read through. It might also cause some annoyances with source control if you update your tests often, since they're in the same files as the actual code. We should get more opinions on this, and perhaps try to reach a consensus on what the best solution is? Curt |
November 10, 2002 Re: Unit tests | ||||
---|---|---|---|---|
| ||||
Posted in reply to Curtis d'Entremont | I personally find that putting the unit tests right next to the code means I am much more likely to make the unit tests up to date and comprehensive. Of course, they can always just be moved to another file, or aggregated at the end of the source file if their presence is distracting. "Curtis d'Entremont" <038535d@acadiau.ca> wrote in message news:aqk8pa$2jpn$1@digitaldaemon.com... > Hi, I've been watching D for a bit now, and I do like what I see. I have a quick observation about unit tests.. > > I write unit tests for most of my code (using JUnit for java), and I find them very useful. The idea of making it part of the language is interesting, but I should warn you about putting it alongside the code you're testing. Personally, and I know some people might agree, I wouldn't want to have a whole bunch of unit tests sitting in my production code. The > files would just be so long, cluttered, and hard to read through. It might also cause some annoyances with source control if you update your tests often, since they're in the same files as the actual code. > > We should get more opinions on this, and perhaps try to reach a consensus on > what the best solution is? > > Curt > > |
Copyright © 1999-2021 by the D Language Foundation