cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Oskarsson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-250) Add mocking library to lib
Date Mon, 22 Jun 2009 13:08:07 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722586#action_12722586
] 

Johan Oskarsson commented on CASSANDRA-250:
-------------------------------------------

I'm all for refactoring these classes to make them more testable, but as it stands now it
is quite tricky and time consuming for the reasons mentioned above. Personally I wouldn't
want to embark on a very intrusive refactoring without first having unit tests in place. Especially
when it comes to the more important and/or large classes, the risk of  breaking something
is too big.

System tests are great, but are they really a replacement for unit tests? Especially as a
method of confirming if a patch introduces an unwanted side effect or not.
If mocking won't do I'm open to suggestions on how we can find another suitable method to
unit test these classes, for example the ones that depend on Gossiper, MessagingService etc.

> Add mocking library to lib
> --------------------------
>
>                 Key: CASSANDRA-250
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-250
>             Project: Cassandra
>          Issue Type: Task
>            Reporter: Johan Oskarsson
>            Priority: Trivial
>             Fix For: 0.4
>
>         Attachments: mockito-all-1.7.jar
>
>
> Cassandra in it's current state can be hard to write unit tests for, the classes are
tightly coupled, a lot of variables and code is static. For example some 10 threads start
up when you call a static method on MessagingService, even though all that method does is
convert a byte array to a short. 
> Should we make use of a mocking library to help us make it easier to write certain tests?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message