The Artima Developer Community
Sponsored Link

Design Forum
How do you keep tests simple with a class that calls many other classes?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brad Younie

Posts: 1
Nickname: byounie
Registered: Feb, 2008

How do you keep tests simple with a class that calls many other classes? Posted: Feb 11, 2008 10:45 AM
Reply to this message Reply
Advertisement
I've written a class that depends on several other classes to do its work. That is, each of its public methods will have many calls out to other classes as part of its processing. This has caused my tests to be quite cumbersome as I have to define an awful lot of Mock expectations in order to handle it.

Maintaning the tests is equally as cumbersome because a small change in the code can cause many tests to fail simply because the expectations are now wrong.

I've been doing test-first design for several years, but only to some degree. I still consider myself to be fairly new at it, and I suspect that there are some standard practices that I don't yet know of that can keep the expectations down or at least manageable.

I would love to get some advice on this.

Topic: Imbedding domain model into data model. Previous Topic   Next Topic Topic: Model Driven Architecture

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use