Junit checks

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

Junit checks

Adam Purkiss
I have been looking to see if there are any testing checks out there as I cant find any before I delve into developing my own check.
 
What I am looking for is a way of checking JUnit test methods to make sure they have X number of asserts and then maybe adding to it so that if they are over X lines in length they have Y asserts. Has anything like that been done and does this sound like something Checkstyle could do?
 
thanks


Tell the whole story with photos, right from your Messenger window. Learn how!
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Junit checks

Tim Visher
On Mon, Apr 20, 2009 at 10:03 AM, Adam Purkiss <[hidden email]> wrote:
> I have been looking to see if there are any testing checks out there as I
> cant find any before I delve into developing my own check.
>
> What I am looking for is a way of checking JUnit test methods to make sure
> they have X number of asserts and then maybe adding to it so that if they
> are over X lines in length they have Y asserts. Has anything like that been
> done and does this sound like something Checkstyle could do?

I haven't heard of anything like that but it sounds like it would be
really useful.  If you find something or start developing something be
sure to let the list know.

--

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Junit checks

Adam Purkiss
I will do. I am sick and tired of bad tests being written. It gives us a false sense we are testing more then we are. That sort of check will hopefully make the developers think a little more
 

> Date: Mon, 20 Apr 2009 14:12:35 -0400
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Checkstyle-user] Junit checks
>
> On Mon, Apr 20, 2009 at 10:03 AM, Adam Purkiss <[hidden email]> wrote:
> > I have been looking to see if there are any testing checks out there as I
> > cant find any before I delve into developing my own check.
> >
> > What I am looking for is a way of checking JUnit test methods to make sure
> > they have X number of asserts and then maybe adding to it so that if they
> > are over X lines in length they have Y asserts. Has anything like that been
> > done and does this sound like something Checkstyle could do?
>
> I haven't heard of anything like that but it sounds like it would be
> really useful. If you find something or start developing something be
> sure to let the list know.
>
> --
>
> In Christ,
>
> Timmy V.
>
> http://burningones.com/
> http://five.sentenc.es/ - Spend less time on e-mail
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user


Messenger has tons of new features that make chatting more fun. Click here to learn more.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Junit checks

Forsberg, Mike-2

This is probably a “no duh”… but don’t assume that since certain aspects of the tests are required, that everything will be a “walk in the park”

 

Style checking does not replace:

-          a good code review

-          proper design

-          proper communication

 

Lately I’ve noticed that even if my own code matches style guidelines, it does not mean my co-workers, or I a few weeks later, will understand what I intended.

 

Thanks for the style checker though, it really does take a lot of the drudgery out a code review though.  I’m amazed at the number of developers that don’t follow indention conventions.

 

Big Mike

 

From: Adam Purkiss [mailto:[hidden email]]
Sent: Monday, April 20, 2009 2:06 PM
To: [hidden email]
Subject: Re: [Checkstyle-user] Junit checks

 

I will do. I am sick and tired of bad tests being written. It gives us a false sense we are testing more then we are. That sort of check will hopefully make the developers think a little more
 
> Date: Mon, 20 Apr 2009 14:12:35 -0400
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Checkstyle-user] Junit checks
>
> On Mon, Apr 20, 2009 at 10:03 AM, Adam Purkiss <[hidden email]> wrote:
> > I have been looking to see if there are any testing checks out there as I
> > cant find any before I delve into developing my own check.
> >
> > What I am looking for is a way of checking JUnit test methods to make sure
> > they have X number of asserts and then maybe adding to it so that if they
> > are over X lines in length they have Y asserts. Has anything like that been
> > done and does this sound like something Checkstyle could do?
>
> I haven't heard of anything like that but it sounds like it would be
> really useful. If you find something or start developing something be
> sure to let the list know.
>
> --
>
> In Christ,
>
> Timmy V.
>
> http://burningones.com/
> http://five.sentenc.es/ - Spend less time on e-mail
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user


Messenger has tons of new features that make chatting more fun. Click here to learn more.


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Junit checks

stlecho
Is there in the mean time an "out-of-the-box" solution for the initial request: "checking JUnit test methods to make sure they have X number of asserts" ?