You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2010/04/30 00:03:07 UTC

Understanding Java Tests

Hi All,

Sometimes it's very difficult to understand the intent of a test case
by just reading the code, especially if the test itself is wrong or
has bugs.

Therefore may I kindly ask anybody who writes a new test case or
debugs/works on an existing test case to document the following .

1. Goal : What the test is trying to achieve.
2. Strategy : How the test is constructed to achieve the above goal.

Obviously we don't need to document every test out there, as some
tests are very simple and where you can easily understand by just
reading the code.
But we do have a hell of a lot of tests that are not trivial. For
these test cases it's important we document the above.
It makes peoples life easy as they don't have to pull their hair &
curse while trying to guess what the original intent was.
Also it helps to identify if the test is wrong or if it's buggy.

So if you are working on an existing or new test case, please be
considerate and try to document it if it's not trivial.

Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Understanding Java Tests

Posted by Immutable Seven <im...@googlemail.com>.
Hi Rajith,
Good point, I am just writing couple of tests, will make sure they are  
commented,

Cheers,
Sorin


On 29 Apr 2010, at 23:03, Rajith Attapattu <ra...@gmail.com> wrote:

> Hi All,
>
> Sometimes it's very difficult to understand the intent of a test case
> by just reading the code, especially if the test itself is wrong or
> has bugs.
>
> Therefore may I kindly ask anybody who writes a new test case or
> debugs/works on an existing test case to document the following .
>
> 1. Goal : What the test is trying to achieve.
> 2. Strategy : How the test is constructed to achieve the above goal.
>
> Obviously we don't need to document every test out there, as some
> tests are very simple and where you can easily understand by just
> reading the code.
> But we do have a hell of a lot of tests that are not trivial. For
> these test cases it's important we document the above.
> It makes peoples life easy as they don't have to pull their hair &
> curse while trying to guess what the original intent was.
> Also it helps to identify if the test is wrong or if it's buggy.
>
> So if you are working on an existing or new test case, please be
> considerate and try to document it if it's not trivial.
>
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Understanding Java Tests

Posted by Rajith Attapattu <ra...@gmail.com>.
Martin,

I'd certainly appreciate some help on the following tests.
If you could please also add them to the following page with any info
you think is necessary.
https://cwiki.apache.org/confluence/display/qpid/Java+Client+Test+Coverage

1. QueueBrowser{No/Auto/Dups/Client}AckTest
2. QueueBrowserTransactedTest
3. DirtyTrasactedPubilshTest
4. FailoverBeforeConsumingRecoverTest
5. AcknowledgeAfterFailoverTest and AcknowledgeAfterFailoverOnMessageTest
6. RollbackOrderTest#testOrderingAfterRollbackOnMessage
7. MessageListenerMultiConsumerTest

Thanks in advance,

Rajith

On Thu, Apr 29, 2010 at 6:13 PM, Martin Ritchie <ri...@apache.org> wrote:
> As some one who has written and debugged a fair number of the tests if
> you've got any major offenders in mind let me know and I'll get some text on
> them.
>
> Martin
>
> --
> Martin
>
> Sent from my iPhone
>
> On 29 Apr 2010, at 23:03, Rajith Attapattu <ra...@gmail.com> wrote:
>
>> Hi All,
>>
>> Sometimes it's very difficult to understand the intent of a test case
>> by just reading the code, especially if the test itself is wrong or
>> has bugs.
>>
>> Therefore may I kindly ask anybody who writes a new test case or
>> debugs/works on an existing test case to document the following .
>>
>> 1. Goal : What the test is trying to achieve.
>> 2. Strategy : How the test is constructed to achieve the above goal.
>>
>> Obviously we don't need to document every test out there, as some
>> tests are very simple and where you can easily understand by just
>> reading the code.
>> But we do have a hell of a lot of tests that are not trivial. For
>> these test cases it's important we document the above.
>> It makes peoples life easy as they don't have to pull their hair &
>> curse while trying to guess what the original intent was.
>> Also it helps to identify if the test is wrong or if it's buggy.
>>
>> So if you are working on an existing or new test case, please be
>> considerate and try to document it if it's not trivial.
>>
>> Regards,
>>
>> Rajith Attapattu
>> Red Hat
>> http://rajith.2rlabs.com/
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Understanding Java Tests

