Click here to Skip to main content
15,891,946 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Exception Hierarchy Pin
Jon Rista6-Jan-09 17:31
Jon Rista6-Jan-09 17:31 
GeneralRe: Exception Hierarchy Pin
Curtis Schlak.25-Feb-09 9:02
Curtis Schlak.25-Feb-09 9:02 
AnswerRe: Exception Hierarchy Pin
Curtis Schlak.25-Feb-09 9:20
Curtis Schlak.25-Feb-09 9:20 
QuestionWho can show me the process and method of Scrum? Pin
Tal Rasha's Guardianship18-Dec-08 21:32
Tal Rasha's Guardianship18-Dec-08 21:32 
AnswerRe: Who can show me the process and method of Scrum? Pin
Ashfield18-Dec-08 22:01
Ashfield18-Dec-08 22:01 
GeneralRe: Who can show me the process and method of Scrum? Pin
Tal Rasha's Guardianship22-Dec-08 17:17
Tal Rasha's Guardianship22-Dec-08 17:17 
GeneralRe: Who can show me the process and method of Scrum? Pin
Ashfield26-Dec-08 22:40
Ashfield26-Dec-08 22:40 
QuestionArchitecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell18-Dec-08 4:42
Leftyfarrell18-Dec-08 4:42 
I have a question about architectures that support unit testing. Say I have these objects and dependencies:

DALUser >> MappingUser >> Common.LocalCulture
DALUser >> IDataActionUser

DALUser object has dependency on IDataActionUser, whose instance is populated using dependency injection. It also has an internal dependency on a MappingUser object. The logical flow looks like this:

Business Layer object calls the DALUser object and requests a User object
DALUser calls IDataActionUser class to hit the database and return a DataTable
DALUser calls MappingUser, passing the DataTable and the MappingUser class transforms the DataTable into a User object and returns it
MappingUser depends on a static Common.LocalCulture class that does some culture ID conversions
DALUser gets the User object from MappingUser and returns it to the Business Layer, as requested

With these dependencies, I can easily mock the IDataActionUser and return a hardcoded DataTable from the mock for testing purposes.

My question is... what is the appropriate scope of a unit test? Should I create an interface for MappingUser so that I can mock it and ensure that I am testing ONLY DALUser? What prevents you from moving towards a design where every class in your system has an interface? How do you determine where the line should be drawn between dependencies that should be mocked and dependencies that you include in a single unit test?

If I do create an interface and mock MappingUser, then my "test" of DALUser isn't really testing much at all, since DALUser only acts as a public interface to the business layer and a controller of sorts that calls these dependent objects. Without the functionality of the dependent objects included in the test, the DALUser class doesn't really do much... so it is still worth unit testing?

I'm obviously new to the unit testing game, and trying to absorb the finer points of the philosophy.

Thanks in advance for opinions.
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
led mike19-Dec-08 7:40
led mike19-Dec-08 7:40 
QuestionRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell19-Dec-08 8:08
Leftyfarrell19-Dec-08 8:08 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Giorgi Dalakishvili19-Dec-08 8:19
mentorGiorgi Dalakishvili19-Dec-08 8:19 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Mark Churchill22-Dec-08 18:42
Mark Churchill22-Dec-08 18:42 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
CodingYoshi25-Dec-08 21:03
CodingYoshi25-Dec-08 21:03 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? [modified] Pin
Jon Rista6-Jan-09 9:01
Jon Rista6-Jan-09 9:01 
GeneralRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell6-Jan-09 13:10
Leftyfarrell6-Jan-09 13:10 
GeneralRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Jon Rista6-Jan-09 13:36
Jon Rista6-Jan-09 13:36 
QuestionRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell6-Jan-09 14:13
Leftyfarrell6-Jan-09 14:13 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Jon Rista6-Jan-09 17:46
Jon Rista6-Jan-09 17:46 
QuestionDownloading URLs with Python ?? Pin
Fuat Mx13-Dec-08 7:25
Fuat Mx13-Dec-08 7:25 
QuestionTDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano8-Dec-08 21:08
Philip Laureano8-Dec-08 21:08 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
led mike9-Dec-08 4:25
led mike9-Dec-08 4:25 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Urs Enzler16-Dec-08 8:49
Urs Enzler16-Dec-08 8:49 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Mark Churchill13-Dec-08 2:35
Mark Churchill13-Dec-08 2:35 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano13-Dec-08 3:24
Philip Laureano13-Dec-08 3:24 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Pete O'Hanlon16-Dec-08 10:07
mvePete O'Hanlon16-Dec-08 10:07 

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.