On 16/05/2001 09:17:55 Vincent Massol wrote: > In order to be able to better discuss Mock Objects vs In-Container, etc ... > I'd like to try to categorise ways of testing. > > The first definition that we need to agree on is that of Mock Objects which > must not be mixed with Stubbing. > > Mock Objects vs Stubbing : > - Mock Objects (as defined in > http://www.sidewize.com/company/mockobjects.pdf) which are used to finely > unit test a given method by isolating it from it's surrounding (this is done > by mocking all manipulated domain objects). > - Stubbing, which is what you describe. It can be used in several different > places, to mock java beans in order to easily unit test JSPs for regression. > It can also be used for example to mock an EJB so that you can unit test > your presentation objects, ... This is not as clear cut as you suggest as it is clear from the article that mock objects are a type of stub ("refactoring Mock Objects drives down the cost of writing stub code" and "differences between our use of stubs and Binder's ...") I think that it would be difficult to classify all of the different stub types that people have used. Assume that people have read the MO article and go from there. > Then, I would categorise testing into 4 different areas : > 1- fine-grained unit testing, which is what Mock Objects do. This only unit > tests method by method without testing object interaction, > 2- coarse-grained unit testing, which is what Cactus does for example. The > unit tests encompass domain objects and test interactions. Stubbing should > also be categorised into this category. > 3- end to end tests, some kind of functional tests but whose goal is not to > test a complete functional use case which might involves a user interaction > over several screens for example. Rather it tests from end to end on a > technical feature, like testing that a JSP effectively returns the bank > account figures. > 4- acceptance tests or full functional tests, which test the real user > testcase, ie. for example, the user fills a form, then if it does not enter > the postcode, such page with such error appears, ... > > Do you agree with this classification ? > > Thanks > Vincent. > ----------------------------------------------------------------- Visit our Internet site at http://www.reuters.com Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Reuters Ltd.
