incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Boule <Ben_Bo...@rapid7.com>
Subject RE: Unit Testing Cassandra
Date Wed, 19 Jun 2013 12:54:19 GMT
Hi Shabab,

Cassandra-Unit has been helpful for us for running unit tests without requiring a real cassandra
instance to be running.   We only use this to test our "DAO" code which interacts with the
Cassandra client.  It basically starts up an embedded instance of cassandra and fools your
client/driver into using it.  It uses a non-standard port and you just need to make sure you
can set the port as a parameter into your client code.

https://github.com/jsevellec/cassandra-unit

One important thing is to either clear out the keyspace in between tests or carefully separate
your data so different tests don't collide with each other in the embedded database.

Setup/tear down time is pretty reasonable.

Ben
________________________________
From: Shahab Yunus [shahab.yunus@gmail.com]
Sent: Wednesday, June 19, 2013 8:46 AM
To: user@cassandra.apache.org
Subject: Re: Unit Testing Cassandra

Thanks Stephen for you reply and explanation. My bad that I mixed those up and wasn't clear
enough. Yes, I have different 2 requests/questions.

1) One is for the unit testing.

2) Second (in which I am more interested in) is for performance (stress/load) testing. Let
us keep integration aside for now.

I do see some stuff out there but wanted to know recommendations from the community given
their experience.

Regards,
Shahab


On Wed, Jun 19, 2013 at 3:15 AM, Stephen Connolly <stephen.alan.connolly@gmail.com<mailto:stephen.alan.connolly@gmail.com>>
wrote:
Unit testing means testing in isolation the smallest part.

Unit tests should not take more than a few milliseconds to set up and verify their assertions.

As such, if your code is not factored well for testing, you would typically use mocking (either
by hand, or with mocking libraries) to mock out the bits not under test.

Extensive use of mocks is usually a smell of code that is not well designed *for testing*

If you intend to test components integrated together... That is integration testing.

If you intend to test performance of the whole or significant parts of the whole... That is
performance testing.

When searching for the above, you will not get much luck if you are looking for them in the
context of "unit testing" as those things are *outside the scope of unit testing"


On Wednesday, 19 June 2013, Shahab Yunus wrote:
Hello,

Can anyone suggest a good/popular Unit Test tools/frameworks/utilities out
there for unit testing Cassandra stores? I am looking for testing from performance/load and
monitoring perspective. I am using 1.2.

Thanks a lot.

Regards,
Shahab


--
Sent from my phone

This electronic message contains information which may be confidential or privileged. The
information is intended for the use of the individual or entity named above. If you are not
the intended recipient, be aware that any disclosure, copying, distribution or use of the
contents of this information is prohibited. If you have received this electronic transmission
in error, please notify us by e-mail at (postmaster@rapid7.com) immediately.

Mime
View raw message