- 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
Unit test flamewar thread! Yay!
Captcha: amet - amet a guy who wrote unit tests. He was stupid.
Admin
how the hell did you do that dude?
captcha: genitus ... just don't scratch them at work
Admin
Screw that, I am going to name my variables upside down from now on.
public String plɹoʍollǝɥ;
Holy Crap, Java accepted that!
Admin
˙ǝɔuɐʇsuı ɹoɟ lɯʇɥ˙dılɟ/ɯoɔ˙pɐɟʌǝɹ˙ʍʍʍ//:dʇʇɥ ˙uʍop ǝpısdn ʇxǝʇ dılɟ noʎ sʇǝl ʇɐɥʇ sǝƃɐdqǝʍ ɟo sʇol ǝɹɐ ǝɹǝɥʇ
Admin
Indeed - and it doesn't exactly make you popular to write a unit test for a part of the code that is already broken.
Clearly, the program was bug-free before you wrote that test, and now it has a bug. So really, it's your fault. Shoot the messenger. :P
Admin
Admin
And it's way too common for projects to state that unit tests shall exists - even if they aren't making any sense whatsoever.
Admin
Admin
That's funny...I'd be willing to bet that I'm one of the very few PM's who has even HEARD of this site. Besides, you telling them how much time you need will only lead to them asking you what it would take for you to meet their time line. Either that, or more likely the tasks would be sent to someone who can "get it done."
CAPTCHA: iusto...be a sysadmin, but became a PM once I realized that tech work was going to the kids and Indians. I want to do real work again.
Admin
I have to agree with that. There are some things that unit tests are just silly for.
Then again, I've written unit tests without being asked, just so I could have more confidence in my own code. I start with a handful and just ad to them as issues are found.
Unit Tests are wonderful for math driven code, formulas and stuff. They are teh suck and a waste of time for testing most existing, established, non-unit tested code.
Admin
Admin
Admin
HumanResources.fuckingFire(Employee.get("Steve"));
Admin
[quote user="J That's funny...I'd be willing to bet that I'm one of the very few PM's who has even HEARD of this site. Besides, you telling them how much time you need will only lead to them asking you what it would take for you to meet their time line. Either that, or more likely the tasks would be sent to someone who can "get it done." [/quote]
Honestly, if your developers are telling you that something is going to blow your time line, maybe you should have talked to them before you made the time line. Whatever it is that you're asking for is too complicated - this means that you have one of several possible outcomes:
Obviously, there's 3 good solutions here and 2 bad - and none of them are really likely to give you the results you wanted in the time you originally asked for. I've been the guy in charge of delivering super complicated projects - you know, the ones that other people cannot do as opposed to "refuse" to deliver on a certain timeline - on extraordinarily aggressive timelines just a few too many times.
Frankly, your job as PM is not only to get deliverables the customer on time, but also to protect the resources you have at your disposal. Your developers are resources, and it's somewhat immoral to "demand" massive amounts of unpaid overtime to meet a deadline that you knew was unreasonable. And really if you don't care about your developers as people, can you at least recognize that dull and overused tools don't work efficiently?
Honestly, you "threatening" to give it to someone else reminds me of this: http://www.phdcomics.com/comics/archive.php?comicid=1330
"I'm... actually ok with that."
Admin
My rule of thumb is that if they won't pay for overtime, then it can't be important enough for me to work overtime on it.
Admin
With apologies to the few good ones, I've worked with a lot of Project Managers who seemed to be profoundly mentally challenged... or just deaf.
Sure, put whatever you want. You will anyway, no matter what I say. Just don't expect reality to suddenly melt, flow, and reshape itself in response to the power of your spreadsheet.Admin
I don't mind taking care of my employer... in fact I enjoy it. I do mind doing volunteer work because some bonehead wants to create unrealistic time lines. If the company is loosing money until a problem is fixed... and I am the one most qualified / available to fix it... then I will do so as QUICKLY AS POSSIBLE... whether it includes overtime or not. I have no intention of overtime becoming my standard work week though.
Admin
What makes you think that the random featured comment selector will choose this one? It may not even have been unit tested.
Admin
It is done so that when the client asks "Has this been tested?" the manager can answer "Yes, that is why we charged you so much".
Then if there are any bugs, the manager just says "These didn't show up in our unit test, we will have to charge you to fix them".
You can learn more about these (and more) sales techniques in my book "Software Development from the Real World".
Admin
Unit tests.. Wonderful, but don't prove much!
Example: My brother programmed proms for a living. One of his tasks was to supply serialized ethernet addresses in proms for a network card vendor. The build shop just duplicated the address prom, which made every address (it is like aq serial number) the same. All of these interface cards would nicely pass their unit tests. Then when you get two of them in the same network they would fail a miserable death! The build shop was fired on the spot when this was discovered, and my brother's shop was cleared of supplying the wrong (non-serialized) chips.
So, yes, unit tests are nice. They give people "warm fuzzy feelings", but may not find any actual fault. One needs to test THE WHOLE!
Admin
Unless a developer is dedicated 100% to a particular project (rare in the small development teams I've been a part of), juggling all the various responsibilities makes it nearly impossible to tell the PM how long something took even after it was done.
Admin
Yeah! Unit tests suck, says the guy who's claim to fame is writing a small Mac program for OCD people and claiming to have invented of "using woodgrain to depict a bookcase"! He makes Don Knuth look like Paula Bean!
Admin
Ankaŭ mi
(me too)
Admin
Admin
I'm sorry, I disagree with this post. My own (current, ongoing) exercise of (belatedly) adding unit tests to a somewhat inadequately documented and maintained codebase (mea culpa, I wrote some of this stuff myself) has found several more or less significant bugs which have turned out to be the cause of otherwise bewildering and hitherto unfixed bugs.
So I will continue to ignore the rhetoric and come down on the side of: "unit testing is good".
Back in 1987 I was responsible for the mathematical design of a complex real-time system with military applications. The algorithms were coded in FORTRAN and rigorously tested (although in those days we called it "module testing") to ensure the outputs matched what we knew (having calculated "by hand") to be "truth". The inputs and outputs were then used as the test data for the actual application code (written in Ada, as I recall) and until the numbers matched precisely the app wasn't passed.
We delivered on time, within budget and (as far as we are still aware) bug-free.
Admin
Well okay, but having then figured out what the code does and compared it with the documentation (including in-code comments), do you then do the polite thing and amend the documentation so that it matches the behaviour of the code? I believe that's something else which really ought to be done but generally isn't.
Admin
The RWTF is adding QA at the END of a Project.
Admin
Unit testing does not replace integration or system testing. It supplements it.
Does your mom know your brother programs pron for a living?
Admin
Admin
Yup, but the boss hasn't gotten to that magazine article yet so they're safe.
Admin
TransactionProcessorTest = new TransactionProcessorTest();
should be
TransactionProcessorTest t = new TransactionProcessorTest();
or not? :D
Admin
You don't test hard enough?
Admin
Test Failed.
rm -rf /
rm: it is dangerous to operate recursively on /
Admin
Or
Gary adjusts the code to fix the tests on the assumption the test is correct.
Admin
It becomes QC at that point.
Admin
Sigh. This. +1 Truth.
Most - and I have worked with some good ones, too -- most PMs I've worked with have Baghdad Bob's job -- reassuring management that everything is going fine even in the face of overwhelming evidence to the contrary.
For the record, I'm a software tester and a good PM is an absolute joy to the QA team.
Admin
The real WTF here are half a dozen trackback urls with no connection to the article or IT in general other than a lose match of keywords from the article's title.
Boo!
Admin
Must we assume your 'general intuition built up over [your] paltry 21 years of being a professional programmer' is the same kind of profund intuition that made you think that it was funny for someone near his forties to repeat a childish meme like 'teh sucks' ten times?
Best regards. Captcha 'consequat' - must probably mean 'consequence' in latin.
Admin
No, of course not.
"Code complete" is the finish line. Then it's QA's problem, and the developers are off working on the next project.
Admin
Bah. I was hoping to learn some neat new stupid CSS trick. A substitution table is just cheesy.
Admin
Admin
Muahahahahahahahahahah. Spot ON!
Admin
Sadly, this also happened to me while working on a software project as part of a uni course on software development. I was part of a team of 9 people and our testers pretty much wrote code like this all the time.
Goes to show that people at uni don't necessarily know what they're doing, despite the fact that it's (at least) their fourth year studying computer science and they're supposed to know how to write code by that time. Some people shouldn't be allowed near code.
Admin
I do think it is funny whenever a bug is reported management likes to demand an answer why unit testing did not catch the bug.
Admin
I usually try not to insult people, but man, what a f* clueless tool. Guys who make inane posts like these are the source of WTFery and represent the wicked and twisted incompetence that turns software development into a pile of pestilent, festering, steaming pile of crap.
Admin
Raj strikes again: http://thedailywtf.com/Comments/Announcing-APDB-The-Worlds-Fastest-Database.aspx?pg=3#304444.
Admin
time for some t :) (hint the assignment is incorrect)
Admin
hahahahahahaha... that was really funny.
Although one thing, hey... leaving at 5 o'clock is NOT something I am going to feel bad about.
OK, TDWTF? I'm not supposed to be some guy from the Borg Collective!
Admin
t = ?
Admin
Rajandeep Sekhri is of course joking, it's not his real name either, did you buy that?
The requirement was to write unit test code. That's what Steve did, he left at 5, actually had a live, maybe friends and stuff.
Sorry Gary, you are so serious: do you really think the product improves because you write nifty unit tests?
You will not be able to write a unit test for an issue that you didn't think of while introducing it in code.