Johan Tibell | 18 Dec 11:26 2012
Picon

Suggested policy: use declarative names for tests instead of increasing integers

Hi,

I find our tests to be quite hard to navigate, as the majority have
names like tc12345.hs or some such. I suggest we instead use
descriptive names like GADT.hs or PrimOps.hs instead. What do people
think?

-- Johan
Simon Peyton-Jones | 18 Dec 11:32 2012
Picon

RE: Suggested policy: use declarative names for tests instead of increasing integers

(This belongs on cvs-ghc, or the upcoming ghc-devs.)

| I find our tests to be quite hard to navigate, as the majority have
| names like tc12345.hs or some such. I suggest we instead use descriptive
| names like GADT.hs or PrimOps.hs instead. What do people think?

We've really moved to a naming convention connected to tickets. Thus test T7490 is a test for Trac ticket
#7490.  This is fantastic.  It eliminates the need for elaborate comments in the test to say what is being
tested... just look at the ticket.

The old serially number tests tc032 etc are history.

If there isn't a corresponding ticket, it'd be a good idea to create one.

Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to give
the detail of what went wrong.

OK?  We should document this convention somewhere.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces <at> haskell.org [mailto:glasgow-haskell-
| users-bounces <at> haskell.org] On Behalf Of Johan Tibell
| Sent: 18 December 2012 10:26
| To: glasgow-haskell-users
| Subject: Suggested policy: use declarative names for tests instead of
| increasing integers
| 
| Hi,
(Continue reading)

Johan Tibell | 18 Dec 11:36 2012
Picon

Re: Suggested policy: use declarative names for tests instead of increasing integers

On Tue, Dec 18, 2012 at 2:32 AM, Simon Peyton-Jones
<simonpj <at> microsoft.com> wrote:
> OK?  We should document this convention somewhere.

As long as this is the policy nowadays I don't feel a strong need to
document it, but feel free to if you want.
Roman Cheplyaka | 18 Dec 13:33 2012

Re: Suggested policy: use declarative names for tests instead of increasing integers

* Simon Peyton-Jones <simonpj <at> microsoft.com> [2012-12-18 10:32:39+0000]
> (This belongs on cvs-ghc, or the upcoming ghc-devs.)
> 
> | I find our tests to be quite hard to navigate, as the majority have
> | names like tc12345.hs or some such. I suggest we instead use descriptive
> | names like GADT.hs or PrimOps.hs instead. What do people think?
> 
> We've really moved to a naming convention connected to tickets. Thus test T7490 is a test for Trac ticket
#7490.  This is fantastic.  It eliminates the need for elaborate comments in the test to say what is being
tested... just look at the ticket.
> 
> The old serially number tests tc032 etc are history.
> 
> If there isn't a corresponding ticket, it'd be a good idea to create one.
> 
> Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to give
the detail of what went wrong.
> 
> OK?  We should document this convention somewhere.

It is sort of documented at http://hackage.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding

  Having found a suitable place for the test case, give the test case a
  name. For regression test cases, we often just name the test case
  after the bug number (e.g. T2047). Alternatively, follow the
  convention for the directory in which you place the test case: for
  example, in typecheck/should_compile, test cases are named tc001,
  tc002, and so on.

