29.11.2014 Views

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

22.7.2 The Perform: message<br />

The perform message takes a symbol as its parameter. It then uses this symbol as the name of a method<br />

to execute on the receiving object. As the symbol c<strong>an</strong> be stored in a variable, it is impossible to<br />

determine all the possible symbol va lues which will be passed to the perform message. It is therefore<br />

advisable not to use perform unless it is absolutely necessary. However, if the developer has used a<br />

perform expression, then a reasonable set of tests should be identified. Once again, the assumptions<br />

used to generate this set should be made explicit.<br />

22.8 Summary<br />

In this chapter we have considered some of the special problems which face a developer when testing <strong>an</strong><br />

object oriented system (with special consideration for <strong>Smalltalk</strong> implementations) . As has been<br />

discussed inherit<strong>an</strong>ce, abstraction, polymorphism <strong><strong>an</strong>d</strong> encapsulation all play a major part in determining<br />

the best practice in testing <strong>Smalltalk</strong> systems. A number of recurring themes have been:<br />

• The import<strong>an</strong>ce of specifying what a class or object is intended to do.<br />

• The use of scenarios to aid in the adequate testing of methods <strong><strong>an</strong>d</strong> classes.<br />

• The adequacy of testing <strong><strong>an</strong>d</strong> the import<strong>an</strong>ce of deciding what is sufficient.<br />

• Examples <strong><strong>an</strong>d</strong> assumptions need expl<strong>an</strong>ation (including their context).<br />

A final comme nt is that this chapter should not put you off constructing large complex systems in<br />

<strong>Smalltalk</strong>. Rather it should make you aware of the difficulties you will face in testing such a system.<br />

22.9 Further reading<br />

Little has been written about the special problems o f testing object oriented systems, however the<br />

papers by [Barbey <strong><strong>an</strong>d</strong> Strohmeier 1994] <strong><strong>an</strong>d</strong> [Barbey, Amm<strong>an</strong> <strong><strong>an</strong>d</strong> Strohmeier 1994] are <strong>an</strong> exception<br />

<strong><strong>an</strong>d</strong> provide <strong>an</strong> excellent introduction to the subject of testing object oriented systems. [Perry <strong><strong>an</strong>d</strong> Kaiser<br />

1990] a discussion of the effects of inherit<strong>an</strong>ce on object oriented testing. The next chapter also<br />

provides further reading on the subject of object oriented testing.<br />

189

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!