Re: @Testable annotation for TestNG

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: @Testable annotation for TestNG

Cédric Beust ♔
Hi Russ,

It's an interesting idea, but I'm not sure this annotation would belong in TestNG since TestNG itself wouldn't do anything with it.

Anyway, allow me to CC the mailing-list to get more opinions on this question...

As for your suggestion to put the test data in the application code, I'm not sure I like it, but again, let's see what everybody has to say...

--
Cedric


On 1/3/07, Russ Jackson <[hidden email]> wrote:

Hi Cedric,

 

I am just now becoming familiar with TestNG.  Looks like a great framework that may pull me away from JUnit.  Thanks for all your hard work on it.

 

I am writing to suggest the addition of a @Testable annotation to your API so that users can annotate the source methods they want tested and tools can generate the associated TestNG test classes/methods.  Here's a possible definition:

 

@ Retention(value = java.lang.annotation.RetentionPolicy.SOURCE)

@ Target(value = {java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD})

public @interface Testable {

   

    String testName() default "";

 

    Object[][] testData() default null;

}

 

I'm not sure if it's a great idea to put the test data in the source code or just have it in the test class. 

 

Thoughts?

 

Russ

 


This e-mail and any files transmitted with it are the property of Conversant, Inc., are confidential, and are intended solely for the use of the individual or entity to whom this email is addressed. If you are not one of the named recipients or otherwise have reason to believe that you have received this message in error, please delete this message immediately from your computer and contact the sender by telephone at (417) 781-7994. Any other use, retention, dissemination, forwarding, printing or copying of this email is strictly prohibited.

 




--
Cédric

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: @Testable annotation for TestNG

Steve Loughran-7
On 03/01/07, C dric Beust   <[hidden email]> wrote:

> Hi Russ,
>
> It's an interesting idea, but I'm not sure this annotation would belong in
> TestNG since TestNG itself wouldn't do anything with it.
>
> Anyway, allow me to CC the mailing-list to get more opinions on this
> question...
>
> As for your suggestion to put the test data in the application code, I'm not
> sure I like it, but again, let's see what everybody has to say...

surely all code should be testable, otherwise it aint going to work.

what you could have is

@testable(priority="high",owner="steve", type="functional")
public class system {
...
}

so we can keep track of which things need tests by priority/owner/author.

even so, its almost orthogonal to test frameworks themselves. Marking
something as testable doesnt mean you have to commit to using testng.



>
> --
> Cedric
>
>
>  On 1/3/07, Russ Jackson <[hidden email]> wrote:
> >
> >
> >
> >
> > Hi Cedric,
> >
> >
> >
> > I am just now becoming familiar with TestNG.  Looks like a great framework
> that may pull me away from JUnit.  Thanks for all your hard work on it.
> >
> >
> >
> > I am writing to suggest the addition of a @Testable annotation to your API
> so that users can annotate the source methods they want tested and tools can
> generate the associated TestNG test classes/methods.  Here's a possible
> definition:
> >
> >
> >
> > @ Retention(value =
> java.lang.annotation.RetentionPolicy.SOURCE)
> >
> > @ Target(value =
> {java.lang.annotation.ElementType.CONSTRUCTOR,
> java.lang.annotation.ElementType.METHOD})
> >
> > public @interface Testable {
> >
> >
> >
> >     String testName() default "";
> >
> >
> >
> >     Object[][] testData() default null;
> >
> >
> >
> > }
> >
> >
> >
> > I'm not sure if it's a great idea to put the test data in the source code
> or just have it in the test class.
> >
> >
> >
> > Thoughts?
> >
> >
> >
> > Russ
> >
> >
> >
> > ________________________________
>
> >
> > This e-mail and any files transmitted with it are the property of
> Conversant, Inc., are confidential, and are intended solely for the use of
> the individual or entity to whom this email is addressed. If you are not one
> of the named recipients or otherwise have reason to believe that you have
> received this message in error, please delete this message immediately from
> your computer and contact the sender by telephone at (417) 781-7994. Any
> other use, retention, dissemination, forwarding, printing or copying of this
> email is strictly prohibited.
> >
> >
>
>
>
> --
> C dric
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: @Testable annotation for TestNG

Hani Suleiman

Steve Loughran said:

> surely all code should be testable, otherwise it aint going to work.
>
Flamebait!


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: @Testable annotation for TestNG

Steve Loughran-7

On 03/01/07, Hani Suleiman <[hidden email]> wrote:
>
> Steve Loughran said:
>
> > surely all code should be testable, otherwise it aint going to work.
> >
> Flamebait!

I didnt say should have tests written, only that it should be
testable, ideally in a way that doesnt end with the destruction of a
small city, a country or two or the end of humanity.

Chernobyl, for example, that was a bad test "let's show these reactors
are safe if the cooling goes off by turning off the cooling". They
were so confident their system worked that they forgot the null
hypothesis "our reactors melt down when the cooling goes off" and as a
result some bits of the ukraine and belarus are uninhabitable.

David Lodge Parnas's great critique of Reagan's StarWars plan was that
the only way to show it would work would be if the soviet union
deployed 15 000 missiles against the missile shield, and they werent
going to do that unless the aforementioned missiles contained a high
percentage of functional warheads. Again, the null hypothesis "Our
missile defence system isnt 100% reliable" wasnt something you'd want
to find out.

I'm thinking we in s/w eng actually need a scale of system screwups
which takes into accounts this, my proposed scale spans the whole
swathe of consequences


10: accidental nuclear exchange, end of humanity.
9: loss of country. The chernobyl test could fall into this category
8. loss of city.
7. loss of small city few people care about. this is why Cern is in Geneva.
6. Airplane falls out the sky
5. cars crash or damage is amplified (ABS failure, engine control
accellerates car into wall, &c), other loss of live.
4. loss of entire personal data (e.g complete family photos)
3. destruction of machine, rebuild effort and recovery; no permanent loss.
2. loss of evenings work
1. remote server reboots, user has to hit reload.

I like this idea as you can prioritise better, and it makes people
that work on level 7 projects care more. I just dont think "the
loughran scale" is the kind of scale I want to have my name attached
to, given its a metric of large scale system disasters.

-Steve

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---