Posted by Martin Ritchie <ri...@apache.org>.
As some one who has written and debugged a fair number of the tests if  
you've got any major offenders in mind let me know and I'll get some  
text on them.

Martin

-- 
Martin

Sent from my iPhone

On 29 Apr 2010, at 23:03, Rajith Attapattu <ra...@gmail.com> wrote:

> Hi All,
>
> Sometimes it's very difficult to understand the intent of a test case
> by just reading the code, especially if the test itself is wrong or
> has bugs.
>
> Therefore may I kindly ask anybody who writes a new test case or
> debugs/works on an existing test case to document the following .
>
> 1. Goal : What the test is trying to achieve.
> 2. Strategy : How the test is constructed to achieve the above goal.
>
> Obviously we don't need to document every test out there, as some
> tests are very simple and where you can easily understand by just
> reading the code.
> But we do have a hell of a lot of tests that are not trivial. For
> these test cases it's important we document the above.
> It makes peoples life easy as they don't have to pull their hair &
> curse while trying to guess what the original intent was.
> Also it helps to identify if the test is wrong or if it's buggy.
>
> So if you are working on an existing or new test case, please be
> considerate and try to document it if it's not trivial.
>
> Regards,
>
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Understanding Java Tests

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Apr 29, 2010 at 8:04 PM, Steve Huston <sh...@riverace.com> wrote:
> (This goes for all the tests, not just Java.

Totally agreed !
I thought I'd start with Java and see how the reaction is :)

Rajith

>> -----Original Message-----
>> From: Rajith Attapattu [mailto:rajith77@gmail.com]
>> Sent: Thursday, April 29, 2010 6:03 PM
>> To: dev@qpid.apache.org
>> Subject: Understanding Java Tests
>>
>>
>> Hi All,
>>
>> Sometimes it's very difficult to understand the intent of a
>> test case by just reading the code, especially if the test
>> itself is wrong or has bugs.
>>
>> Therefore may I kindly ask anybody who writes a new test case
>> or debugs/works on an existing test case to document the following .
>>
>> 1. Goal : What the test is trying to achieve.
>> 2. Strategy : How the test is constructed to achieve the above goal.
>>
>> Obviously we don't need to document every test out there, as
>> some tests are very simple and where you can easily
>> understand by just reading the code. But we do have a hell of
>> a lot of tests that are not trivial. For these test cases
>> it's important we document the above. It makes peoples life
>> easy as they don't have to pull their hair & curse while
>> trying to guess what the original intent was. Also it helps
>> to identify if the test is wrong or if it's buggy.
>>
>> So if you are working on an existing or new test case, please
>> be considerate and try to document it if it's not trivial.
>>
>> Regards,
>>
>> Rajith Attapattu
>> Red Hat
>> http://rajith.2rlabs.com/
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


RE: Understanding Java Tests

Posted by Steve Huston <sh...@riverace.com>.
(This goes for all the tests, not just Java...)

> -----Original Message-----
> From: Rajith Attapattu [mailto:rajith77@gmail.com] 
> Sent: Thursday, April 29, 2010 6:03 PM
> To: dev@qpid.apache.org
> Subject: Understanding Java Tests
> 
> 
> Hi All,
> 
> Sometimes it's very difficult to understand the intent of a 
> test case by just reading the code, especially if the test 
> itself is wrong or has bugs.
> 
> Therefore may I kindly ask anybody who writes a new test case 
> or debugs/works on an existing test case to document the following .
> 
> 1. Goal : What the test is trying to achieve.
> 2. Strategy : How the test is constructed to achieve the above goal.
> 
> Obviously we don't need to document every test out there, as 
> some tests are very simple and where you can easily 
> understand by just reading the code. But we do have a hell of 
> a lot of tests that are not trivial. For these test cases 
> it's important we document the above. It makes peoples life 
> easy as they don't have to pull their hair & curse while 
> trying to guess what the original intent was. Also it helps 
> to identify if the test is wrong or if it's buggy.
> 
> So if you are working on an existing or new test case, please 
> be considerate and try to document it if it's not trivial.
> 
> Regards,
> 
> Rajith Attapattu
> Red Hat
> http://rajith.2rlabs.com/
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
> 
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org