Click here to Skip to main content
15,904,877 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.

 
GeneralRe: Unit Testing... yay or nay? Pin
Greg Utas20-Apr-24 10:41
professionalGreg Utas20-Apr-24 10:41 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 4:54
professionalJeremy Falcon21-Apr-24 4:54 
GeneralRe: Unit Testing... yay or nay? Pin
Greg Utas21-Apr-24 5:32
professionalGreg Utas21-Apr-24 5:32 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 16:24
professionalJeremy Falcon21-Apr-24 16:24 
GeneralRe: Unit Testing... yay or nay? Pin
haughtonomous21-Apr-24 23:07
haughtonomous21-Apr-24 23:07 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:24
professionalJeremy Falcon22-Apr-24 4:24 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon20-Apr-24 9:19
professionalJeremy Falcon20-Apr-24 9:19 
AnswerRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer20-Apr-24 10:25
professionalDaniel Pfeffer20-Apr-24 10:25 
IMO, it only makes sense to do unit testing when the inputs & outputs from a function/module can be specified. To take a very simple case, testing the strlen() function in C:
  • Input must be a non-null pointer
  • Output must be a non-negative integer
  • The (output)th character of the input is a null character.
  • No null characters are to be found in the range [ 0 .. (output) ) of the input
In cases where the output is not easy to check (for example a trigonometric function), exhaustive testing is impractical. In this case, only very simple "sanity" tests can be performed.

In real-world code I usually try to test all boundary conditions, but don't try to perform exhaustive testing.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon20-Apr-24 10:34
professionalJeremy Falcon20-Apr-24 10:34 
GeneralRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer20-Apr-24 15:15
professionalDaniel Pfeffer20-Apr-24 15:15 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 5:02
professionalJeremy Falcon21-Apr-24 5:02 
GeneralRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer21-Apr-24 22:31
professionalDaniel Pfeffer21-Apr-24 22:31 
GeneralRe: Unit Testing... yay or nay? Pin
haughtonomous21-Apr-24 23:12
haughtonomous21-Apr-24 23:12 
GeneralRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer22-Apr-24 4:30
professionalDaniel Pfeffer22-Apr-24 4:30 
AnswerRe: Unit Testing... yay or nay? Pin
Ravi Bhavnani20-Apr-24 10:48
professionalRavi Bhavnani20-Apr-24 10:48 
GeneralRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer20-Apr-24 15:28
professionalDaniel Pfeffer20-Apr-24 15:28 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 5:07
professionalJeremy Falcon21-Apr-24 5:07 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 5:06
professionalJeremy Falcon21-Apr-24 5:06 
GeneralRe: Unit Testing... yay or nay? Pin
Ravi Bhavnani21-Apr-24 10:18
professionalRavi Bhavnani21-Apr-24 10:18 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 16:18
professionalJeremy Falcon21-Apr-24 16:18 
JokeRe: Unit Testing... yay or nay? Pin
Daniel Pfeffer21-Apr-24 22:22
professionalDaniel Pfeffer21-Apr-24 22:22 
AnswerRe: Unit Testing... yay or nay? Pin
lmoelleb20-Apr-24 22:39
lmoelleb20-Apr-24 22:39 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon21-Apr-24 4:51
professionalJeremy Falcon21-Apr-24 4:51 
AnswerRe: Unit Testing... yay or nay? Pin
Nelson Goncalves Oct202221-Apr-24 20:31
Nelson Goncalves Oct202221-Apr-24 20:31 
GeneralRe: Unit Testing... yay or nay? Pin
Jeremy Falcon22-Apr-24 4:08
professionalJeremy Falcon22-Apr-24 4:08 

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.