While this poll is primarily aimed gathering information from Perl programmers, feel free to answer it if you use a different language. That being said, if you're using an XUnit framework, "number of tests" means, in this context "number of asserts" (in other words, a test method with three asserts would count as 3 tests, not one).
In the comments below, feel free to explain any answers, particularly if not all of your tests pass.
Poll #1223715 Size Does Matter
Open to: All, detailed results viewable to: All, participants: 55
Does your primary code base have a test suite?
If you answered "no" to the above question, please explain why (150 chars)
How many tests are in the largest test suite you work with?
View Answers
| Fewer than 50 tests |
| 50 to 100 tests |
| 101 to 500 tests |
| 501 to 2,000 tests |
| 2,001 to 10,000 tests |
| More than 10,000 tests |
How long does the aforementioned test suite take to run?
View Answers
| Fewer than 30 seconds |
| 30 seconds to 1 minute |
| 1 minute to 5 minutes |
| 5 minutes to 10 minutes |
| 10 minutes to 20 minutes |
| 20 minutes or more |
What percentage of your code is covered (rounding down)?
View Answers
| Don't Know |
| Less than 50% |
| 50% to 74% |
| 75% to 84% |
| 85% to 94% |
| 95% to 99% |
| 100% |
Do all tests pass?
If you answered "no" to the above question, what percentage of your tests fail?
What is the primary language the test suite is in?
What test framework the test suite is based on? (e.g. Perl is probably Test::Harness and Java is often jUnit)
curious
2008-07-15 03:40 pm (UTC)
2008-07-15 04:38 pm (UTC)
By the way, I'm betting the reasons why people don't unit test will fall into 2 general areas. 1) Management discourages them for time reasons 2) The developers believe that the particular niche their software falls into "can't" be unit tested -- embedded code, GUI components, DB framework, etc.
Edited at 2008-07-15 04:54 pm (UTC)
2008-07-15 04:54 pm (UTC)
2008-07-16 08:49 am (UTC)
Recalling back to my days of large Perl projects, I was never too impressed with Test::Harness. I mean, it's certainly decent, but it just didn't seem to facilitate the sorts of quick tests that are necessary to get good unit coverage and not get bogged down. I've always thought that testing should be more agile than coding, else the suites fall quickly into disrepair. I wonder how much of my current lovely setup for Haskell is due to the language's purity, vs how much has to do with the tools themselves.
2008-07-16 09:42 am (UTC)
<test-method status="PASS" signature="test2()" name="test2" duration-ms="0" started-at="2007-05-28T12:14:37Z" description="someDescription1" finished-at="2007-05-28T12:14:37Z"> </test-method>Well, great. We've now duplicated the duration by having a start and end time and a duration. What happens if they don't match? I've found nothing about this in the description.
And if we look at that full xml to see context:
<testng-results> <suite name="Suite1"> <groups> <group name="group1"> <method signature="com.test.TestOne.test2()" name="test2" class="com.test.TestOne"/> <method signature="com.test.TestOne.test1()" name="test1" class="com.test.TestOne"/> </group> <group name="group2"> <method signature="com.test.TestOne.test2()" name="test2" class="com.test.TestOne"/> </group> </groups> <test name="test1"> <class name="com.test.TestOne"> <test-method status="FAIL" signature="test1()" name="test1" duration-ms="0" started-at="2007-05-28T12:14:37Z" description="someDescription2" finished-at="2007-05-28T12:14:37Z"> <exception class="java.lang.AssertionError"> <short-stacktrace>java.lang.AssertionError ... Removed 22 stack frames </short-stacktrace> </exception> </test-method> <test-method status="PASS" signature="test2()" name="test2" duration-ms="0" started-at="2007-05-28T12:14:37Z" description="someDescription1" finished-at="2007-05-28T12:14:37Z"> </test-method> <test-method status="PASS" signature="setUp()" name="setUp" is-config="true" duration-ms="15" started-at="2007-05-28T12:14:37Z" finished-at="2007-05-28T12:14:37Z"> </test-method> </class> </test> </suite> </testng-results>Wow. That's breath-takingly ugly. I compare that to the equivalent in TAP with our optional YAML diagnostic syntax:
1..2 not ok 1 - someDescription2 --- signature: test1() name: test1 start: 2007-05-28T12:14:37Z end: 2007-05-28T12:14:37Z exception: class: java.lang.AssertionError stacktrace: | java.lang.AssertionError ... Removed 22 stack frames ok 2 - someDescription2 signature: test2() name: test2 start: 2007-05-28T12:14:37Z end: 2007-05-28T12:14:37Z xtra: is-config: trueThe beauty of that is a TAP parser only needs to see this:
And everything else is optional gravy, making it an extremely useful test protocol. You can implement the core of a complete parser in just a few lines of code and add more as you go. Regrettably, we're still waiting on Schwern's work on Test::Builder 2 before we can get the YAML diagnostics completely working :/
Does TestNG have any way of marking tests as "skip" or "todo"? (There's a way to exclude sets of tests, but that's not quite the same thing as "skip".
2008-07-16 09:54 am (UTC)
2008-07-17 04:34 am (UTC)
Once I've worked with it a bit I'll let you know what I think.
2008-07-15 04:55 pm (UTC)
Then it'd be "501 to 2,000 tests", I guess.
2008-07-16 07:42 am (UTC)
2008-07-16 09:55 am (UTC)
2008-07-15 05:03 pm (UTC)
Our code is mostly not structured appropriately to run isolated tests, and as a department we're still learning both how to do that and how to design appropriate tests. I think we may end up with bigger tests against a test database, first.
2008-07-15 05:18 pm (UTC)
2008-07-15 06:18 pm (UTC)
2008-07-15 05:45 pm (UTC)
2008-07-16 01:57 am (UTC)
There is no "none of the above" or "not applicable" option.
2008-07-16 07:08 am (UTC)
2008-07-16 11:31 am (UTC)
We don't have a primary codebase at work either - there's several independant ones.
2008-07-17 08:06 pm (UTC)