Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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!!

..Jon

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'... ; )


Comment on Re: Re: Mock Objects
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.

    *snort*

    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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2014-09-17 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (56 votes), past polls