POV-Ray : Newsgroups : povray.off-topic : TDD vs PbC : Re: TDD vs PbC Server Time
6 Sep 2024 03:18:06 EDT (-0400)
  Re: TDD vs PbC  
From: Darren New
Date: 1 Mar 2009 21:10:03
Message: <49ab3ffb$1@news.povray.org>
Chambers wrote:
> I wasn't aware that the two were mutually exclusive.

In some sense, I think.

> Programming by contract creates the specification for your code.

Sort of, yes. More precisely, it formalizes the unit level of semantics of 
what your code is expected to do.

> TDD ensures that your code meets that specification.

Not TDD. TDD is "the test is the specification." If it passes the test, you 
don't change anything, and if it doesn't, it's broken by definition.

If your compiler could check your PbC was upheld by the implementation, 
would you need a test? If your test code tests something (and expects 
success) from something the PbC says should fail, which is right?

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.