I write code primarily for personal use, but I am considering releasing an application (scientific modeling / visualization) that I originally developed for personal use.
One of my habits is to use the main method in classes to test class performance in isolation. I believe that this is probably bad to some extent (as, no doubt, various other habits stemming from self-learning and the scientific development environment). However, this was never a self-service issue that I noticed.
Would you be so kind as to confirm (or deny) that network distribution is a problem for an application released to the scientific community (the source will also be open), and if so, why?
EDIT: playing the devil's lawyer (okay, my lawyer) compared to some of the answers suggested: the “use of the application” part is expected to be a small-scale modification of the source code by non-developers (typical scientists). I know that on the receiving side, that having tests for a class built directly in this class would be quite simple for me to recognize and modify accordingly (especially if it was consistent for classes). Does something like JUnit use the same utility, referring to the audience?
MAKE A DECISION: I think the KLE answer is the best balance of careful and concise, so I chose it, but I think the comments on the discussion in Bill are also very useful. I also don’t understand why Johannes’s answer was rejected - the perspective of “how this work” is very important for the coders of the scientific community, while other answers point to various reasons why individual unit tests are probably more useful. than my current habit, they don’t actually consider this use, so his answer is far from "useless." Thanks to all current (and future) respondents, and here, to wish there was a way to combine multiple answers as the correct answer!
java
Carl
source share