Click here to Skip to main content
15,890,897 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: Unit Testing... yay or nay? Pin
DT Bullock21-Apr-24 22:55
DT Bullock21-Apr-24 22:55 
GeneralRe: Unit Testing... yay or nay? Pin
haughtonomous21-Apr-24 23:14
haughtonomous21-Apr-24 23:14 
GeneralRe: Unit Testing... yay or nay? Pin
DT Bullock22-Apr-24 22:19
DT Bullock22-Apr-24 22:19 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:12
professionalJeremy Falcon22-Apr-24 4:12 
GeneralRe: Unit Testing... yay or nay? Pin
DT Bullock22-Apr-24 20:17
DT Bullock22-Apr-24 20:17 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon23-Apr-24 5:40
professionalJeremy Falcon23-Apr-24 5:40 
GeneralRe: Unit Testing... yay or nay? Pin
DT Bullock23-Apr-24 21:32
DT Bullock23-Apr-24 21:32 
AnswerRe: Unit Testing... yay or nay? Pin
Peter Shaw22-Apr-24 0:45
professionalPeter Shaw22-Apr-24 0:45 
I Test, but I don't "TDD Unit Test".

While I develop a piece of functionality, I repeatedly exercise the code I'm working on, as I write it.

If at any point, it fails to compile, or shows signs of not "processing" some inputs correctly, I'll stop and fully debug everything, until it is working correctly once again.

My testing can take many forms, but often, if it's a runnable app, then I'll just make sure that "the app" is runnable at all times. If it's a stand alone library, or isolated bit of functionality, then I'll often build a small command line program along side of it, that I can use to "test run" the code, allowing me to do things in my regular debug loop way.

Once I'm happy the code is good, I then move up to building some test code, that integrates the system with the larger project (Should that be required), or set up some kind of testing harness (If it's a stand alone system) that exercises it using real test inputs and data.

I do not, mock out things like databases, external API's and all that jazz. If I have to connect to an external API, then I connect to an external API, and if that API is not yet available, then that bit of work simply does not get started until it is. I simply will not write test code that "pretends" to be something it is not.

My final step is usually one of setting up, large scale integration testing if required, or some smaller integration style unit test if code has to be independently testable. The key here, is I will create these unit tests only AFTER I'm satisfied I have done everything possible in other ways to produce good code that does the job required of it. I'll then use the integration testing, to A) ensure that the code stays working as it should with it's dependents & B) ensure that data & input changes don't screw anything up.

GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:15
professionalJeremy Falcon22-Apr-24 4:15 
GeneralRe: Unit Testing... yay or nay? Pin
Peter Shaw22-Apr-24 4:32
professionalPeter Shaw22-Apr-24 4:32 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:47
professionalJeremy Falcon22-Apr-24 4:47 
AnswerRe: Unit Testing... yay or nay? Pin
K Personett22-Apr-24 3:46
K Personett22-Apr-24 3:46 
AnswerRe: Unit Testing... yay or nay? Pin
Jerry Walter 202422-Apr-24 3:14
Jerry Walter 202422-Apr-24 3:14 
AnswerRe: Unit Testing... yay or nay? Pin
PIEBALDconsult22-Apr-24 3:41
mvePIEBALDconsult22-Apr-24 3:41 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:20
professionalJeremy Falcon22-Apr-24 4:20 
GeneralRe: Unit Testing... yay or nay? Pin
PIEBALDconsult22-Apr-24 7:00
mvePIEBALDconsult22-Apr-24 7:00 
AnswerRe: Unit Testing... yay or nay? Pin
Shmoken9922-Apr-24 5:36
Shmoken9922-Apr-24 5:36 
AnswerRe: Unit Testing... yay or nay? Pin
SeattleC++22-Apr-24 8:02
SeattleC++22-Apr-24 8:02 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 12:10
professionalJeremy Falcon22-Apr-24 12:10 
GeneralThis doesn't warrant an article, but since it's common enough... Pin
Jeremy Falcon19-Apr-24 13:48
professionalJeremy Falcon19-Apr-24 13:48 
GeneralRe: This doesn't warrant an article, but since it's common enough... Pin
jeron119-Apr-24 14:21
jeron119-Apr-24 14:21 
GeneralRe: This doesn't warrant an article, but since it's common enough... Pin
Jeremy Falcon19-Apr-24 14:26
professionalJeremy Falcon19-Apr-24 14:26 
GeneralRe: This doesn't warrant an article, but since it's common enough... Pin
Jeremy Falcon19-Apr-24 14:30
professionalJeremy Falcon19-Apr-24 14:30 
GeneralRe: This doesn't warrant an article, but since it's common enough... Pin
jeron119-Apr-24 15:09
jeron119-Apr-24 15:09 
GeneralWordle 1,036 Pin
StarNamer@work19-Apr-24 13:39
professionalStarNamer@work19-Apr-24 13:39 

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.