Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Testing: Fun for the family

by adrianh (Chancellor)
on Mar 09, 2004 at 10:38 UTC ( #335051=note: print w/ replies, xml ) Need Help??


in reply to Testing: Fun for the family

At first blush, it seemed rather simple. The majority of my tests were simple things, "ok($foo=~/bar/)" which you could easily translate to english (or keep in english, if you're thinking that way). Simply: $foo should contain bar. and you have an english statement that does the same thing as perl.

Instead of using English, I'd take advantage of the most appropriate test function and use a test name for clarity. So your example could be written:

like( $foo, qr/bar/, 'foo contains bar' )
At the moment I can think of no real way to translate between all of the high level assumptions we make when we're describing the project specification, sense so many of these are context sensitive in various ways, I would need a English->Perl translator, which would probably put programmers out of a job if such a thing could actually be written. Anyone else have any ideas on describing the project spec in a higher level / more natural language but still being able to be used as a test?

You can always use Perl to make higher-level tests. I'm always writing little subroutines in test suites that capture a higher level testing concept.

Can you give an example of a higher level requirement that you think might be problematic?


Comment on Re: Testing: Fun for the family
Download Code
Re: Re: Testing: Fun for the family
by BUU (Prior) on Mar 09, 2004 at 11:24 UTC
    You can always use Perl to make higher-level tests. I'm always writing little subroutines in test suites that capture a higher level testing concept.
    Of course you can write higher level tests in perl. What I was trying to get at was writing higher level tests in a language thats a higher level then perl (such as english or some subset thereof).

    Maybe it's not possible and maybe even if it was possible theres no real win. After thinking about it for a while it occurs to me that such a system would be very close to a programming-language-as-english, which doesn't exist now and despite several attempts doesn't appear to be coming any time soon.
      After thinking about it for a while it occurs to me that such a system would be very close to a programming-language-as-english, which doesn't exist now and despite several attempts doesn't appear to be coming any time soon.
      And I don't believe it will ever come. The problem with every day English is that it isn't precise enough. Look for instance at math/physics in the 17th century. Why did it got such a boost at that time? Because then they moved away from formulating problems and solutions in natural languages (Latin, English, German, French) and started using math symbols.

      It's the same with programming (and hence testing), you need to be accurate in what you describe. Hence, programming languages.

      Abigail

      What I was trying to get at was writing higher level tests in a language thats a higher level then perl (such as english or some subset thereof).

      Sorry. Taking a firm grasp of the wrong end of the stick as usual!

      As you correctly point out what this boils down to is just-another-programming-language :-)

      You might be interested in taking a look at FIT - a slightly different approach to testing, especially at the higher acceptance test levels .

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-11-21 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (104 votes), past polls