Bamdad Dashtban
Bamdad Dashtban

Reputation: 354

JUnit test statistics and specifing order of test execution

I have a lot of test suits and tests and the execution time of those tests are so long.

I have an idea of about adaptive testing to modify a TestUnit framework (JUnit for example) to run those tests which takes less time at the beginning and those which are taking a long time at the end.

Also, I'm thinking of defining an annotation like "@RunFirst" to declare and notify the test unit framework to run that test at the beginning so the developer can test the functionality that is working on at the beginning which saves a lot of time to get the answer.

My question are

  1. Is there any programmatic way that we order the execution of tests? (I already checked this page but it doesn't look like an appealing solution to me)
  2. can we access to the statistics of each test ? like how long does each one takes?
  3. Can we get the result of each test after each test is executed and show it to the user? or we have to wait until all the tests are executed?

Upvotes: 1

Views: 1232

Answers (1)

Raedwald
Raedwald

Reputation: 48682

to run those tests which takes less time at the beginning

If you are really interested in doing this, you have some test-cases that take a long time. Those are almost certainly not really unit tests, but rather integration tests. I would instead suggest moving those test-cases to a separate "integration tests" directory. Run all the integration tests after the unit tests.


Edit

See the following related questions:

Upvotes: 1

Related Questions