David Saff
Posts: 9
Nickname: dsaff
Registered: Nov, 2005
|
|
Re: JUnit 4.4 Comes with a Few Assumptions, Theories, and Some New Syntax
|
Posted: Jul 23, 2007 2:13 PM
|
|
> > JUnit now includes the ability to express "assumptions" > : > > With this release, a failed assumption will lead to the > > test being marked as passing, regardless of what the > > code below the assumption may assert. In the future, > > this may change, and a failed assumption > may lead to the test being ignored > > Is this saying that a new feature is being introduced that > currently does nothing and whose future behavior > may become version dependent? It sounds like an > odd strategy.
It's an unfortunate compromise--ideally, we could have released with failed assumptions leading to ignored tests in this version, but it would have broken current IDE's.
> In addition, I'm wary of a feature that potentially > may lead to tests being ignored. Unless a test is > commented out, it would seem to me more logical that tests > should either pass or fail.
I certainly prefer tests that either pass or fail. However, if a test depends on an environment that is not currently available, it's wrong to have it pass (we don't know the code works), and wrong to have it fail (we don't know that anything's wrong with the code, just a temporary problem with the test setup.)
David Saff
|
|