RE: How to use TDD to test a process?
"'Donaldson, John' [email protected] [testdrivendevelopment]" <[email protected]> Tue, 26 Apr 2016 07:34:10 +0000
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <716D07F3CBA94244A0922E7A99837C3A2FF25B89@G4W3228.americas.hpqcorp.net> |
Sailor, If you have a good mocking tool it’s very little effort to create a mock object. Then you can make assertions such as which methods should be called, and in what order. (For example Mockito). Do you need to test the process? Are you worried about the conditional aspects of your process? Then you could also consider extracting the conditions out into a separately testable unit. John D. From: [email protected] [mailto:[email protected]] Sent: 26 April 2016 03:31 To: [email protected] Subject: RE: [TDD] How to use TDD to test a process? Thanks for the reply. Yes, actually I don't want to know the side effect. I just want to test the logic. I had planned to use stub or mock. But there are several branches. I thought it is a little duplicated. Because if gotten good code coverage, in every case I have to write the stub or mock for methods called. Could you give me some advice? Thank you. [Non-text portions of this message have been removed] ------------------------------------ Posted by: "Donaldson, John" <[email protected]> ------------------------------------