Re: which is the best way to obtain test method execution time

View: New views
1 Messages — Rating Filter:   Alert me  

Re: which is the best way to obtain test method execution time

by Shubha B S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cedric..
Thanks for the reply.. Basically I am not into writing the testcases. I am developing a tool which takes the JUnit testcases as input to give out Response Time of each method (excluding the setup and teardown times).  Ideally I would know abt the testcase only at runtime.
Thanks
Shubha



----- Original Message ----
From: Cédric Beust ♔ <cbeust@...>
To: mailtoshubha@...
Sent: Thursday, 10 July, 2008 4:18:58 AM
Subject: Re: [junit] which is the best way to obtain test method execution time


FYI, this is how I would achieve this with TestNG:

- Use @Test(invocationCount = 100) to invoke a test method several times
- Use test groups and @BeforeGroups/@AfterGroups to measure the time spent only in a specific group (which can contain more than one test method, of course)

--
Cédric



On Wed, Jul 9, 2008 at 6:41 AM, Shubha B S <mailtoshubha@...> wrote:

Hi
I have a requirement like I have described below. Please suggest me the best way to achieve this.
My objective in brief:
1. Obtain the test method execution time which EXCLUDES setup and teardown time.
2. Facilitate warm runs for the method. Run the same method more than once. B
    (I dont have a problem in getting the iterations from a configuration file)
(Warm tests are facilitated as jvm takes sometime to load the class for the very first run)
I have achieved this by modifying the junit source code. Which I dont think is the best way, as and when a new version of junit come in... I should be spending time to identify the instrumentaiton points and modify it. Which is not feasible.
I want to decouple my code from Junit's and still should be able to achive my objectives..
Could anyone suggest a better way to achieve this..?
Thanks
Shubha

Best Jokes, Best Friends, Best Food and more. Go to http://in.promos.yahoo.com/groups/bestofyahoo/

[Non-text portions of this message have been removed]

 


      Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/

[Non-text portions of this message have been removed]

LightInTheBox - Buy quality products at wholesale price