Re: JUnit shouldn't be advertised as only for "unit testing"
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <CA+nPnMzR57kkSTyqg-Jsg-CcR-5r+9F75RWK9cO_CfUoJa3sBw@mail.gmail.com> |
Well the way I see it, JUnit has more focus towards unit testing. When writing integration tests and acceptance tests I observe that it is harder for people to ensure that tests are isolated and independent of sequencing effects. Some times this can be for practical purposes such as execution time. It can be quicker to chain a number of scenarios together one after the other. I do not say that this is the correct way to write non-unit tests... but it is an observed pattern JUnit works hard to maintain the contract that test execution order is indeterminate... one might even say it does not work hard enough... but by virtue of the indeterminate execution order contract (that was very poorly enforced prior to Java 7) the framework has a bias to the sorts of tests that are more isolated... On 6 October 2014 19:25, 'KARR, DAVID' [email protected] [junit] < [email protected]> wrote: > One thing I battle in my work is a misconception about what "unit testing" > is, and what "JUnit" is for. In my view, there are three kinds of > automated tests: unit, integration, and acceptance. You can easily use > JUnit to write automated tests for all of these. I often run into people > who are confused by this, because they think that anything using JUnit is a > unit test. Even the first page of the JUnit web page adds to this > confusion. It says: > > "JUnit is a simple framework to write repeatable tests. It is an > instance of the xUnit architecture for unit testing frameworks." > > The first statement is good, but not the second one. It would be better > to change "unit testing" to "automated testing", although "repeatable > tests" is ok. I don't think there's much point in writing "repeatable > tests" unless you're going to automate them. > > The wikipedia page on JUnit is even worse in this regard. No one here is > technically responsible for that, but it would be a good idea to revise > that (I started to look at editing that, but I'd prefer to collaborate with > existing authors of the page). It should emphasize that JUnit can and > should be used for any kind of Java-based automated testing, even with > acceptance testing, which could be used to test deployed packages written > in any programming language. > > > ------------------------------------ > Posted by: "KARR, DAVID" <[email protected]> > ------------------------------------ > > > ------------------------------------ > > Yahoo Groups Links > > > >