When the high-level design is complete, the message classes and their contents must be defined for each action that will be performed on and by an object. Note also that the same message class may be used with different object classes to achieve a different result, in accordance with the principle of polymorphism, thus reducing the number of defined message classes and simplifying the design of the application objects and their methods.
The message classes comprise the interfaces between objects, and provide the input and output for the methods associated with the object. These message interfaces must therefore be documented to facilitate reusability of the newly-created application objects by documenting the valid inputs and outputs for each object class, and the behavior of the object in response to these messages.
Since the messages received and dispatched by an object constitute the inputs and outputs required and expected of that object, the documented message interfaces provide a valuable starting point for developing a test plan for the object. Since the inputs, actions and outputs are known, a comprehensive set of test data may then be formulated to test the methods associated with each action, with both valid and invalid message inputs.