Programming by Contract

E

Ethan Furman

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~
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top