- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Feature this, please.
Admin
If I really don't know why, and you aren't going to explain it to me, what do I have to do to find out?
Admin
Do the unit tests check the correct behaviour? If they fail because the expect the behaviour, then obviously the unit tests need changing. There's no guarantee that unit tests are bug free. Especially if requirements have changed, and you changed all the code but not the unit tests, unit tests will fail - and you have to change them.
Admin
That's what you have a debugger for. First pass, set a breakpoint on the failing test, check what bad result you got. Second pass, step through the code giving the wrong result to see why you got the bad result. All I need to know is the name of the test. Writing the test should be as little work as possible, because being little work per test, more tests will get written.
Admin
Admin
Admin
They must have been paying someone piecework, by the unit test created.
Kind of like offering to pay programmers for every source line written. Like in this "two-for-one" example I just ran across:
(And the programmer wasn't even being paid per source line. Imagine if he had been...)
Admin
I prefer something like:
@Test public void testNoExceptionsAreThrown_TC1234() { try { doIt(); } catch (Exception e) { Assert.fail(); } }
Admin
And they're green, too.
Admin
The Test Nazis!
Also, this isn't spam. Even though Akismet may think otherwise.
Admin
I believe in some testing frameworks you need to explicitly say "expect no exception", though.
Admin
You create more work, for no benefit, and when I complain your response is "use more tools!"?
You're assuming that the tests are always run on my machine in EclipelliXcode with debug mode enabled.
Or I could just see the exception thrown in the email I get from the Build system, and say "oh, NullPointerException, must've remove a property that's still being used. Let me fire up vim real quick and fix that, Sorry guys."
Admin
http://en.wikipedia.org/wiki/Hanzo_the_Razor
I'm back.
Admin
No. I'm the real Hannes.
Admin
Not a WTF. They're clearly just testing cargo units for the Galactic Terran Alliance.