<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Why Perl is Ideal for All of Your Automated Testing (2 of 4)</title>
	<atom:link href="http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html</link>
	<description>Rantings of a Questionably Sane Chicken</description>
	<pubDate>Mon, 08 Sep 2008 01:23:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: 60srad</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-1264</link>
		<dc:creator>60srad</dc:creator>
		<pubDate>Fri, 21 Dec 2007 15:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-1264</guid>
		<description>I will concede that my biases against Perl have more to do with being old and set in my ways as a C programmer than with any shortcomings other than its cryptic nature and unnecessarily picky syntax.  (My biases against MFC are stronger and more justified, as are any and all biases against Micros***.)  Prior to using PHP, when all my web development was either HTML or CGI, I used Perl, on systems where I had no telnet access, solely as a way to bootstrap my way into the shell to run the C compiler!

However, the power of regular expressions does somewhat compensate for their less-than-intuitive (to my eye) structure, and the reason search engines, even Google, are not better than they are is that their logic has been dumbed down nearly to the LCD.  In direct contrast, the long-defunct WWWW (WorldWide Web Worm) of yore supported Perl regular expressions before I had any inkling what preg expressions were!</description>
		<content:encoded><![CDATA[<p>I will concede that my biases against Perl have more to do with being old and set in my ways as a C programmer than with any shortcomings other than its cryptic nature and unnecessarily picky syntax.  (My biases against MFC are stronger and more justified, as are any and all biases against Micros***.)  Prior to using PHP, when all my web development was either HTML or CGI, I used Perl, on systems where I had no telnet access, solely as a way to bootstrap my way into the shell to run the C compiler!</p>
<p>However, the power of regular expressions does somewhat compensate for their less-than-intuitive (to my eye) structure, and the reason search engines, even Google, are not better than they are is that their logic has been dumbed down nearly to the LCD.  In direct contrast, the long-defunct WWWW (WorldWide Web Worm) of yore supported Perl regular expressions before I had any inkling what preg expressions were!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manchicken</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-265</link>
		<dc:creator>manchicken</dc:creator>
		<pubDate>Thu, 05 Apr 2007 19:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-265</guid>
		<description>Sorry.  I was referring more to the tone of other commenters :)

I totally agree that folks should consider all available options when deciding how they want to do automated testing.  I did elude that my use of the word "ideal" was a bit of a stretch there.  Titles are intended to draw readers, and I think I achieved that.  Either way, we're talking about automated testing.  Maybe talking to it will translate into more of it.</description>
		<content:encoded><![CDATA[<p>Sorry.  I was referring more to the tone of other commenters <img src='http://www.manchicken.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I totally agree that folks should consider all available options when deciding how they want to do automated testing.  I did elude that my use of the word &#8220;ideal&#8221; was a bit of a stretch there.  Titles are intended to draw readers, and I think I achieved that.  Either way, we&#8217;re talking about automated testing.  Maybe talking to it will translate into more of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Good</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-264</link>
		<dc:creator>Matt Good</dc:creator>
		<pubDate>Thu, 05 Apr 2007 18:54:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-264</guid>
		<description>Well, in your first sentence you state "I will explain why Perl is **the** ideal language to automate your tests for any application" (emphasis mine).  My comment was not so much about Perl vs. Python in general, but that you should consider what tools are available in the language your developers are already using since while Perl may have good tools for testing, if your developers don't know Perl you'll be creating an additional hurdle to getting them to write tests.  When I worked in Java I used Jython occasionally to test out some code, or I used the Python command line to test an XML-RPC service I was writing in Java.  For these simple one-time tests I found Python to be a good tool, but I didn't make them part of the automated test suite since other developers would need to work on it who did not know Python.  When considering Perl as an automated testing tool you'll need to make similar considerations.  While your developers that know Perl may write really good tests with it, if it makes it more difficult for other developers to write tests then it's probably not the "ideal" choice.</description>
		<content:encoded><![CDATA[<p>Well, in your first sentence you state &#8220;I will explain why Perl is **the** ideal language to automate your tests for any application&#8221; (emphasis mine).  My comment was not so much about Perl vs. Python in general, but that you should consider what tools are available in the language your developers are already using since while Perl may have good tools for testing, if your developers don&#8217;t know Perl you&#8217;ll be creating an additional hurdle to getting them to write tests.  When I worked in Java I used Jython occasionally to test out some code, or I used the Python command line to test an XML-RPC service I was writing in Java.  For these simple one-time tests I found Python to be a good tool, but I didn&#8217;t make them part of the automated test suite since other developers would need to work on it who did not know Python.  When considering Perl as an automated testing tool you&#8217;ll need to make similar considerations.  While your developers that know Perl may write really good tests with it, if it makes it more difficult for other developers to write tests then it&#8217;s probably not the &#8220;ideal&#8221; choice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manchicken</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-262</link>
		<dc:creator>manchicken</dc:creator>
		<pubDate>Thu, 05 Apr 2007 17:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-262</guid>
		<description>Okay, I'm sorry, but I never thought the topic is why Perl is better than Python.  I'm talking about Perl being good for the specific task of automated testing.  Never have I said that Python was less anything than Perl.

If you would prefer to comment on Python's aptitude for automated testing, I have no problem with that.  Please stay on topic though.  This is a post about automated testing and how Perl is good for it, not a post on how Perl is better or Python is better.</description>
		<content:encoded><![CDATA[<p>Okay, I&#8217;m sorry, but I never thought the topic is why Perl is better than Python.  I&#8217;m talking about Perl being good for the specific task of automated testing.  Never have I said that Python was less anything than Perl.</p>
<p>If you would prefer to comment on Python&#8217;s aptitude for automated testing, I have no problem with that.  Please stay on topic though.  This is a post about automated testing and how Perl is good for it, not a post on how Perl is better or Python is better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Good</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-261</link>
		<dc:creator>Matt Good</dc:creator>
		<pubDate>Thu, 05 Apr 2007 16:34:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-261</guid>
		<description>In order to have effective testing you want to make sure all developers on the project are extremely comfortable with the tools.  Any test framework will have some learning curve, though if the developers also have to learn a new language it will significantly steepen that curve.

If Perl is already an essential language to know in your team then it may be a good fit for testing your code written  in other languages as well.  However if your team is not already comfortable with Perl they will probably not write as many or as good of tests as if the test framework used a language they are already familiar with.  A lot of developers still don't view tests as an "essential" part of development, so while they might be willing to dive in and learn Perl if it's part of the main development, if it's only used for testing they'll probably just do less testing rather than invest the time in learning Perl.

Paddy also mentioned the Python doctest module which is a good example of how language-specific tools can have major advantages.  I don't know of any other tools quite like doctest, and it's one of my favorite ways of writing tests.  With the module you can simple paste snippets from the Python interactive shell into your API documentation and doctest will extract and run these snippets as tests.  It's a great way to write both documentation and tests simultaneously.

So, a short example based on your code above:

def add_two(a, b):
  '''Adds two numbers and prints the
  operands:
  &#62;&#62;&#62; add_two(1, 2)
  Adding 1 and 2
  3

  Adding incompatible types produces
  an error:
  &#62;&#62;&#62; add_two(1, None)
  Traceback (most recent call last):
    ...
  TypeError: int argument required
  '''
  print "Adding %d and %d" % (a,b)
  return a + b


So, while I'm sure Perl has some good testing tools, before using it to test your non-Perl code be sure to compare it to the tools available for the language and make sure that your team will be comfortable with the tool you choose.</description>
		<content:encoded><![CDATA[<p>In order to have effective testing you want to make sure all developers on the project are extremely comfortable with the tools.  Any test framework will have some learning curve, though if the developers also have to learn a new language it will significantly steepen that curve.</p>
<p>If Perl is already an essential language to know in your team then it may be a good fit for testing your code written  in other languages as well.  However if your team is not already comfortable with Perl they will probably not write as many or as good of tests as if the test framework used a language they are already familiar with.  A lot of developers still don&#8217;t view tests as an &#8220;essential&#8221; part of development, so while they might be willing to dive in and learn Perl if it&#8217;s part of the main development, if it&#8217;s only used for testing they&#8217;ll probably just do less testing rather than invest the time in learning Perl.</p>
<p>Paddy also mentioned the Python doctest module which is a good example of how language-specific tools can have major advantages.  I don&#8217;t know of any other tools quite like doctest, and it&#8217;s one of my favorite ways of writing tests.  With the module you can simple paste snippets from the Python interactive shell into your API documentation and doctest will extract and run these snippets as tests.  It&#8217;s a great way to write both documentation and tests simultaneously.</p>
<p>So, a short example based on your code above:</p>
<p>def add_two(a, b):<br />
  &#8221;&#8217;Adds two numbers and prints the<br />
  operands:<br />
  &gt;&gt;&gt; add_two(1, 2)<br />
  Adding 1 and 2<br />
  3</p>
<p>  Adding incompatible types produces<br />
  an error:<br />
  &gt;&gt;&gt; add_two(1, None)<br />
  Traceback (most recent call last):<br />
    &#8230;<br />
  TypeError: int argument required<br />
  &#8221;&#8217;<br />
  print &#8220;Adding %d and %d&#8221; % (a,b)<br />
  return a + b</p>
<p>So, while I&#8217;m sure Perl has some good testing tools, before using it to test your non-Perl code be sure to compare it to the tools available for the language and make sure that your team will be comfortable with the tool you choose.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://www.manchicken.com/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-260</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Thu, 05 Apr 2007 04:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.notsosoft.net/2007/hacking/why-perl-is-ideal-for-all-of-your-automated-testing-2-of-4.html#comment-260</guid>
		<description>Python is just as portable as Perl - maybe moreso as it is also on PDA's and mobile phones.

Python can make use of other languages such as C, C++, Fortran;can call shared library functions/DLL's has implementations on the Java VM, and in .NET; has tools to convert Python to javascript to allow AJAX applications to have both server-side and client-side code originally written in Python.

The Python community focuses a lot on maintainable and testable code. There is much less spaghetti Python code out there and much less emphasis on code obfuscation within the community.

Python includes several 'Junit type' testing tools as well as a more pythonic Doctest module.

I agree that the most important hurdle is getting coders to do more testing. i disagree with your premise that Perl is the best too for the job ;-)

- Paddy.</description>
		<content:encoded><![CDATA[<p>Python is just as portable as Perl - maybe moreso as it is also on PDA&#8217;s and mobile phones.</p>
<p>Python can make use of other languages such as C, C++, Fortran;can call shared library functions/DLL&#8217;s has implementations on the Java VM, and in .NET; has tools to convert Python to javascript to allow AJAX applications to have both server-side and client-side code originally written in Python.</p>
<p>The Python community focuses a lot on maintainable and testable code. There is much less spaghetti Python code out there and much less emphasis on code obfuscation within the community.</p>
<p>Python includes several &#8216;Junit type&#8217; testing tools as well as a more pythonic Doctest module.</p>
<p>I agree that the most important hurdle is getting coders to do more testing. i disagree with your premise that Perl is the best too for the job <img src='http://www.manchicken.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>- Paddy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
