Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: Mock Objects

by theguvnor (Chaplain)
on Apr 12, 2002 at 00:22 UTC ( #158448=note: print w/replies, xml ) Need Help??

in reply to Re: Mock Objects
in thread The Joy of Test

You've just cracked the thought barrier that leads to formal methods. For each chunk of code, you create a list of assertions that impose constraints on what the code should do. Then you go through and make sure your code actually obeys those assertions. Formal methods take the idea a step farther by writing the assertions in mechanically-readable form, then running them through a postulate-matching engine to do the gruntwork of making sure everything checks. ... When you code to the assertions, you find yourself structuring programs so that no given operation can possibly fail. Ususally, you end up with a framework like so: ...

This is cool. Very cool. I admit that I didn't truly grasp your first paragraph at first read, and am still processing it. BUT, with the tutorial/example you gave, I saw the light! I will definitely try this! Thanks mstone - you have cracked my thought barrier, and I am looking forward to eliminating vast multi-level conditionals!!


Update: Thanks again mstone for providing links to (what I'm sure will be) some great resources. And BTW I could not imagine pronouncing 'Z' anything but 'zed'... ; )

Replies are listed 'Best First'.
Re3: Mock Objects
by mstone (Deacon) on Apr 12, 2002 at 17:43 UTC
    I admit that I didn't truly grasp your first paragraph at first read, and am still processing it.


    You should see the forehead-shaped dents in my wall. ;-)

    Really good ideas -- the ones that change the way you think because they change the way you look at things -- take time to absorb. I just happened to find this particular wall before you did.

    One paper you should definitely read before getting too far into the whole business is: What's Wrong With Formal Programming Methods? (PDF, 15 pages, 56K). It's a nice summary of the history and ideas behind formal methods, but doesn't beat you into the ground with impossible-to-type-on-a-regular-keyboard formalisms like the language Z (pronounced 'zed'). It's also a nice antidote to the full-gonzo 'more correct than thou' attitude some formal methods types can acquire.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158448]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-02-28 19:31 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (127 votes). Check out past polls.