accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher <>
Subject Re: [VOTE] Deprecate mock in 1.6.0
Date Thu, 14 Nov 2013 23:18:37 GMT

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

On Thu, Nov 14, 2013 at 3:41 PM, Keith Turner <> 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] :

View raw message