But I wonder what if one wants to create a test preventively (say, for a
(Continue reading)

Simon Peyton-Jones | 18 Dec 13:45 2012
Picon

RE: Suggested policy: use declarative names for tests instead of increasing integers

| But I wonder what if one wants to create a test preventively (say, for a
| new feature), and there isn't actually any bug to create a ticket for?

Create a ticket for the new feature!

Simon
Adrien Haxaire | 18 Dec 13:52 2012

Re: Suggested policy: use declarative names for tests instead of increasing integers

On 2012-12-18 13:33, Roman Cheplyaka wrote:
> But I wonder what if one wants to create a test preventively (say, 
> for a
> new feature), and there isn't actually any bug to create a ticket 
> for?
>
> Roman
>

In that case, I would open a ticket with the type 'feature request' to 
get the right ticket number. This also helps following the development, 
the bugs that may be linked, etc.

Adrien
Simon Marlow | 18 Dec 15:22 2012
Picon

Re: Suggested policy: use declarative names for tests instead of increasing integers

On 18/12/12 12:33, Roman Cheplyaka wrote:
> * Simon Peyton-Jones <simonpj <at> microsoft.com> [2012-12-18 10:32:39+0000]
>> (This belongs on cvs-ghc, or the upcoming ghc-devs.)
>>
>> | I find our tests to be quite hard to navigate, as the majority have
>> | names like tc12345.hs or some such. I suggest we instead use descriptive
>> | names like GADT.hs or PrimOps.hs instead. What do people think?
>>
>> We've really moved to a naming convention connected to tickets. Thus test T7490 is a test for Trac ticket
#7490.  This is fantastic.  It eliminates the need for elaborate comments in the test to say what is being
tested... just look at the ticket.
>>
>> The old serially number tests tc032 etc are history.
>>
>> If there isn't a corresponding ticket, it'd be a good idea to create one.
>>
>> Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to
give the detail of what went wrong.
>>
>> OK?  We should document this convention somewhere.
>
> It is sort of documented at http://hackage.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding
>
>    Having found a suitable place for the test case, give the test case a
>    name. For regression test cases, we often just name the test case
>    after the bug number (e.g. T2047). Alternatively, follow the
>    convention for the directory in which you place the test case: for
>    example, in typecheck/should_compile, test cases are named tc001,
>    tc002, and so on.
>
(Continue reading)

Greg Weber | 18 Dec 17:16 2012

Re: Suggested policy: use declarative names for tests instead of increasing integers

The 2 approaches are not mutually exclusive.

 ticket#_description.hs
 tc12345_GADT.hs


On Tue, Dec 18, 2012 at 6:22 AM, Simon Marlow <marlowsd <at> gmail.com> wrote:
On 18/12/12 12:33, Roman Cheplyaka wrote:
* Simon Peyton-Jones <simonpj <at> microsoft.com> [2012-12-18 10:32:39+0000]
(This belongs on cvs-ghc, or the upcoming ghc-devs.)

| I find our tests to be quite hard to navigate, as the majority have
| names like tc12345.hs or some such. I suggest we instead use descriptive
| names like GADT.hs or PrimOps.hs instead. What do people think?

We've really moved to a naming convention connected to tickets. Thus test T7490 is a test for Trac ticket #7490.  This is fantastic.  It eliminates the need for elaborate comments in the test to say what is being tested... just look at the ticket.

The old serially number tests tc032 etc are history.

If there isn't a corresponding ticket, it'd be a good idea to create one.

Increasingly we refer to tickets in source-code comments.  They are incredibly valuable resource to give the detail of what went wrong.

OK?  We should document this convention somewhere.

It is sort of documented at http://hackage.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding

   Having found a suitable place for the test case, give the test case a
   name. For regression test cases, we often just name the test case
   after the bug number (e.g. T2047). Alternatively, follow the
   convention for the directory in which you place the test case: for
   example, in typecheck/should_compile, test cases are named tc001,
   tc002, and so on.

But I wonder what if one wants to create a test preventively (say, for a
new feature), and there isn't actually any bug to create a ticket for?

It wouldn't hurt to be more descriptive with test names than we are currently in e.g. codeGen and typechecker.  Some parts of the testsuite are better, e.g. see libraries/base/tests where the tests are named after the function being tested (sort of), or in codeGen/should_run_asm:

test('memcpy',
     unless_platform('x86_64-unknown-linux',skip), compile_cmp_asm, [''])
test('memcpy-unroll',
     unless_platform('x86_64-unknown-linux',skip), compile_cmp_asm, [''])
test('memcpy-unroll-conprop',
     unless_platform('x86_64-unknown-linux',skip), compile_cmp_asm, [''])

ticket numbers are good names for regression tests, but for other tests more descriptive names would help. There isn't always a good name for a test, but often there is.

Cheers,
        Simon



_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Gmane