| Newsgroups |
gmane.comp.java.junit.user |
| Message-ID |
<B8D164BED956C5439875951895CB4B22269BDB8B@CAFRFD1MSGUSRIA.ITServices.sbc.com> |
It’s certainly true that it’s harder to isolate sequencing effects with integration and acceptance tests. Are you trying to say that because of that, you shouldn’t use JUnit for writing those tests?
I also agree that JUnit has “more focus towards unit testing”, but that’s because we emphasize that you should write more unit tests compared to integration and acceptance tests, because you get more overall value from them.
JUnit is a framework for writing automated tests (in my view). It’s perfectly fine to say that unit tests should be emphasized over integration and acceptance tests. Trying to say that JUnit should only be used for writing unit tests just adds to people’s confusion, as that certainly isn’t true.
From: [email protected] [mailto:[email protected]]
Sent: Monday, October 06, 2014 12:28 PM
To: [email protected]
Subject: Re: [junit] JUnit shouldn't be advertised as only for "unit testing"
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]<mailto:[email protected]> [junit] <[email protected]<mailto:[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]<mailto:[email protected]>>
------------------------------------
------------------------------------
Yahoo Groups Links