Click here to Skip to main content
15,921,905 members

Survey Results

Do you do Unit Testing?

Survey period: 22 Jun 2020 to 29 Jun 2020

We ran this 5 years ago. Let's see if things have changed.

OptionVotes% 
We unit test everywhere, always.9912.36
We test the most important and/or non-trivial units,15619.48
We unit test some pieces. Sometimes.27033.71
We never unit test,20225.22
What is unit testing?789.74



 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
W Balboos, GHB22-Jun-20 3:00
W Balboos, GHB22-Jun-20 3:00 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
Sander Rossel22-Jun-20 3:22
professionalSander Rossel22-Jun-20 3:22 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
W Balboos, GHB22-Jun-20 3:27
W Balboos, GHB22-Jun-20 3:27 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
Sander Rossel22-Jun-20 3:37
professionalSander Rossel22-Jun-20 3:37 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
W Balboos, GHB22-Jun-20 3:54
W Balboos, GHB22-Jun-20 3:54 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
Sander Rossel22-Jun-20 4:47
professionalSander Rossel22-Jun-20 4:47 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
W Balboos, GHB22-Jun-20 5:16
W Balboos, GHB22-Jun-20 5:16 
GeneralRe: YoUr COde MuSt Be UnIT teStEd... Pin
Mike (Prof. Chuck)23-Jun-20 19:29
professionalMike (Prof. Chuck)23-Jun-20 19:29 
Sander, I agree.
I do some unit testing. For classes and their methods that are easily testable, either because they are generic, have no references to anything or do simple "toolbox" stuff, like string helpers, unit converters, those kind of things.
It's fast and in many cases more easy to write a quick test then to set up some console output in the main() of the program just to call that stuff and see what it does.

but I don't force anybody to run those tests with every compile, hence many of the test never run again... They are a replacement for Console.writeline in the main program.

I am also not a big fan of that religious mvvm drama...
when we need a new value from the ui passed down to some network layer because we need to deliver that to the server and I hear an answer of "oh wow... thats hard, takes 3 or 4 days, we need several new commands here and bindings there and dont-know-what there and it will affect about 50+ unit tests..."
OMG... go away! just send that f*cking integer value over the line. if such a simple change causes DAYS of work... then this is not a programming model I want to work with. period.
I have never used any mocking framework or dependency injection...thing... man! wake up! it's just the next bunch of frameworks and libraries and biiiig big stuff you never saw, which will introduce new bugs, have it flaws... creates more troubles than it solves... you are totally giving up control of what happens in your OWN program!
that blind religious behavior is something I really see as a critical thing. Those people are trusting any totally unknown developer any some library more than their own ability to write stable, working code.
And then, that wonderful day comes where you see tears in the eyes of some developer "i don't know why it is not there! i have all the bindings, the DI is set up and all unit tests are green. I know my mocks are right in the tests. it MUST work!"...
Then I get me some coffee, maybe a coke, and don't forget the popcorn! Lean back and watch them cry. When that fine moment comes where they realise that they have totally given up control just to follow some strange ..."model"... because "it's state of the art to do things like that"... oh man...

i have apps in store (professional and with my own label), i write games, i never used such alien-stuff and all my software works fine. Sometimes I think, many of those hyped models are a doubtful try to make development easier, to have people stop thinking. because the unit tests find it anyway. dont think about object hierarchies, stop good object design, just push 15 interfaces to a constructor and write 20 factories. and at some place, somewhere, anybody will create finally a living instance of IAnything and push it to ISomething, where IDontKnowWhat will do ISee...
I write (generic) platform modules, I have in most cases MORE reusable code than the mvvm extremists but it feels like being Don Quichote sometimes...
not my world. will never be.
|| You know nothing, Jon Snow.
|| The most important thing in Scrum? ... The "r"!
|| My Android Label (mbar Software)
|| My Android Apps in Play Store


modified 24-Jun-20 1:59am.

Generalold / new code Pin
M.Vo.21-Jun-20 20:20
M.Vo.21-Jun-20 20:20 
GeneralRe: old / new code Pin
W Balboos, GHB22-Jun-20 1:00
W Balboos, GHB22-Jun-20 1:00 
GeneralOne more option Pin
Amarnath S21-Jun-20 18:26
professionalAmarnath S21-Jun-20 18:26 
GeneralRe: One more option Pin
Ravi Bhavnani21-Jun-20 18:37
professionalRavi Bhavnani21-Jun-20 18:37 
GeneralRe: One more option Pin
Mike Hankey21-Jun-20 21:26
mveMike Hankey21-Jun-20 21:26 
GeneralRe: One more option Pin
Ravi Bhavnani22-Jun-20 20:20
professionalRavi Bhavnani22-Jun-20 20:20 
GeneralRe: One more option Pin
Mike Hankey23-Jun-20 2:22
mveMike Hankey23-Jun-20 2:22 
GeneralRe: One more option Pin
OriginalGriff21-Jun-20 21:45
mveOriginalGriff21-Jun-20 21:45 
GeneralRe: One more option Pin
Amarnath S21-Jun-20 22:36
professionalAmarnath S21-Jun-20 22:36 
GeneralRe: One more option Pin
Nemanja Trifunovic22-Jun-20 1:13
Nemanja Trifunovic22-Jun-20 1:13 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.