Loading ...
Sorry, an error occurred while loading the content.

OT: Implementing Design by Contract

Expand Messages
  • Morris, Chris
    In the July 2000 issue of Software Development - they have an article on Design by Contract in Java. I ve not read much about DbC prior to this article - but
    Message 1 of 1 , Jun 2, 2000
    • 0 Attachment
      In the July 2000 issue of Software Development - they have an article on
      Design by Contract in Java. I've not read much about DbC prior to this
      article - but I'd assumed DbC involved using asserts or exceptions at the
      top of a method to ensure inputs were correct.

      The article says the following:

      "[DbC] essentially serves as a set of coding standards for code comments."

      ... then they have an example with the DbC in the comment header of a
      method. According to this article, DbC is implemented in comments, not code.
      What does that buy me?:

      "Because the comments are now standardized, tools can actually understand
      the contract and enforce it, essentially performing automatic black-box
      testing ... Design errors can also be caught by testing tools, which can use
      the contract information to test the classes more thoroughly and
      efficiently."

      This makes a little more sense, I suppose - but requires another tool to
      interpret the comments and act on them to enforce the contract. Do any tools
      exist that do this? The article seems to say no, but isn't the clearest
      article, IMHO.

      The author then makes some stunning predictions:

      "If a tool existed that could output a contract from design tools, we could
      automate everything from design to testing."

      Huh - automated design. I would have figured that would involve some sort of
      Borg-like interface to the customer's brain.

      Is it just me...?


      Chris Morris
      Snelling International
      800-411-6401 x1320
      chrism@...
    Your message has been successfully submitted and would be delivered to recipients shortly.