Tuesday, February 3, 2015

Testing Cassandra applications: Stubbed Cassandra 0.6.0 released

Stubbed Cassandra (Scassandra) is an open source test double for Cassandra. Martin Fowler has a very general definition of what a test double actually is.

When I refer to a test double I mean stubbing out at the protocol level. So if your application makes calls over HTTP, your test double acts as an HTTP server where you can control the responses, and most importantly: inject faults. Wiremock is a great example of a test double for HTTP.

I like this kind of stubbing out as it allows me to really test drivers / network issues etc. Deploying to cloud environments where network/servers going down happens more frequently makes this even more important. If you're using a JVM language and all this happens in the same JVM it is also quick.

Why is this release important?


This is an important release for Scassandra as it now supports all types, previously it only supported the subset of CQL that my old employer, BSkyB, used. Now's a good time to mention that this tool was developed completely in my own time and not while working there :)

It still has lots of limitations (no user defined types, no batch statements, no LWT) but as it is designed to test individual classes it is still usable for all your code that doesn't use these features even if they are used some where in your application.

I had previously used it for full integration tests, in that case it had to support your entire schema. I have stopped doing that as I intend to build a different type of Cassandra testing tool for that using CASSANDRA-6659. This JIRA extracted an interface for handling queries, which I want to use to inject faults/delays etc. If you haven't used Scassandra before it is important to know it doesn't embed a real Cassandra, it just implements there server side of the native protocol and "pretends" to be Cassandra.

Version 0.6.0 has a view of Cassandra 3.0, where embedded collections are likely to be supported. Previously you used an enum to inform Scassnadra what your column types are, or the variables in prepared statements.  For example:


Here the withColumnTypes method on the builder informs Scassandra how to serialise the rows passed into withRows.

This worked for primitive types e.g Varchar, Text. But what about collections? Sets were supported first so I went with VarcharSet etc, bad idea! What about Maps? That is a lot of combinations, and even worse List<Map<String, Int>>?

An enum was a bad idea, so in 0.6.0 I've introduced the CqlType, this has sub classes for Primitive/Collections and there is a set of static methods and constants to make it nearly as convenient as an enum for the simple types. The advantage of this is I can now embed types inside each other e.g


And then when Cassandra 3.0 comes we can have things like map(TEXT, map(TEXT, TEXT)) for a multi map.

The end goal is actually for you to give your schema to Scassandra and it will just work this out. This is some way off as it requires being able to parse CQL and at the moment Scassandra just pattern matches against your queries.

Happy testing and as always any feature requests/feedback just ping me on twitter @chbatey

18 comments:

Emily Moore said...

Best Five Applications To Check Spelling In An Assignment. As we are human, we tend to make mistakes and are not exempt from errors. Some people make small errors, and some of them are big that can be detected by spell checker. In this case, there are several steps you can go through to ensure you receive good grades in science. In fact, the eminent science homework helper online also suggest that you follow these steps. Standard Deviation Calculator is a tool that is mainly used in statistics to calculate the standard deviation from the data, the standard error, the percentiles, the range, the COV, confidence limits or a covariance matrix. It measures the variation or dispersion between values in a set of data based on the distribution's extent of stretching or squeezing. essay writer

david anderson said...

Writing an assignment is a non-interesting activity. Why not take Accounting assignment help for getting rid of academic writing activities. It is one of the best methods that you can select for getting rid of the project works.

Becker said...

Humans are not immune from making mistakes. There are small and large errors that learners of Ignou university make, while others can be easily detected by spell-checkers. There are many steps you can take to make sure you get good grades in your Ignou MFNP12 Project. These steps are also recommended by an MSCDFSM project assistance expert. If you are looking for Ignou MSCDFSM Project feel free to order from our website.

Becker said...

Humans are not immune from making mistakes. There are small and large errors that learners of Ignou university make, while others can be easily detected by spell-checkers. There are many steps you can take to make sure you get good grades in your Ignou MFNP12 Project. These steps are also recommended by an MSCDFSM project assistance expert. If you are looking for Ignou MSCDFSM Project feel free to order from our website.

Assignment Help said...

Reading is my passion. That’s why I become super crazy to see what new is going in your post. I want to see interact you with the navigational link of Assignment Help service.

Rose Black said...

Looking at the complex academic scenarios, students must benefit from experts in that field to score better marks. They provide top-notch projects and make sure that the work gets delivered to you within a limited time. Once you take marketing assignment writing help., from a reliable site, you don’t have to worry about your project as the experts have excellent knowledge in that particular field. They even do several pieces of research, case studies, theories, and explanations regarding the topic. Moreover, you’ll get all the work errors accessible by taking a marketing assignment help, and they follow your instructions carefully, promising to keep the quality good as the original content. Even several management students lack comprehension skills, and they'll need the help of a marketing assignment expert to complete their assignments in good quality.

Lucas said...

Retten smagte skam godt, men kunne ikke leve op til forventningerne. take away lyngby hovedgade Mango Lassie, som vi nød til middagen, var helt perfekt.

Debbie Brinkmann said...

