Xiao Peng

My personal blog moves to xiaopeng.me , blogs about design patterns will be synced to here.
肖鹏,ThoughtWorks资深咨询师,目前关注于架构模式、敏捷软件开发等领域,并致力于软件开发最佳实践的推广和应用。
多次为国内大型企业敏捷组织转型提供咨询和培训服务,在大型团队持续集成方面具有丰富的经验。
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

Maillist精选-[TDD]To Be specific

Posted on 2006-11-07 23:08  勇敢的鸵鸟  阅读(0)  评论(0编辑  收藏  举报

Luiz Siqueira Neto wrote:
> That is a simple and good test, but some times the "state machine"
> work with containers, in this cases I need know if all entities and
> properties is properly represented. The "state machine" uses the
> "Entity Introspector" as reference to know what to do. This
> introspector is the real focus in this case;
> Right now I'm trying check all "info entities" and "info properties"
> supposed to be generated for a "entity introspector". A "info
> property" and a "info entity" is "meta-data" generated by the "Entity
> Introspector". For to do that I need create and populate all entities
> inside of some container and check the respective existence of some
> "info property" and "info entity" one-by-one; this is very tedious.
> For make this more affordable I'm thinking in use generics in test cases.

Two things:

1. If you a really testing the entity introspector, then I believe you should try to test it directly, instead of testing it with the state machine. What would that test look like?

2. Very often I try to generalize quickly, because I believe I understand a design concept. When I try to write the general case, I find it difficult, so I start by writing 3 specific cases, then observe the patterns, then extract the general case from them. I believe it takes less time for me to do that, compared to trying the general case and failing to do it correctly.
[Comments:这个哥们儿讲得实在是太好了!特别是第二点:经常我发现自己试图很快的作generalization,因为我认为我已经理解了这个概念。当我试图写出这个general的case的时候,我发现很难。于是我开始写三个specific的case,然后观察这些模式,抽取出general的case。]
Take care.
--
J. B. (Joe) Rainsberger :: http://www.jbrains.ca
Your guide to software craftsmanship
JUnit Recipes: Practical Methods for Programmer Testing
2005 Gordon Pask Award for contribution Agile Software Practice