Click here to Skip to main content

Survey Results

Do you use Unit Testing in development?   [Edit]

Survey period: 23 Apr 2007 to 29 Apr 2007

It's been said that Unit Testing allows you to play your own Devil's Advocate. But do you bother?

OptionVotes% 
We unit test every piece of functionality we can19621.26196 votes, 21.26%
We unit test the main or top level pieces of functionality11912.91119 votes, 12.91%
We unit test some pieces. Sometimes.22123.97221 votes, 23.97%
We never unit test21723.54217 votes, 23.54%
What is unit testing?16918.33169 votes, 18.33%



 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralRe: Unit TestingmemberJohn R. Shaw30 Apr '07 - 20:49 
Those sound like a description of me … once upon a time.
 
Best record: 36 hours from description of requirements to completion of project (no sleep). Deadline was 48 hours – you would think I would have received a bonus for that one, especially since I had not been hired to write software and I was sick. All I received was a lecture from my doctor for doing something so stupid. The company managed to get a contract worth something in the neighborhood of 100k per month, and the general manager received a bonus (Go figure).

 
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

GeneralUnit vs functional testsmemberNemanja Trifunovic23 Apr '07 - 6:18 
An interesting blog on the subject[^]

 

GeneralUnit Testing Not Equal To nUnit etc.memberC# Genius23 Apr '07 - 5:12 
Just to make it clear, I don't think that the intention of the question is whether we unit test our code using a formal framework such as nUnit. A lot of times I find it simpler to use Debug.WriteLine / Console.WriteLine / Trace.WriteLine or to simply view the output on the screen to unit test my code that I know won't change much (or at all). Other times I may opt to use a formal unit test using nUnit where it makes sense. With this clarification, I believe that most people unit test their code and the stats here may not be correct due to people confusing unit testing with writing / executing formal tests.
 
Muhammad Haroon
Thoughtful discussions about software design, development, and management, using Microsoft and related tools and technologies.
GeneralRe: Unit Testing Not Equal To nUnit etc.memberDaniel Monzert24 Apr '07 - 3:38 
/signed Smile | :)
 
We don't suffer from insanity, we enjoy every minute of it!
GeneralRe: Unit Testing Not Equal To nUnit etc.memberJohn M. Drescher24 Apr '07 - 4:05 
C# Genius wrote:
Re: Unit Testing Not Equal To


I wrote that I never unit test. As I never use any formal unit test suite, however I do have a built in log system (in all my applications) that records every error, warning, outputs values... I also do have some test routines for some of my lower level code that will yell if they are get the wrong result for that case but this is only for a small fraction of the code and does not appear to be at as low a level as unit tests.
 
John

GeneralWhere possiblememberRichard Jones23 Apr '07 - 2:20 
Most of the problems come from house-of-cards apps built long ago by others.
Anything new gets tested.
 
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.

GeneralFor Mere Mortals?memberBalboos23 Apr '07 - 1:44 
Never mind the official title, who could (or would) build an app without testing the methods as they go along?
 
I suppose one could dump out 60,000 - 70,000 lines and then expect it all to work, but it would seem to be natural to test the all of its several parts, if for no other reason, then to fein sanity.
 
Balboos
 
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein

GeneralRe: For Mere Mortals?membersonsam25 Apr '07 - 22:38 
depends what you class as testing?
 
i know people who test every function, spend ages on each function ensuring that its 100% functional and covers all possible errors and handles them.
 
others will just hack the code out hit (f5'run') fix syntax bugs and compiler bugs then says its alright. sure it works but isnt going to be stable.
 
myself i try to do the first one but when in a team its very hard, even if your the boss and you make sure that your dev's know they should do proper coding and testing someone will miss something just due to rushing or hacking code out.
 
thats why we have QA testing team who i make sure i dont get emails from lolCool | :cool:

GeneralRe: For Mere Mortals?memberJohn R. Shaw28 Apr '07 - 11:22 
I could not agree more! I always ran my own tests constantly while building applications even before I knew what the names of the different testing types where. The best person to test the individual pieces of code is the developer of that code. Of course as a matter of pride, I do my best to avoid any errors in my code and am more than happy to let someone else try to break it. If there is something wrong, then I want to know no matter who finds the problem.
 
Those who try to hide problems are fools and only hurt themselves in the long run.
 

 
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

GeneralRe: For Mere Mortals?memberBalboos30 Apr '07 - 9:56 
My younger brother spends much of his free time working on his house (go figure?). Anyway, there's an old adage he quotes which can be applied to doing testing as one goes along:
 
Measure Once - Cut Twice.
 
- or -
 
Measure Twice - Cut Once.

 
The irreversability of the cutting in the physical world may, perhaps, be related to the brown stains on ones reputation when their buggy application falls apart because ego precluded testing one's own code.
 
Another somewhat wise saying (am I going to get a reputation for this?):
 
"If you can't find the time to do it right the first time . . . how are you going to find the time to do it again?"
 

 

 

 

 
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 10 Aug 2007
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid