[self-interest] UnitTests

Jason Grossman spam-me at xeny.net
Wed Jan 12 02:23:23 UTC 2011


Ioke (http://ioke.org) follows Self (deliberately) in being very expressive and dynamic, and fairly lenient with scope (e.g. traits are used extensively), and unit tests are not mandatory.  But the base library itself is full of unit tests, and is exceptionally well documented.  I suspect that this approach is the best solution to some of the problems of powerful systems like Self.  I understand that the Smalltalk community has (by and large) traditionally had the view that the source code is the documentation, and I think that's been a mistake.  Specifically, it's been one of the things that's led to this impression that you can make a mess easily in Smalltalk.  Seems to me that it's very easy to make your code opaque even if it's well structured, e.g. by giving slots names which make sense to you but not to other people.  Similarly, in a large system it's hard to tell people which parts of the enormous Smalltalk object hierarchy your method is relying on using code alone.  Explicit documentation (explicit but not mandatory) is much less likely to be opaque.  (Or so I imagine.  I've never added anything significant to a really large system.)

I may just be venting my frustration here.  I recently spent hours trying to understand the code for the Smalltalk WikiWorks server before giving up.  SOME of it is exceptionally clear, but not the bits I wanted to change.

This is not a plug for using Ioke instead, by the way.  For one thing, it runs too slowly to be useful.

Jason



More information about the Self-interest mailing list