You provide a lot of useful information in your article. Recently, I wrote an article about Introduction Of CPS Or Kohi Click Speed Test. Game players who play games like Minecraft are the majority of visitors to the Kohi Click Test. The completion of a mission or winning a fight in such games requires a high level of click speed. We discuss this in the article. So, you can read this information about the Kohi Click Test - Best CPS Test!.

Max Willor said...

Your post definitely hits the right spot. Kudos for the hard work. Your suggestion to opt for a reliable online assignment help facility is definitely a practical and feasible one in today's scenario. This is where the impeccable online assignment help service by the My Assignment Help platform comes into the picture. If you are looking for a comprehensive assignment help facility that caters to all your writing requirements efficiently. Their Essay Writing Help service is definitely the one-stop service for you. You can easily place an order for your complicated academic assignments with the Myassignmenthelpau platform in three simple steps that too at highly reasonable prices.

Great Assignment Helper said...

If you are still looking for trustworthy Assignment Help your search ends here. The GreatAssignmentHelper.com has got the largest team of expert professional writers offering stranded understudies perfectly convenient and bespoke compositions worthy of outstanding grades through its Online Assignment Help desk. Besides, we provide the most affordable Assignment Help UAE.

custom boxes said...


like the futuristic spot UV, holographic foil stamping, silver foil printing, pizza boxes and various others. Moreover, branding and printing of tags, brands’ names, or signature are also among the services we provide (which works like magic for advertising purposes)

MalaysiaAssignmentHelp said...

Final year exams are approaching but the final year project is not completed yet, Don't worry just take Final year project help from Malaysia assignment help and get your final year project done by our expert team with original content at affordable rates

Gyaanshala said...

life lessons from Mahabharata are very important for us as they are very valuable in current situation.

Alex Kim said...

Nice post on Testing Cassandra applications: Stubbed Cassandra 0.6.0 released.Use chinese to english translation service singapore from Singapore translators and convert the Chinese written text of your report card into English by the help of Singapore translators. They provide you exact report card translation at the very lowest price.

Olivia Wilson said...

Are you overwhelmed with your finance assignment help and why you need education after all? All students have loaded their shoulders with the massive weight of their homework and assignments.
What is Education?
When you study to gain in-depth knowledge and understand the needs of everything you do in your daily life, this is called education. One can’t earn knowledge only from books. 
If you want to save your time from doing math assignments, you can take economics assignment help from any reputed online website.
Gives stability
No one can ever take away the stability you have gained from your education. So, you can allow yourself to take a college degree or diploma. It will help you to discover the right career path. Education opens the doors to new destinations. 
Provides financial security
If you are careful about your education, then there is a chance of getting high-paid jobs. In addition, good education will help you to practice dissertation writing help to get a good job. 
Needed for equality
We are keen to get an equal world for ourselves. And this journey should begin with education. If everyone receives the same educational opportunities, there will be no gap or different classes in society. 
It can protect you
You have no idea how education help in academic writing services. It’s not only about financial independence. People often take advantage of those persons who do not know how to write or read. 
Confidence
If you want to be successful in your life, you need to be confident. But what is the best way to edit my essay? The answer is education. It helps you to prove your knowledge. And it gives you the power of speaking your mind. 
Personal growth
Education helps us to ask questions. It boosts our self-dependency level, and the desire to know more about the world grows us internally.
Break barriers
Education helps to create a bridge between people. It allows people to be empowered. Education frees your mind.  
We have a few more services: CHC50113 Assessment Answers|GCNCP3 Assignment Answers|ITC542 Task Answers| 101644 Solutions| 102048 Answers

Writing tips said...

"1.Know Your Strengths and Weaknesses To ace any examination, it is essential which you parent out wherein you stand together along with your syllabus. For example, decide whether or not you want assist with accounting homework or a math homework helper for the intricate chapters and flip your weak spot into your strength.

2.Avoid Cramming Your Brain You need to make plans, buy groceries with friends, and do the whole lot to experience the moment – we get it. But if you want to be the subsequent topper in magnificence, begin together along with your guidance early. Divide your syllabus into small sections and goal to finish them in advance so that you can revise greater and enhance retention abilities.
3. Optimise Your Time All look at and no play make Jack a stupid boy. And it really is why college students have to consciousness on time management. Start every day with a plan and notice what you need to do. Even in case you need to binge-watch, get it at the schedule. This will allow you to manipulate time for research paper writing, family, and yourself.
4. Set Realistic Goals Regular look at desires will assist you get right into a routine. You can destroy down the chapters and set goals primarily based totally to your mastering abilities. Once you begin reaching your normal goals, the feel of achievement will encourage you to do greater.
5. Make Flashcards: It's ok in case you do not need to hold round your books and notes. Instead, make colorful flashcards for dates, definitions, problematic answers, and formulation to revise them every time you get the chance. Believe it or not, this mastering approach has helped severa college students to grasp complicated look at materials.
6. Practice What You Learn Whether accounting issues or dissertation writing, you could broaden robust educational talents best with the aid of using devoted practice."

assignment help said...

Looking for science assignment help @30% OFF? Take our help with science assignment writing to get high scores. Get quality online science assignment help by native writer.

assignment help said...

Immediate english assignment help services @50%off. Get online english assignment help from Native experts in given deadline. Plagiarism-free, 3000 Experts.