From: Mathieu Bouchard Date: 2001-05-16T14:02:45+09:00 Subject: [ruby-talk:15239] help writing MetaRuby Contracts Here's another call for help. I will need someone to write contracts for Array, Hash, String, IO, File. I mean the full classes as they are in Ruby itself. That should be done according to standard Ruby 1.6 documentation. You will use CommonAssert that is found in ListMixin.rb (0.6), and possibly improve it too. The purpose of this exercise is similar to Rubicon's. Rubicon is an extensive suite of unit tests for Ruby that Dave Thomas wrote some time ago. I used it to find bugs in MetaRuby, but it also has been used to find (and keep track of) bugs in Ruby and errors in its documentation. Unit tests and contracts are quite alike in their purpose, but not in how they are constructed. For unit tests, you write: * sample uses * expected results for those uses For contracts, you write: * rules of usage * rules of expected results Contracts are more general and can be made to be run anytime, so that every application that uses a contract-enabled class becomes a suite of tests by itself ("magically"). Contracts also can serve as documentation by themselves. It's Ruby-parsable documentation. If those are written for Ruby's core classes, it's one more step towards a better Ruby, and one more step towards a better MetaRuby. matju