Commenting test classes?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Commenting test classes?

Denis Kudriashov
Hi.

I noticed pull requests which add comments to test cases (class comments).
I guess the reason is that in Calypso uncommented classes are marked differently than in Nautilus and the exclamation does not disappear when class provides special icon like status of tests.

So the question is do we really want people comment test cases?
I did not notice any meaningful comment from those PRs. It's like "Unit tests for mirror primitives" for MirrorPrimitiveTests (case 22207).
Personally I don't like such approach to put class name with spaces in the comment. It is useless and duplicated.

Alternatively I can change uncommented mark to be like in Nautilus. 
But I like Calypso approach because #systemIcon is not overridden by exclamation. If we want to keep it we need to introduce some #requiresComment to Class which will be overridden by TestCase.

So what you think?

 


Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

gcotelli
Hi,
I think that for TestCase subclasses 90% of the time the comment end up in "Unit test of blablabl". Maybe a really complex test case justifies a comment, but it's not the common case.
If we can disable the missing comment feedback on TestCase subclasses I will certainly disable it.

On Tue, Jul 3, 2018 at 3:48 PM Denis Kudriashov <[hidden email]> wrote:
Hi.

I noticed pull requests which add comments to test cases (class comments).
I guess the reason is that in Calypso uncommented classes are marked differently than in Nautilus and the exclamation does not disappear when class provides special icon like status of tests.

So the question is do we really want people comment test cases?
I did not notice any meaningful comment from those PRs. It's like "Unit tests for mirror primitives" for MirrorPrimitiveTests (case 22207).
Personally I don't like such approach to put class name with spaces in the comment. It is useless and duplicated.

Alternatively I can change uncommented mark to be like in Nautilus. 
But I like Calypso approach because #systemIcon is not overridden by exclamation. If we want to keep it we need to introduce some #requiresComment to Class which will be overridden by TestCase.

So what you think?

 


Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

Tim Mackinnon
And/Or we could display some automatic comment text (unless some is provided).

Somethings like 

Tests for Xxx

(Xxx comment eg I am class that provides services....)





Sent from my iPhone

On 3 Jul 2018, at 20:21, Gabriel Cotelli <[hidden email]> wrote:

Hi,
I think that for TestCase subclasses 90% of the time the comment end up in "Unit test of blablabl". Maybe a really complex test case justifies a comment, but it's not the common case.
If we can disable the missing comment feedback on TestCase subclasses I will certainly disable it.

On Tue, Jul 3, 2018 at 3:48 PM Denis Kudriashov <[hidden email]> wrote:
Hi.

I noticed pull requests which add comments to test cases (class comments).
I guess the reason is that in Calypso uncommented classes are marked differently than in Nautilus and the exclamation does not disappear when class provides special icon like status of tests.

So the question is do we really want people comment test cases?
I did not notice any meaningful comment from those PRs. It's like "Unit tests for mirror primitives" for MirrorPrimitiveTests (case 22207).
Personally I don't like such approach to put class name with spaces in the comment. It is useless and duplicated.

Alternatively I can change uncommented mark to be like in Nautilus. 
But I like Calypso approach because #systemIcon is not overridden by exclamation. If we want to keep it we need to introduce some #requiresComment to Class which will be overridden by TestCase.

So what you think?

 


Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

NorbertHartl


Am 03.07.2018 um 22:40 schrieb Tim Mackinnon <[hidden email]>:

And/Or we could display some automatic comment text (unless some is provided).

Somethings like 

Tests for Xxx

(Xxx comment eg I am class that provides services....)

Another example of counter productivity!

Norbert




Sent from my iPhone

On 3 Jul 2018, at 20:21, Gabriel Cotelli <[hidden email]> wrote:

Hi,
I think that for TestCase subclasses 90% of the time the comment end up in "Unit test of blablabl". Maybe a really complex test case justifies a comment, but it's not the common case.
If we can disable the missing comment feedback on TestCase subclasses I will certainly disable it.

On Tue, Jul 3, 2018 at 3:48 PM Denis Kudriashov <[hidden email]> wrote:
Hi.

I noticed pull requests which add comments to test cases (class comments).
I guess the reason is that in Calypso uncommented classes are marked differently than in Nautilus and the exclamation does not disappear when class provides special icon like status of tests.

