Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo, mail # dev - [VOTE] Deprecate mock in 1.6.0


Copy link to this message
-
Re: [VOTE] Deprecate mock in 1.6.0
Christopher 2013-11-14, 23:18
+1

I'd prefer we get a bit more rigorous about the distinction between
integration testing and unit testing. MockAccumulo walks that line too
closely, and I think it encourages writing bad tests, with the risk
that code relies on incorrect mock behavior.

I'd prefer to put some effort into making the accumulo-maven-plugin
more robust and feature-ful for actual integration testing. In the
meantime, raw MiniAccumuloCluster is suitable for ITs. For actual unit
tests, we should encourage the use of EasyMock or Mockito or something
like that, and stop trying to test end-to-end behavior in unit tests.
To unit test iterators, there's already a SortedMapIterator that
allows you to create an iterator from a TreeMap.

I don't think we should remove it anytime soon, but we should
deprecate it. The sooner we deprecate it, the less burden we have to
maintain two implementations of every new feature, and the more time
we'll have to spend time on improving the tests in other ways.
MiniAccumuloCluster can do everything that MockAccumulo can do. The
fact that it doesn't run as fast is not a good enough reason, in my
opinion, to avoid deprecating it... especially since the test cases
where it is being used (where the performance matters) blur the lines
between unit tests and integration tests... and that tends to hurt us
in terms of code coverage and test reliability.

--
Christopher L Tubbs II
http://gravatar.com/ctubbsii
On Thu, Nov 14, 2013 at 3:41 PM, Keith Turner <[EMAIL PROTECTED]> wrote:
> Should we deprecate mock accumulo for 1.6.0?  This was considered [1] for
> 1.5.0.  I started thinking about this because I never added conditional
> writer to mock.
>
> [1] : https://issues.apache.org/jira/browse/ACCUMULO-878