Programming by Contract

Discussion in 'Python' started by Ethan Furman, Aug 6, 2009.

  1. Ethan Furman

    Ethan Furman Guest

    Greetings!

    I have seen posts about the assert statement and PbC (or maybe it was
    DbC), and I just took a very brief look at pycontract
    (http://www.wayforward.net/pycontract/) and now I have at least one
    question: Is this basically another way of thinking about unit testing,
    or is the idea of PbC more along the lines of *always* checking the
    input/output of functions to ensure they are correct? (*Contstant
    vigilance!* as Prof Moody would say ;)

    I know asserts can be turned off, so they obviously won't work for the
    latter case, and having seen the sample of pycontract it seems it only
    does its thing during debugging.

    So is Design (Programming) by Contract a fancy way of saying "Document
    your inputs/outputs!" or is there more to it?

    ~Ethan~
     
    Ethan Furman, Aug 6, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael D. Crawford
    Replies:
    0
    Views:
    686
    Michael D. Crawford
    Feb 22, 2005
  2. CorporateRebel.com
    Replies:
    2
    Views:
    420
    Whitecrest
    May 2, 2004
  3. BCC
    Replies:
    6
    Views:
    419
    Geniousoverhere
    May 9, 2004
  4. expecthealth

    Programming/Modeling Contract

    expecthealth, Dec 16, 2004, in forum: Python
    Replies:
    1
    Views:
    263
    Steve Holden
    Dec 16, 2004
  5. Specialist Verilog Engineers Roles
    Replies:
    0
    Views:
    470
    Specialist Verilog Engineers Roles
    Jun 27, 2007
Loading...

Share This Page