So the question is do we really want people comment test cases?
I did not notice any meaningful comment from those PRs. It's like "Unit tests for mirror primitives" for MirrorPrimitiveTests (case 22207).
Personally I don't like such approach to put class name with spaces in the comment. It is useless and duplicated.

Alternatively I can change uncommented mark to be like in Nautilus. 
But I like Calypso approach because #systemIcon is not overridden by exclamation. If we want to keep it we need to introduce some #requiresComment to Class which will be overridden by TestCase.

So what you think?

 


Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

Tim Mackinnon
Au contraire - when looking at a Test - seeing inline the comment of the class to remind me what I’m supposed to be testing is actually quite helpful. I fully expect this is where GtDocumentor is going to take us (if we integrate it into our tools) - letting us inline things so we don’t have to go and hunt them out.

On 3 Jul 2018, at 22:32, Norbert Hartl <[hidden email]> wrote:



Am 03.07.2018 um 22:40 schrieb Tim Mackinnon <[hidden email]>:

And/Or we could display some automatic comment text (unless some is provided).

Somethings like 

Tests for Xxx

(Xxx comment eg I am class that provides services....)

Another example of counter productivity!

Norbert




Sent from my iPhone

On 3 Jul 2018, at 20:21, Gabriel Cotelli <[hidden email]> wrote:

Hi,
I think that for TestCase subclasses 90% of the time the comment end up in "Unit test of blablabl". Maybe a really complex test case justifies a comment, but it's not the common case.
If we can disable the missing comment feedback on TestCase subclasses I will certainly disable it.

On Tue, Jul 3, 2018 at 3:48 PM Denis Kudriashov <[hidden email]> wrote:
Hi.

I noticed pull requests which add comments to test cases (class comments).
I guess the reason is that in Calypso uncommented classes are marked differently than in Nautilus and the exclamation does not disappear when class provides special icon like status of tests.

So the question is do we really want people comment test cases?
I did not notice any meaningful comment from those PRs. It's like "Unit tests for mirror primitives" for MirrorPrimitiveTests (case 22207).
Personally I don't like such approach to put class name with spaces in the comment. It is useless and duplicated.

Alternatively I can change uncommented mark to be like in Nautilus. 
But I like Calypso approach because #systemIcon is not overridden by exclamation. If we want to keep it we need to introduce some #requiresComment to Class which will be overridden by TestCase.

So what you think?

 



Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

CyrilFerlicot
Le 04/07/2018 à 00:39, Tim Mackinnon a écrit :
> Au contraire - when looking at a Test - seeing inline the comment of the
> class to remind me what I’m supposed to be testing is actually quite
> helpful. I fully expect this is where GtDocumentor is going to take us
> (if we integrate it into our tools) - letting us inline things so we
> don’t have to go and hunt them out.
>
>


In general most of my tests classes are here to test one class, then the
name is "NameOfMyClassTests". In that case there is no need for a
comment like "I am a test class for NameOfMyClass".

I comment tests classes only when it's more functional tests and that
they cover a part of the system.

But I don't want to have to add comment such as "I am a test class for
NameOfMyClass" for the vast majority of my test classes.


--
Cyril Ferlicot
https://ferlicot.fr


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Commenting test classes?

NorbertHartl


> Am 04.07.2018 um 00:45 schrieb Cyril Ferlicot D. <[hidden email]>:
>
> Le 04/07/2018 à 00:39, Tim Mackinnon a écrit :
>> Au contraire - when looking at a Test - seeing inline the comment of the
>> class to remind me what I’m supposed to be testing is actually quite
>> helpful. I fully expect this is where GtDocumentor is going to take us
>> (if we integrate it into our tools) - letting us inline things so we
>> don’t have to go and hunt them out.
>>
>>
>
>
> In general most of my tests classes are here to test one class, then the
> name is "NameOfMyClassTests". In that case there is no need for a
> comment like "I am a test class for NameOfMyClass".
>
> I comment tests classes only when it's more functional tests and that
> they cover a part of the system.
>
> But I don't want to have to add comment such as "I am a test class for
> NameOfMyClass“ for the vast majority of my test classes.
>
same for me. Superfluous things have negative impact.

Norbert