Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B227FCF67 for ; Wed, 19 Jun 2013 12:54:47 +0000 (UTC) Received: (qmail 29776 invoked by uid 500); 19 Jun 2013 12:54:45 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 29746 invoked by uid 500); 19 Jun 2013 12:54:45 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 29735 invoked by uid 99); 19 Jun 2013 12:54:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 12:54:45 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.118.227.12] (HELO smtp002.rapid7.com) (208.118.227.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 12:54:41 +0000 Received-SPF: None (smtp002.rapid7.com: no sender authenticity information available from domain of Ben_Boule@rapid7.com) identity=mailfrom; client-ip=10.3.20.111; receiver=smtp002.rapid7.com; envelope-from="Ben_Boule@rapid7.com"; x-sender="Ben_Boule@rapid7.com"; x-conformance=spf_only Received-SPF: None (smtp002.rapid7.com: no sender authenticity information available from domain of postmaster@BOSTONEX.tor.rapid7.com) identity=helo; client-ip=10.3.20.111; receiver=smtp002.rapid7.com; envelope-from="Ben_Boule@rapid7.com"; x-sender="postmaster@BOSTONEX.tor.rapid7.com"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="4.87,896,1363147200"; d="scan'208,217";a="9509266" Received: from unknown (HELO BOSTONEX.tor.rapid7.com) ([10.3.20.111]) by smtp002.rapid7.com with ESMTP/TLS/AES128-SHA; 19 Jun 2013 08:54:20 -0400 Received: from BOSTONEX.tor.rapid7.com ([::1]) by BOSTONEX.tor.rapid7.com ([::1]) with mapi id 14.01.0270.001; Wed, 19 Jun 2013 08:54:20 -0400 From: Ben Boule To: "user@cassandra.apache.org" Subject: RE: Unit Testing Cassandra Thread-Topic: Unit Testing Cassandra Thread-Index: AQHObH8KizDQ+WaDpUSRV3geJp5yxpk8434AgABctAD//74HzA== Date: Wed, 19 Jun 2013 12:54:19 +0000 Message-ID: <72199978CE4FB345A2A454C6FEAAB4250D357729@BOSTONEX.tor.rapid7.com> References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.100.68] Content-Type: multipart/alternative; boundary="_000_72199978CE4FB345A2A454C6FEAAB4250D357729BOSTONEXtorrapi_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_72199978CE4FB345A2A454C6FEAAB4250D357729BOSTONEXtorrapi_ Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Shabab, Cassandra-Unit has been helpful for us for running unit tests without requi= ring a real cassandra instance to be running. We only use this to test ou= r "DAO" code which interacts with the Cassandra client. It basically start= s up an embedded instance of cassandra and fools your client/driver into us= ing 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 ot= her 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/loa= d) testing. Let us keep integration aside for now. I do see some stuff out there but wanted to know recommendations from the c= ommunity given their experience. Regards, Shahab On Wed, Jun 19, 2013 at 3:15 AM, Stephen Connolly > wrote: Unit testing means testing in isolation the smallest part. Unit tests should not take more than a few milliseconds to set up and verif= y 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 bi= ts 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 perf= ormance/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 p= rivileged. The information is intended for the use of the individual or ent= ity named above. If you are not the intended recipient, be aware that any d= isclosure, 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. --_000_72199978CE4FB345A2A454C6FEAAB4250D357729BOSTONEXtorrapi_ Content-Type: text/html; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
Hi Shabab,

Cassandra-Unit has been helpful for us for running unit tests without requi= ring 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 p= ort 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 ot= her in the embedded database.

Setup/tear down time is pretty reasonable.

Ben
From: Shahab Yunus [shahab.yunus@gmail.co= m]
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 perform= ance (stress/load) testing. Let us keep integration aside for now.

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

Regards,
Shahab


On Wed, Jun 19, 2013 at 3:15 AM, Stephen Connoll= y <st= ephen.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 typi= cally use mocking (either by hand, or with mocking libraries) to mock out t= he bits not under test.

Extensive use of mocks is usually a smell of code that is not well des= igned *for testing*

If you intend to test components integrated together... That is integr= ation 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 lo= oking for them in the context of "unit testing" as those things a= re *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/utilitie= s out
there for unit testing Cassandra stores? I am looki= ng 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 o= r 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 an= y disclosure, copying, distribution or use of the contents of this informat= ion is prohibited. If you have received this electronic transmission in err= or, please notify us by e-mail at (postmaster@rapid7.com) immediately.

<= /body> --_000_72199978CE4FB345A2A454C6FEAAB4250D357729BOSTONEXtorrapi_--