How to categorize my tests?

A

Ashkan

Hi friends,
I decided to categorize my tests into 4 not necessarily disjoint sets:

1. unit tests : Quicky unit tests
2. slow tests: unit tests that does not run enough fast for continuous
builds
3. acceptance tests
4. all tests: Including all categories I mentioned before.

Now what is the best way to define these categorization in your
opinion? some options may be:

1. different folders for each one
2. differentiation in names (e.g. MyClassSlowTest or
MyClassAcceptanceTest ....)
3. using annotations in source to specify each category (e.g. @slow
says to ant that this is not a needed tests in run-fast-unit-tests
target...)
4. using a properties/config file (Oh I should remember to edit this
each time I add a test, sough)
5. a combination of some of the above ways!!!

Now please share your valuable opinions with me. Your notes are so
appreciated :)
 
D

Danno

Hi friends,
I decided to categorize my tests into 4 not necessarily disjoint sets:

1. unit tests : Quicky unit tests
2. slow tests: unit tests that does not run enough fast for continuous
builds
3. acceptance tests
4. all tests: Including all categories I mentioned before.

Now what is the best way to define these categorization in your
opinion? some options may be:

1. different folders for each one
2. differentiation in names (e.g. MyClassSlowTest or
MyClassAcceptanceTest ....)
3. using annotations in source to specify each category (e.g. @slow
says to ant that this is not a needed tests in run-fast-unit-tests
target...)
4. using a properties/config file (Oh I should remember to edit this
each time I add a test, sough)
5. a combination of some of the above ways!!!

Now please share your valuable opinions with me. Your notes are so
appreciated :)

I use testNG, the best opensource testing tool out there. You can
categorize tests using annotations. The test names can be used as
keywords and that makes it very valuable.

@Test (groups=["integration", "database", "dao"])
public void testPersistEmployeeInOracle9i(Employee employee) {

}
 
A

Ashkan

Thanks Danno,
Yep I know TestNG is so cool tool but if I want to upgrade our testing
platform I prefer using Junit 4 that supports same feature that I need.
Anyway last time that I checked it ant 1.6.5 did not support junit 4.
Does it support TestNG or not?
Thanks again for your help.

Hi friends,
I decided to categorize my tests into 4 not necessarily disjoint sets:
1. unit tests : Quicky unit tests
2. slow tests: unit tests that does not run enough fast for continuous
builds
3. acceptance tests
4. all tests: Including all categories I mentioned before.
Now what is the best way to define these categorization in your
opinion? some options may be:
1. different folders for each one
2. differentiation in names (e.g. MyClassSlowTest or
MyClassAcceptanceTest ....)
3. using annotations in source to specify each category (e.g. @slow
says to ant that this is not a needed tests in run-fast-unit-tests
target...)
4. using a properties/config file (Oh I should remember to edit this
each time I add a test, sough)
5. a combination of some of the above ways!!!
Now please share your valuable opinions with me. Your notes are so
appreciated :)I use testNG, the best opensource testing tool out there. You can
categorize tests using annotations. The test names can be used as
keywords and that makes it very valuable.

@Test (groups=["integration", "database", "dao"])
public void testPersistEmployeeInOracle9i(Employee employee) {

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top