Click here to Skip to main content
15,914,642 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: I like unit testing and debugging private methods so u$ sucks today PinPopular
CDP18026-Oct-14 12:07
CDP18026-Oct-14 12:07 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Jörgen Andersson6-Oct-14 18:55
professionalJörgen Andersson6-Oct-14 18:55 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Agent__0076-Oct-14 19:12
professionalAgent__0076-Oct-14 19:12 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
_Maxxx_6-Oct-14 19:34
professional_Maxxx_6-Oct-14 19:34 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Marc Clifton6-Oct-14 15:18
mvaMarc Clifton6-Oct-14 15:18 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
_Maxxx_6-Oct-14 15:47
professional_Maxxx_6-Oct-14 15:47 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Marc Clifton6-Oct-14 16:21
mvaMarc Clifton6-Oct-14 16:21 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
_Maxxx_6-Oct-14 18:09
professional_Maxxx_6-Oct-14 18:09 
I see this as being another case of someone not using the idea of <practice> and saying it doesn't work properly.

(for <practice> you can insert anything from TDD to MVVM to LinqToSQL to whatever).

But I still don't get why you think you need to test individual private methods? Sure, when you are developing you might do bit of R&D in a private method - and you might even write some code just to test it - or run it through the debugger to make sure it's doing what you expect it to do. But the information in that method CANNOT get out without some public method accessing it (and by method I include property) - so it doesn't need a test.

Surely the idea of tests is that they can be run whenever a change is made and reassure you that you haven't broken anything.


Marc Clifton wrote:
And no, I'm not testing unit level functions, I can do that perfectly fine by stepping through them in the debugger.


But what happens when another developer in 6 months changes something in one of these methods that then causes all hell to break loose? The hell breaking looses does not necessarily occur in the method he has changed - so even if he steps through his method in the debugger, nothing will appear strange, but that method may be used from hundreds of other places, each with different needs - and stepping through in debug mode just isn't practical in this case; even identifying every path would be a nightmare...

Bottom line, I think, is that if you are going to use TDD at all, you need to design your software in a way that enables its use for all public methods, and for every possible use of each; Now, when the tests run, you know nothing is broken.



Marc Clifton wrote:
The DAL should be easily simulated by instantiating a simulation rather than some complicated mocking system.


Not sure I follow - are you saying that if your service layer returns an object via the database you should create a class that instantiates one of those objects with some test data in it for testing? If so, surely that is exactly what testing frameworks do - by faking up the method call and returning a test object? Or am I missing your meaning?
PooperPig - Coming Soon

GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Super Lloyd6-Oct-14 18:07
Super Lloyd6-Oct-14 18:07 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Marc Clifton7-Oct-14 2:26
mvaMarc Clifton7-Oct-14 2:26 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
Nicholas Marty6-Oct-14 23:59
professionalNicholas Marty6-Oct-14 23:59 
GeneralRe: I like unit testing and debugging private methods so u$ sucks today Pin
peterchen7-Oct-14 0:32
peterchen7-Oct-14 0:32 
RantPHP PinPopular
Marc Clifton6-Oct-14 9:48
mvaMarc Clifton6-Oct-14 9:48 
GeneralRe: PHP Pin
CDP18026-Oct-14 9:54
CDP18026-Oct-14 9:54 
GeneralRe: PHP Pin
Afzaal Ahmad Zeeshan6-Oct-14 9:58
professionalAfzaal Ahmad Zeeshan6-Oct-14 9:58 
GeneralRe: PHP Pin
Marc Clifton6-Oct-14 10:13
mvaMarc Clifton6-Oct-14 10:13 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 11:24
professionalJeremy Falcon6-Oct-14 11:24 
GeneralRe: PHP Pin
Chris Maunder6-Oct-14 10:07
cofounderChris Maunder6-Oct-14 10:07 
GeneralRe: PHP Pin
Marc Clifton6-Oct-14 10:16
mvaMarc Clifton6-Oct-14 10:16 
GeneralRe: PHP PinPopular
Roger Wright6-Oct-14 10:13
professionalRoger Wright6-Oct-14 10:13 
GeneralRe: PHP Pin
CDP18026-Oct-14 10:16
CDP18026-Oct-14 10:16 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 10:32
professionalJeremy Falcon6-Oct-14 10:32 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 10:24
professionalJeremy Falcon6-Oct-14 10:24 
GeneralRe: PHP Pin
Slacker0076-Oct-14 10:29
professionalSlacker0076-Oct-14 10:29 
GeneralRe: PHP Pin
Jeremy Falcon6-Oct-14 10:31
professionalJeremy Falcon6-Oct-14 10:31 

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.