Click here to Skip to main content
15,888,816 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
r_hyde27-Jan-22 10:46
r_hyde27-Jan-22 10:46 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Mycroft Holmes27-Jan-22 11:31
professionalMycroft Holmes27-Jan-22 11:31 
GeneralRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
lmoelleb27-Jan-22 20:48
lmoelleb27-Jan-22 20:48 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Gary R. Wheeler27-Jan-22 15:31
Gary R. Wheeler27-Jan-22 15:31 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
ZevSpitz27-Jan-22 21:25
professionalZevSpitz27-Jan-22 21:25 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
RustyF27-Jan-22 21:24
RustyF27-Jan-22 21:24 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
lmoelleb27-Jan-22 21:07
lmoelleb27-Jan-22 21:07 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Davyd McColl27-Jan-22 21:48
Davyd McColl27-Jan-22 21:48 
Any testing is far better than no testing.

You could put this test into an automated runner and have at it - you have "unit tests" where the definition of "unit" is stretched out a little Big Grin | :-D and you already gain something out of this - if it's run in a CI environment, you get to catch bugs before they go out. Even if you just run them yourself, you get that benefit, though you could forget.

Now, if you decide that you have the time and energy to convert to more focused tests, or decide that new tests could be written in a more focused manner, there are advantages:
- more focused test failures - failures now tell you exactly what has failed, instead of just "there's been a regression"
- reporting output showing [Test Name] [passed/failed] for posterity
- easier to fix the issue - find the single test, look at what it does, what environment it had to set up, and run through just that code path in the debugger to find the issue.

I'll vote up unit tests, especially written before the prod code (TDD!) any day of the week - and the weekend! Big Grin | :-D
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing

Which is stupid.

AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
#realJSOP27-Jan-22 23:42
mve#realJSOP27-Jan-22 23:42 
JokeRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Sander Rossel27-Jan-22 23:48
professionalSander Rossel27-Jan-22 23:48 
GeneralRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
OriginalGriff28-Jan-22 0:20
mveOriginalGriff28-Jan-22 0:20 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Cpichols28-Jan-22 1:24
Cpichols28-Jan-22 1:24 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Member 1484049628-Jan-22 1:53
Member 1484049628-Jan-22 1:53 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Peter Kelley 202128-Jan-22 3:17
Peter Kelley 202128-Jan-22 3:17 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Jeroen_R28-Jan-22 3:40
Jeroen_R28-Jan-22 3:40 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Matt Bond28-Jan-22 4:55
Matt Bond28-Jan-22 4:55 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Bruce Greene28-Jan-22 5:39
Bruce Greene28-Jan-22 5:39 
GeneralRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Matt McGuire28-Jan-22 6:14
professionalMatt McGuire28-Jan-22 6:14 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
SeattleC++28-Jan-22 5:44
SeattleC++28-Jan-22 5:44 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Matt McGuire28-Jan-22 6:04
professionalMatt McGuire28-Jan-22 6:04 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
CosmoSpacely28-Jan-22 6:04
CosmoSpacely28-Jan-22 6:04 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Steve Naidamast28-Jan-22 7:09
professionalSteve Naidamast28-Jan-22 7:09 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
Shmoken9928-Jan-22 11:50
Shmoken9928-Jan-22 11:50 
AnswerRe: I'm fairly old fashioned at times ... but should I embrace unit testing? Pin
englebart5-Feb-22 5:36
professionalenglebart5-Feb-22 5:36 
GeneralWhat are you listening to? Pin
Cpichols27-Jan-22 2:43
Cpichols27-Jan-22 2:43 

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.