Re: Retrieving unnecessary data
- From: Robert Martin <unclebob@xxxxxxxxxxxxxxxx>
- Date: Thu, 21 Feb 2008 13:16:18 -0600
On 2008-02-20 11:08:37 -0600, topmind <topmind@xxxxxxxxxxxxxxxx> said:
Robert Martin wrote:On 2008-02-19 13:14:31 -0600, topmind <topmind@xxxxxxxxxxxxxxxx> said:
Evidence that OO makes testing easier?
Function f destroys the world when it is called. Function y calls
function f. How do I test function y? I hide f behind a polymorphic
interface called IF. I implement a fake version of f called MF. I
pass MF to y and tell y to do it's thing. Then I ask MF if f was
called. The world was not destroyed, and yet I know that y will call f.
One can also write a dummy stub function f,
Sure, and sometimes that would be a good choice. Other times the polymorphic interface would be a good choice.
or use a dummy database
(dummy world) for testing.
Ah, now that's an interesting concept. You mean a database that, for all intents and purposes, looks like a production database but isn't. You mean one that can be substutited for the production database according to the LSP. You mean...an object?
I think that's a very good idea.
--Robert C. Martin (Uncle Bob) | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716 |
.
- Follow-Ups:
- Re: Retrieving unnecessary data
- From: topmind
- Re: Retrieving unnecessary data
- References:
- Retrieving unnecessary data
- From: ShaneLM
- Re: Retrieving unnecessary data
- From: H. S. Lahman
- Re: Retrieving unnecessary data
- From: ShaneLM
- Re: Retrieving unnecessary data
- From: Robert Martin
- Re: Retrieving unnecessary data
- From: topmind
- Re: Retrieving unnecessary data
- From: Robert Martin
- Re: Retrieving unnecessary data
- From: topmind
- Retrieving unnecessary data
- Prev by Date: Re: Retrieving unnecessary data
- Next by Date: Re: Architecture of an enterprise application, multiple projects + multiple customers
- Previous by thread: Re: Retrieving unnecessary data
- Next by thread: Re: Retrieving unnecessary data
- Index(es):
Relevant Pages
|