<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ajaxian &#187; Testing</title>
	<atom:link href="http://ajaxian.com/by/topic/testing/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Tue, 22 May 2012 21:45:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
    	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Shim uses node.js to test sites on multiple browsers</title>
		<link>http://ajaxian.com/archives/shim-uses-node-js-to-test-sites-on-multiple-browsers</link>
		<comments>http://ajaxian.com/archives/shim-uses-node-js-to-test-sites-on-multiple-browsers#comments</comments>
		<pubDate>Sun, 15 Jan 2012 04:01:13 +0000</pubDate>
		<dc:creator>jvaughan</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=10760</guid>
		<description><![CDATA[Shim was developed within the Boston Globe&#8217;s media lab as a way to study how Web sites look on various devices and browsers. A laptop intercepts all wifi traffic – this is redirected to a custom node.js server &#8211; which inserts a javascript, or &#8220;shim,&#8221; at the head of each web page that is visited. <a href="http://ajaxian.com/archives/shim-uses-node-js-to-test-sites-on-multiple-browsers">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Shim was developed within the Boston Globe&#8217;s media lab as a way to study how Web sites look on various devices and browsers. A laptop intercepts all wifi traffic – this is redirected to a custom node.js server &#8211; which inserts a javascript, or &#8220;shim,&#8221; at the head of each web page that is visited.</p>
<p>The shim, once loaded in a device&#8217;s browser, opens and maintains a socket connection to the server, according to to Shim&#8217;s developers. Shim was written in 2011 by Chris Marstall, Creative Technologist at the Boston Globe. The software has been open sourced. Write the Shim originators on git.hub:</p>
<p>Whenever a new page is requested, the page&#8217;s URL is broadcast to all connected browsers, which then redirect themselves to that URL, keeping all devices in sync. <a href="https://github.com/marstall/shim/">Shim info is available on git.hub.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/shim-uses-node-js-to-test-sites-on-multiple-browsers/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Code injection, error throwing</title>
		<link>http://ajaxian.com/archives/code-injection-error-throwing</link>
		<comments>http://ajaxian.com/archives/code-injection-error-throwing#comments</comments>
		<pubDate>Sat, 11 Jun 2011 03:01:12 +0000</pubDate>
		<dc:creator>jvaughan</dc:creator>
				<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=10673</guid>
		<description><![CDATA[In a blog, Opera Software Developer Relations team member Tiffany B. Brown looks at code injection, error throwing and handling and mobile debugging. She notes Opera Dragonfly and its remote debug features provide a way to debug mobile sites from their desktop. Brown mentions WebKit&#8217;s recently added remote debugging capabilities, folded into Google Chrome developer <a href="http://ajaxian.com/archives/code-injection-error-throwing">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>In a blog, Opera Software Developer Relations team member Tiffany B. Brown looks at <a href="http://www.alistapart.com/articles/modern-debugging-tips-and-tricks/">code injection, error throwing and handling and mobile debugging.</a> She notes Opera Dragonfly and its remote debug features provide a way to debug mobile sites from their desktop. Brown mentions WebKit&#8217;s recently added remote debugging capabilities, folded into Google Chrome developer tools. Pointed to as well are Bugaboo, an iOS app for Safari-based debugging; JS Console which is available on the Web or as an iOS app; and Weinre for WebKit-based browsers. In this entry, Brown looks more closely at Dragonfly remote debug and JSConsole.</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/code-injection-error-throwing/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Best Practices for test revisited</title>
		<link>http://ajaxian.com/archives/best-practices-for-test-revisited</link>
		<comments>http://ajaxian.com/archives/best-practices-for-test-revisited#comments</comments>
		<pubDate>Fri, 08 Apr 2011 17:08:30 +0000</pubDate>
		<dc:creator>jvaughan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=10538</guid>
		<description><![CDATA[With Google and their apps like Search, Docs or GMail only a very small time is actually spent in the initial page load, writes Andreas Grabner in a recent blog post. Of course, much time is spent in JavaScript, XHR Calls and DOM Manipulations triggered by user actions. Grabner writes: It is very important to <a href="http://ajaxian.com/archives/best-practices-for-test-revisited">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>With Google and their apps like Search, Docs or GMail only a very small time is actually spent in the initial page load, writes <a href="http://blog.dynatrace.com/2011/03/22/testing-and-optimizing-single-page-web-2-0ajax-applications-why-best-practices-alone-dont-work-any-more/">Andreas Grabner in a recent blog post</a>. Of course, much time is spent in JavaScript, XHR Calls and DOM Manipulations triggered by user actions. Grabner writes:</p>
<blockquote><p><em>It is very important to speed up Page Load Time – don’t get me wrong. It is the initial perceived performance by a user who interacts with your site. But it is not all we need to focus on. Most of the time in modern web applications is spent in JavaScript, DOM Manipulations, XHR Calls and Rendering that happen after the initial page load. Automatic verification against Best Practices won’t work here anymore because we have to analyze individual user actions that do totally different things. The way this will work is to analyze the individual user actions, track performance metrics and automate regression detection based on these measured values.</em></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/best-practices-for-test-revisited/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthetic Event Library Syn Aims to Make Testing Easier</title>
		<link>http://ajaxian.com/archives/synthetic-event-library-syn-aims-to-make-testing-easier</link>
		<comments>http://ajaxian.com/archives/synthetic-event-library-syn-aims-to-make-testing-easier#comments</comments>
		<pubDate>Wed, 14 Jul 2010 16:54:17 +0000</pubDate>
		<dc:creator>Rey Bango</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9812</guid>
		<description><![CDATA[The team at Jupiter IT have release Syn, a library which allows you to create synthetic events for use in testing. This standalone library is meant to assist in testing complex UI behavior by simulating user actions such as typing, clicking, dragging the mouse. Testing rich, dynamic web applications sucks. At Jupiter, we've tried almost <a href="http://ajaxian.com/archives/synthetic-event-library-syn-aims-to-make-testing-easier">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>The team at <a href="http://jupiterjs.com/">Jupiter IT</a> have release <a href="http://jupiterjs.com/#news/syn-a-standalone-synthetic-event-library">Syn</a>, a library which allows you to create synthetic events for use in testing. This standalone library is meant to assist in testing complex UI behavior by simulating user actions such as typing, clicking, dragging the mouse.</p>
<blockquote><p>Testing rich, dynamic web applications sucks. At Jupiter, we've tried almost every testing solution available (qUnit, Quick Test Pro, Selenium, JsUnit, Env.js, TestCase) and all of them suffer from some fatal flaw. </p>
<p><strong>Problems:</strong></p>
<ul>
<li>Manual - A tester has to run the tests manually on every supported browser. &nbsp;People are lazy.&nbsp;</li>
<li>Unit Tests Only - We need to test the app as a whole and complex UI behavior like drag-drop.</li>
<li>Low fidelity - We need to make sure the tests are reporting accurate results.</li>
<li>Difficult to write - We sling JS like a ninja monkey throws poo. &nbsp;We want to write tests in a nice JS API.</li>
<li>Expensive - A QTP license is 5k a person! &nbsp;I'd rather buy a vacation.</li>
<li>Support - We want to test Mac and Linux browsers.</li>
</ul>
<p>We've solved all of these problems in our upcoming FuncUnit testing framework. It's a mashup of qUnit, Selenium, Rhino, and Env.js. But its core library, Syn, which does the work of simulating user actions with very high fidelity, is what we are releasing today.</p>
</blockquote>
<p>So by using code like this:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-2');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">Syn.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>,<span style="color: #3366CC;">'hello'</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;.<span style="color: #006600;">type</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #3366CC;">'Hello World'</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;.<span style="color: #006600;">drag</span><span style="color:#006600; font-weight:bold;">&#40;</span> $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#trash'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>you can simulate clicking an element with id='hello', typing "Hello World", and then dragging your mouse from that element to an element with id='trash'.</p>
<p>Pretty cool stuff. Check out their <a href="http://v3.javascriptmvc.com/funcunit/synthetic/synthetic.html">demo to see how playback occurs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/synthetic-event-library-syn-aims-to-make-testing-easier/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Keep your vows; Keeping wed to Node</title>
		<link>http://ajaxian.com/archives/keep-your-vows-keeping-wed-to-node</link>
		<comments>http://ajaxian.com/archives/keep-your-vows-keeping-wed-to-node#comments</comments>
		<pubDate>Thu, 01 Jul 2010 11:14:55 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9728</guid>
		<description><![CDATA[Vows can be a beautiful thing. Alexis Sellier of LESS fame, is becoming an open source star. This time around he brings us Vows an asynchronous-friendly behavior driven development framework for Node.js. Write you BBD specs like this: PLAIN TEXT JAVASCRIPT: &#160; // division-by-zero-test.js &#160; var vows = require&#40;'vows'&#41;, &#160; &#160; assert = require&#40;'assert'&#41;; &#160; <a href="http://ajaxian.com/archives/keep-your-vows-keeping-wed-to-node">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Vows can be a beautiful thing. <a href="http://cloudhead.io/">Alexis Sellier</a> of LESS fame, is becoming an open source star. This time around he brings us <a href="http://vowsjs.org/">Vows</a> an asynchronous-friendly behavior driven development framework for Node.js.</p>
<p><a href="http://vowsjs.org/"><img src="http://ajaxian.com/wp-content/images/vowsjs.png" alt="" title="vowsjs" width="460" height="216" class="alignnone size-full wp-image-9729" /></a></p>
<p>Write you BBD specs like this:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-5');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// division-by-zero-test.js</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> vows = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'vows'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; assert = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'assert'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Create a Test Suite</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">vows.<span style="color: #006600;">describe</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Division by Zero'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">addBatch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">'when dividing a number by zero'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color:#800000;">42</span> / <span style="color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'we get Infinity'</span>: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assert.<span style="color: #006600;">equal</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic, Infinity<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">'but when dividing zero by zero'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color:#800000;">0</span> / <span style="color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'we get a value which'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'is not a number'</span>: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assert.<span style="color: #006600;">isNaN</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'is not equal to itself'</span>: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assert.<span style="color: #006600;">notEqual</span> <span style="color:#006600; font-weight:bold;">&#40;</span>topic, topic<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">run</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">// Run it</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>and you get a very nice report card out of the other end:</p>
<p><img src="http://ajaxian.com/wp-content/images/vowsoutput.png" alt="" title="vowsoutput" width="460" height="301" class="alignnone size-full wp-image-9730" /></p>
<p>With macros you end up with very nice DSL syntax such as:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-6');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp;<span style="color: #3366CC;">'GET /'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: api.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'shoud respond with a 200 OK'</span>: assertStatus<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">'POST /'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: api.<span style="color: #006600;">post</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'shoud respond with a 405 Method not allowed'</span>: assertStatus<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">405</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">'GET /resources (no api-key)'</span>: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: api.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/resources'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'shoud respond with a 403 Forbidden'</span>: assertStatus<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">403</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">'GET /resources?apikey=af816e859c249fe'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; topic: api.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/resources?apikey=af816e859c249fe'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'shoud return a 200 OK'</span>: assertStatus<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'should return a list of resources'</span>: <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>res<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assert.<span style="color: #006600;">isArray</span> <span style="color:#006600; font-weight:bold;">&#40;</span>res.<span style="color: #006600;">body</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// or even</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">'GET&nbsp; /'</span>:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;respondsWith<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">'POST /'</span>:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;respondsWith<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">405</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">'GET&nbsp; /resources (no key)'</span>: respondsWith<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">403</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>The website itself goes into exquisite detail on the install process, sample usage, and more. The website also happens to be beautiful itself, and full of HTML5 markup to boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/keep-your-vows-keeping-wed-to-node/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A/B testing your Cohorts with Google Analytics result views</title>
		<link>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views</link>
		<comments>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views#comments</comments>
		<pubDate>Tue, 08 Jun 2010 11:37:28 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9519</guid>
		<description><![CDATA[PLAIN TEXT JAVASCRIPT: &#160; var header_test = new Cohorts.Test&#40;&#123; &#160; &#160; name: 'big_vs_small_header', &#160; &#160; sample: 1, // we want to include all visitors in the test &#160; &#160; cohorts: &#123; &#160; &#160; &#160; &#160; big: &#123; &#160; &#160; &#160; &#160; &#160; &#160; onChosen: function&#40;&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $&#40;'#big'&#41;.show&#40;&#41;; <a href="http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<div class="igBar"><a href="javascript:showCodeTxt('javascript-8');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> header_test = <span style="color: #003366; font-weight: bold;">new</span> Cohorts.<span style="color: #006600;">Test</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">name</span>: <span style="color: #3366CC;">'big_vs_small_header'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; sample: <span style="color:#800000;">1</span>, <span style="color: #009900; font-style: italic;">// we want to include all visitors in the test</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cohorts: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; big: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChosen: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#big'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; small: <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChosen: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#small'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#big'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; header_test.<span style="color: #006600;">event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Clicked on Header'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'#small'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; header_test.<span style="color: #006600;">event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Clicked on Header'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>The code above shows you exactly how you could run a test that shows either a large, or small clickable header... and gives you A/B results on how many were clicked.</p>
<p>This is all view a new library called <a href="http://github.com/jamesyu/cohorts">Cohorts</a> by James Yu:</p>
<blockquote><p>
Cohorts is a simple, purely javascript, multivariate testing framework.</p>
<p>It allows you to easily run split tests for visitors on your site, showing them different designs, layouts, or whatever you want. Cohorts also allows you to track interesting events that occur for each of the cohorts. By default, it uses Google Analytics event tracking to store data, but you can customize it to use your own or another.
</p></blockquote>
<p>Very nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/ab-testing-your-cohorts-with-google-analytics-result-views/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mock Data Randomizer</title>
		<link>http://ajaxian.com/archives/mock-data-randomizer</link>
		<comments>http://ajaxian.com/archives/mock-data-randomizer#comments</comments>
		<pubDate>Thu, 20 May 2010 11:16:50 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9309</guid>
		<description><![CDATA[Mike Wilcox has written about a nice little tool for folks who test their JavaScript code. The Mock Data Randomizer is fairly self-explanatory: PLAIN TEXT JAVASCRIPT: &#160; rand.sentences&#40;6,7,7,9&#41;; // # of words in sentences rand.real = true; rand.sentences&#40;6,7,7,9&#41;; &#160; would generate something like: Whut koop mida miins knew eftor kind. Deys evin thaaght has plecu <a href="http://ajaxian.com/archives/mock-data-randomizer">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://clubajax.org/wp-content/uploads/2010/05/random2-blog.png" width="480"/></p>
<p>Mike Wilcox has written about a nice little tool for folks who test their JavaScript code. The <a href="http://clubajax.org/mock-data-randomizer/">Mock Data Randomizer</a> is fairly self-explanatory:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-11');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-11">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">sentences</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">6</span>,<span style="color:#800000;">7</span>,<span style="color:#800000;">7</span>,<span style="color:#800000;">9</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">// # of words in sentences</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">real</span> = <span style="color: #003366; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">sentences</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">6</span>,<span style="color:#800000;">7</span>,<span style="color:#800000;">7</span>,<span style="color:#800000;">9</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>would generate something like:</p>
<blockquote><p>
Whut koop mida miins knew eftor kind. Deys evin thaaght has plecu uthur melos. Eftor shaeld ha lift hend wath ets unto big. Huwovir till lergi wa kind olsa con bofare. Yaor sentonca sean cemu man in whoch man. Mi sentonca nught get fund very onswar tui plecu. Shew en geed liva knew poiplu childrun ilung gat. </p>
<p>Far night very land room for then we. First kind turned out is own usually back much. Read sometimes since does answer himself into much. Live not for large hand important they. People another sea across across even world. Water could things young by white own only very.
</p></blockquote>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-12');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">date</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">date</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>seconds:<span style="color: #003366; font-weight: bold;">true</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">date</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>delimiter:<span style="color: #3366CC;">"/"</span>, yearRange:-<span style="color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">date</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>delimiter:<span style="color: #3366CC;">"/"</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">rand.<span style="color: #006600;">date</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>min:<span style="color: #003366; font-weight: bold;">new</span> Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'11/20/1964'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, max:<span style="color: #3366CC;">"4/19/1969"</span>, delimiter:<span style="color: #3366CC;">"-"</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>would generate something like:</p>
<blockquote><p>
Mon Feb 14 2011 14:13:17 GMT-0800 (PST)<br />
1296270214154<br />
08/04/2005<br />
10/10/2010<br />
02-05-1967
</p></blockquote>
<p>Check out the <a href="http://clubajax.org/files/rand.html">live demo to see it in action</a> and then <a href="http://code.google.com/p/clubajax/source/browse/trunk/lang/rand.js">view the source</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/mock-data-randomizer/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Put your own tests up on BrowserScope</title>
		<link>http://ajaxian.com/archives/put-your-own-tests-up-on-browserscope</link>
		<comments>http://ajaxian.com/archives/put-your-own-tests-up-on-browserscope#comments</comments>
		<pubDate>Mon, 19 Apr 2010 12:00:36 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9054</guid>
		<description><![CDATA[Lindsey Simon has got a powerful update to BrowserScope, the community-driven tool to test and profile browsers. The new feature is exciting as it truly delivers the "community-driven" piece at scale: you can now add your own tests to the corpus, TestSwarm style. Now, the two are very different of course as TestSwarm is about <a href="http://ajaxian.com/archives/put-your-own-tests-up-on-browserscope">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Lindsey Simon has <a href="http://is.onthafly.com/2010/04/user-tests-in-browserscope.html">got a powerful update</a> to <a href="http://www.browserscope.org/">BrowserScope</a>, the community-driven tool to test and profile browsers. The new feature is exciting as it truly delivers the "community-driven" piece at scale: you can now <a href="http://www.browserscope.org/user/tests/howto">add your own tests to the corpus</a>, TestSwarm style. Now, the two are very different of course as TestSwarm is about having many browsers test *your* code, and BrowserScope is more about testing the browsers in general.</p>
<p>Here is what Lindsey says:</p>
<blockquote><p>
It seems like nearly every week we read about an interesting new hosted test for people to visit and run their browsers through (recent examples include <a href="http://html5test.com/">html5test.com</a> and <a href="http://findmebyip.com/">findmebyip.com</a>). Developers really love to poke at the black boxes they code for - and the matrix of browsers, OS, and networks is enormous. One thing I, and I presume other developers, would love to see are the aggregated results for these tests by user agent. Considering this is exactly what we built&nbsp;Browser&nbsp;to accomplish for our test categories, and that a user-hosted test feature has been on our <a href="http://code.google.com/p/browserscope/wiki/Roadmap">Roadmap</a>,&nbsp;the Browserscope team is happy to announce that we're opening up an alpha of our <a href="http://www.browserscope.org/user/tests/howto">User Tests feature</a>.</p>
<p>Conveniently, this past week a User Tests use case came up for me at work and so it's been a driver for building this feature. We began working on a UI component that we wanted to test for speed of task completion. After building up <a href="http://groupmenuselect.appspot.com/">a test page with a timer and some deltas</a> it dawned on me just how cool it would be to open up this test to the world, and aggregate the results. The test is kind of strange in that the the UI component is out of its context, and you can argue about the mechanics of the test itself, but I still feel like the results may be informative. Interestingly too, this test is exactly the kind of thing we would *not* want to feature on the homepage of Browserscope (it's more of a performance test than a spec/binary test). And yet, the backend system with its median aggregation, scalability, and user-agent parsing library is a perfect fit. So check it out - and see <a href="http://groupmenuselect.appspot.com/results">how other people are doing on the test</a>&nbsp;(courtesy of Browserscope).</p>
<p>This is definitely a release early/often feature, and we want to be explicit that things may change or break in the API while we're in alpha mode. We may have to take the service offline briefly to fix things. But if you write tests for browsers and want to aggregate your results, sign in to Browserscope,&nbsp;<a href="http://www.browserscope.org/user/settings">register your test page</a>&nbsp;and then read the <a href="http://www.browserscope.org/user/tests/howto">HOWTO</a>&nbsp;to start saving your results in the system.&nbsp;Please send any feedback to <a href="mailto:elsigh@gmail.com">me</a> or to our&nbsp;<a href="http://groups.google.com/group/browserscope">mailing list</a>. We really hope to make this an easy system to use for the tests you're already hosting.
</p></blockquote>
<p>I hope that we see a bunch of tests in there. One advantage of the browser scope approach is that it self-updates. A lot of the other sites are static, and when new browser versions come out the new feature data isn't reflected. It could be cool for example, if the <a href="http://ajaxian.com/archives/html5-and-css3-readiness-visualization">readiness visualization</a> pulled the data from a JSON feed from BrowserScope :)</p>
<p>Thanks for doing this Lindsey and team!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/put-your-own-tests-up-on-browserscope/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Harmony: Bringing together great libraries to enable awesome JS testing in Ruby</title>
		<link>http://ajaxian.com/archives/harmony-bringing-together-great-libraries-to-enable-awesome-js-testing-in-ruby</link>
		<comments>http://ajaxian.com/archives/harmony-bringing-together-great-libraries-to-enable-awesome-js-testing-in-ruby#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:05:04 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8607</guid>
		<description><![CDATA[Martin Aumont has released Harmony, which "provides a simple DSL to execute JavaScript and DOM code within Ruby." This enables you to do very cool things such as unit test JavaScript in the same area as your Ruby tests: PLAIN TEXT RUBY: require 'test/unit' require 'harmony' class JavascriptTest &#60;Test::Unit::TestCase &#160; def setup &#160; &#160; @page <a href="http://ajaxian.com/archives/harmony-bringing-together-great-libraries-to-enable-awesome-js-testing-in-ruby">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Martin Aumont has released <a href="http://github.com/mynyml/harmony">Harmony</a>, which "provides a simple DSL to execute JavaScript and DOM code within Ruby."</p>
<p>This enables you to do very cool things such as unit test JavaScript in the same area as your Ruby tests:</p>
<div class="igBar"><a href="javascript:showCodeTxt('ruby-15');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">RUBY:</span>
<div id="ruby-15">
<div>
<ol>
require 'test/unit'<br />
require 'harmony'</p>
<p>class JavascriptTest &lt;Test::Unit::TestCase<br />
&nbsp; def setup<br />
&nbsp; &nbsp; @page = Harmony::Page.new<br />
&nbsp; &nbsp; @page.load('public/javascripts/foo.js')<br />
&nbsp; end</p>
<p>&nbsp; def test_foo<br />
&nbsp; &nbsp; assert_equal &quot;world&quot;, @page.execute_js(&lt;&lt;-JS)<br />
&nbsp; &nbsp; &nbsp; foo = new Foo;<br />
&nbsp; &nbsp; &nbsp; foo.hello();<br />
&nbsp; &nbsp; JS<br />
&nbsp; end<br />
end
</ol>
</div>
</div>
</div>
<p>and you can even use JavaScript libraries.... as script tags are autofetched:</p>
<div class="igBar"><a href="javascript:showCodeTxt('ruby-16');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">RUBY:</span>
<div id="ruby-16">
<div>
<ol>
require 'harmony'</p>
<p>page = Harmony::Page.new(&lt;&lt;-HTML)<br />
&nbsp; &lt;html&gt;<br />
&nbsp; &nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;script src=&quot;javascripts/jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &lt;/head&gt;<br />
&nbsp; &nbsp; &lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;div id=&quot;widget&quot;&gt;ohaie&lt;/div&gt;<br />
&nbsp; &nbsp; &lt;/body&gt;<br />
&nbsp;<br />
HTML</p>
<p>page.execute_js(&quot;$('#widget').innerHTML&quot;) #=&gt; &quot;ohaie&quot;
</ol>
</div>
</div>
</div>
<p>This library builds on the shoulders of giants, one of which is Mr. <a href="http://github.com/jbarnette/johnson/">Johnson</a>, <a href="http://www.workingwithrails.com/person/10668-john-barnette">John Barnette</a> who I had the pleasure of working with many moons ago. He is the person I think of when I remember that the best engineers that I have worked with haven't been computer scientists, but musicians and biologists. He is also a great fun guy.</p>
<p>Anyway, sorry for the aside.</p>
<p>If you are a Rails chap, you may also be interested in the Rails plugin <a href="http://github.com/mynyml/holygrail">holygrail</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/harmony-bringing-together-great-libraries-to-enable-awesome-js-testing-in-ruby/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Helium CSS: JavaScript Library to test your CSS usage</title>
		<link>http://ajaxian.com/archives/heliumcss</link>
		<comments>http://ajaxian.com/archives/heliumcss#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:29:22 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8462</guid>
		<description><![CDATA[Geuis Teses has released an enjoyable library called Helium that has the goal of testing your stylesheets for unused style. You inject helium into your site (e.g. put it in an included footer) and then when you hit the first page you will have a popup asking for the pages you want to test. Helium <a href="http://ajaxian.com/archives/heliumcss">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Geuis Teses has released an enjoyable library called <a href="http://github.com/geuis/helium-css">Helium</a> that has the goal of testing your stylesheets for unused style.</p>
<p>You inject helium into your site (e.g. put it in an included footer) and then when you hit the first page you will have a popup asking for the pages you want to test. Helium will find the style sheets that you use and will store that information and the page information inside of localStorage. Then it will XHR around (so your styles need to be on the same host), test each page, and finally give you results.</p>
<p>I put up a <a href="http://almaer.com/heliumtest/">trivial example</a> to give it a ride and ended up with:</p>
<p><img src="http://ajaxian.com/wp-content/images/heliumcss.png" alt="heliumcss" title="heliumcss" width="480" height="194" class="alignnone size-full wp-image-8463" /></p>
<p>I ran into a minor issue with regards to relative stylesheets so I did the Github thing and <a href="http://github.com/dalmaer/helium-css">forked, fixed, and pull requested</a>. I love Github :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/heliumcss/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Evidence; that your code will work</title>
		<link>http://ajaxian.com/archives/evidence-that-your-code-will-work</link>
		<comments>http://ajaxian.com/archives/evidence-that-your-code-will-work#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:53:00 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7901</guid>
		<description><![CDATA[Tobie Langel of Prototype fame has created another unit testing library for JavaScript. Another one I hear you say? Well, if Tobie did it.... it is worth checking out. Time to get some Evidence. I found out about it over dinner in Berlin at the great JSConf.EU. At the table were 6 people from 6 <a href="http://ajaxian.com/archives/evidence-that-your-code-will-work">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://tobielangel.com">Tobie Langel</a> of Prototype fame has created another unit testing library for JavaScript. Another one I hear you say? Well, if Tobie did it.... it is worth checking out. Time to get some <a href="http://github.com/tobie/evidence">Evidence</a>.</p>
<p>I found out about it over dinner in Berlin at the great JSConf.EU. At the table were 6 people from 6 different countries. Go JavaScript diversity :)  I first asked "BDD?" and Tobie spat out "No, I friggin hate BDD, especially for JS" before I had even finished the question.</p>
<p>Tobie gave a <a href="http://www.slideshare.net/tobielangel/unittesting-javascript-with-evidence">talk on Evidence</a> at the show, and explained the focus of the library:</p>
<ul>
<li>Library agnostic (the scripty based one in Prototype was based on Prototype which is weird when you test yourself)
</li>
<li>Environment agnostic (e.g. not just in the browser)
</li>
<li>Self contained (no global pollution)
</li>
<li>Built with async in mind (in JS / client server / anything real, you gotta do async)
</li>
<li>Easy to automate
</li>
</ul>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-18');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-18">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">Evidence.<span style="color: #006600;">TestCase</span>.<span style="color: #006600;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'ArrayTest'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; setUp: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'foo'</span>, <span style="color: #3366CC;">'bar'</span>, <span style="color: #3366CC;">'baz'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; testFirst: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">assertEqual</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'foo'</span>, _.<span style="color: #006600;">first</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">assertUndefined</span><span style="color:#006600; font-weight:bold;">&#40;</span>_.<span style="color: #006600;">first</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; testLast: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">assertEqual</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'bar'</span>, _.<span style="color: #006600;">last</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'Failed to grab the last element of the array.'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">assertUndefined</span><span style="color:#006600; font-weight:bold;">&#40;</span>_.<span style="color: #006600;">last</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/evidence-that-your-code-will-work/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Riot.js: JavaScript port of the lean fast unit test framework</title>
		<link>http://ajaxian.com/archives/riot-js-javascript-port-of-the-lean-fast-unit-test-framework</link>
		<comments>http://ajaxian.com/archives/riot-js-javascript-port-of-the-lean-fast-unit-test-framework#comments</comments>
		<pubDate>Thu, 05 Nov 2009 11:12:09 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7857</guid>
		<description><![CDATA[Riot started as a lean Ruby unit test framework with tests that have a style like this: PLAIN TEXT RUBY: context &#34;a new user&#34; do &#160; setup { User.new } &#160; asserts(&#34;that it is not yet created&#34;) { topic.new_record? } end Alex Young has now implemented Riot.js which brings you the lean framework in a <a href="http://ajaxian.com/archives/riot-js-javascript-port-of-the-lean-fast-unit-test-framework">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Riot started as a <a href="http://github.com/thumblemonks/riot/">lean Ruby unit test framework</a> with tests that have a style like this:</p>
<div class="igBar"><a href="javascript:showCodeTxt('ruby-21');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">RUBY:</span>
<div id="ruby-21">
<div>
<ol>
context &quot;a new user&quot; do<br />
&nbsp; setup { User.new }<br />
&nbsp; asserts(&quot;that it is not yet created&quot;) { topic.new_record? }<br />
end
</ol>
</div>
</div>
</div>
<p>Alex Young has now implemented <a href="http://github.com/alexyoung/riotjs">Riot.js</a> which brings you the lean framework in a format that can run stand-along via Rhino, or through the browser itself with tests that look like:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-22');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-22">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">Riot.<span style="color: #006600;">run</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; context<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'basic riot functionality'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; given<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'some simple equality tests'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; asserts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'a simple truth test should return true'</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">isTrue</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; asserts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'isNull is null'</span>, <span style="color: #003366; font-weight: bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">isNull</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; given<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'another context'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; asserts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'equals should compare strings as expected'</span>, <span style="color: #3366CC;">'test string'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">equals</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'test string'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; given<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'a context concerned with functions'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; asserts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'asserts() should allow functions to be compared'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'test string'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">equals</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'test string'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; given<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'yet another context'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; asserts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'equals should compare strings as expected'</span>, <span style="color: #3366CC;">'test string'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">equals</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'test string'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/riot-js-javascript-port-of-the-lean-fast-unit-test-framework/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QUnit &#8211; A JavaScript Unit Testing Framework</title>
		<link>http://ajaxian.com/archives/qunit-a-javascript-unit-testing-framework</link>
		<comments>http://ajaxian.com/archives/qunit-a-javascript-unit-testing-framework#comments</comments>
		<pubDate>Thu, 01 Oct 2009 17:30:34 +0000</pubDate>
		<dc:creator>webreflection</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7493</guid>
		<description><![CDATA[There are many options for JavaScript Unit Testing but a "de facto" standard for the jQuery library, related plug-ins, and jQuery UI is QUnit. Nothing new so far? Check this out: According to tweets from John Resig the state of QUnit is: QUnit is now completely standalone (it no longer depends upon jQuery) QUnit now <a href="http://ajaxian.com/archives/qunit-a-javascript-unit-testing-framework">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>There are many options for JavaScript Unit Testing but a "<em>de facto</em>" standard for the <a href="http://jquery.com/">jQuery</a> library, related plug-ins, and jQuery UI is <a href="http://docs.jquery.com/QUnit">QUnit</a>. Nothing new so far? Check this out:</p>
<p><img class="alignnone" title="Change Log" src="http://www.3site.eu/ajaxian/QUnit.gif" alt="" width="591" height="115" /></p>
<p>According to <a href="http://twitter.com/jeresig">tweets from John Resig</a> the state of QUnit is:</p>
<ol>
<li><span><span>QUnit is now completely standalone (it no longer depends upon jQuery)</span></span></li>
<li><span><span>QUnit now works outside of a browser (in Rhino, Spidermonkey, V8, JavaScriptCore, etc.)</span></span></li>
<li><span><span>QUnit is now completely moved over to Github: <a rel="nofollow" href="http://github.com/jquery/qunit" target="_blank">http://github.com/jquery/qunit</a></span></span></li>
</ol>
<p>The latest news is that QUnit is now a <a href="http://github.com/tlrobinson/narwhal/commit/b92651b0b3d244bcf6ae75ea73fceb56b0694cd9">CommonJS/NarwhalJS package</a> that can be installed using tusk 'tusk install qunit'.</p>
<p>Thanks John for bringing some fresh air into JavaScript Unit Testing and Agile projects! I wonder if there is any plan to use QUnit via <a href="http://github.com/jeresig/fireunit/">Fireunit</a> as well...</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/qunit-a-javascript-unit-testing-framework/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>BrowserScope: UAProfiler++, Crowd source browser tests</title>
		<link>http://ajaxian.com/archives/browserscope</link>
		<comments>http://ajaxian.com/archives/browserscope#comments</comments>
		<pubDate>Mon, 14 Sep 2009 10:07:55 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7370</guid>
		<description><![CDATA[We are good friends with Steve Souders, but his UA Profiler just got beaten by something much better: BrowserScope. Fortunately for him, he and a new team are the ones who beat it :) Lindsey Simon says it best: Browserscope is an open-source project for profiling web browsers and storing and aggregating crowd-sourced data about <a href="http://ajaxian.com/archives/browserscope">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>We are good friends with Steve Souders, but his UA Profiler just got beaten by something much better: <a href="http://www.browserscope.org/">BrowserScope</a>. Fortunately for him, <a href="http://www.stevesouders.com/blog/2009/09/13/browserscope-how-does-your-browser-compare/">he and a new team</a> are the ones who beat it :)</p>
<p><img src="http://ajaxian.com/wp-content/uploads/browserscope.png" alt="" title="browserscope" width="500" height="359" class="alignnone size-full wp-image-7371" /></p>
<p>Lindsey Simon <a href="http://is.onthafly.com/2009/09/announcing-browserscope.html">says it best</a>:</p>
<blockquote><p>
Browserscope is an open-source project for profiling web browsers and storing and aggregating crowd-sourced data about browser performance.</p>
<p>The goals are to foster innovation by tracking browser functionality and to be a resource for web developers.</p>
<p>Browserscope is based on Steve Souders' <a href="http://stevesouders.com/ua">UA Profiler</a>, and his original tests have been preserved here as the Network test category. Other test categories include Ian Hickson's <a href="http://www.browserscope.org/acid3/about">Acid3 test</a> (ported by Jacob Moon into Browserscope), Annie Sullivan's <a href="http://www.browserscope.org/richtext/about">Rich Text Edit Mode tests</a>, and John Resig's <a href="http://www.browserscope.org/selectors/about">Selectors API Test Suite</a> (ported by Lindsey Simon into Browserscope).
</p></blockquote>
<p>This one more evolution, and more is to come:</p>
<ul>
<li>Visualize test result trends over time
</li>
<li>Wall of fame, up-and-comers, Billboard top 50
</li>
<li>More test categories - cookies, security, reflow
</li>
<li>More contributors
</li>
<li>Tagged/personalized test results
</li>
<li>Normalize time-based results across platforms
</li>
<li>User agent parsing library
</li>
</ul>
<p>The guys are on hand to announce BrowserScope at The Ajax Experience this week!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/browserscope/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TestSwarm: Crowdsource your continuous tests for JavaScript</title>
		<link>http://ajaxian.com/archives/testswarm-crowdsource-your-continuous-tests-for-javascript</link>
		<comments>http://ajaxian.com/archives/testswarm-crowdsource-your-continuous-tests-for-javascript#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:01:20 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7295</guid>
		<description><![CDATA[It has been a pleasure to watch John build TestSwarm and see its alpha release today. It is an ambitious project to help developers get real world testing across browsers. Here you can see it all at work: John talks about some of the fun challenges: TestSwarm ended up being a very challenging project to <a href="http://ajaxian.com/archives/testswarm-crowdsource-your-continuous-tests-for-javascript">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm4.static.flickr.com/3428/3856960475_7f9476322b.jpg"/></p>
<p>It has been a pleasure to watch John build <a href="http://ejohn.org/blog/test-swarm-alpha-open/">TestSwarm and see its alpha release today</a>. It is an ambitious project to help developers get real world testing across browsers. Here you can see it all at work:</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6281121&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6281121&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>
<p>John talks about some of the fun challenges:</p>
<blockquote><p>
TestSwarm ended up being a very challenging project to get to an alpha state (and probably will be even more challenging to get to a final release state). Dealing with cross-browser incompatibilities, cross-domain test suite execution, and asynchronous, distributed, client execution has been more than enough to make for a surprisingly difficult project. It's mostly written in PHP and uses MySQL as a back end (allowing it to run in virtually any environment). Patches will absolutely be appreciated.
</p></blockquote>
<p>And, has <a href="http://wiki.github.com/jeresig/testswarm">a detailed look at the project</a>. This is early days (hence alpha) yet beyond stabilization, John has the vision for some cool features:</p>
<ul>
<li>A pastebin-like service where you can drop in code and see the results come back, from many browsers, in real-time.
</li>
<li>IDE integration for sending minor changes out for quick testing.
</li>
<li>Manual testing of user interface code. Pushing manual tests, with instructions, to users for them to walk through.
</li>
<li>Distributing tests to any number of browsers, rather than a specific sub-set. (You could use this to embed a tiny iframe in your site to collect test results from a small sampling of our users.)
</li>
<li>The ability to drive and test browser code or extensions.
</li>
</ul>
<p>What would you like to see?</p>
<p><b>More resources</b></p>
<ul>
<li><a href="http://github.com/jeresig/testswarm">Test Swarm Source Code</a></li>
<li><a href="http://github.com/jeresig/testswarm/issues">Test Swarm Bug Tracker</a></li>
<li><a href="http://groups.google.com/group/testswarm">Test Swarm Discussion Group</a></li>
<li><a href="http://twitter.com/testswarm">Test Swarm Twitter Updates</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/testswarm-crowdsource-your-continuous-tests-for-javascript/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Selenium WebDriver Re-introduced</title>
		<link>http://ajaxian.com/archives/selenium-webdriver-re-introduced</link>
		<comments>http://ajaxian.com/archives/selenium-webdriver-re-introduced#comments</comments>
		<pubDate>Tue, 12 May 2009 11:54:10 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=6788</guid>
		<description><![CDATA[Simon Stewart is a smart man, and nice chap, that I had the fortune to meet quite awhile back at Google London. He is an active Selenium hacker, and has re-introduced Web Driver that lets you write this Java code: PLAIN TEXT JAVA: &#160; // Create an instance of WebDriver backed by Firefox WebDriver driver <a href="http://ajaxian.com/archives/selenium-webdriver-re-introduced">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Simon Stewart is a smart man, and nice chap, that I had the fortune to meet quite awhile back at Google London. He is an active Selenium hacker, and has <a href="http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html">re-introduced Web Driver</a> that lets you write this Java code:</p>
<div class="igBar"><a href="javascript:showCodeTxt('java-24');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVA:</span>
<div id="java-24">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Create an instance of WebDriver backed by Firefox</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">WebDriver driver = <span style="color: #000000; font-weight: bold;">new</span> FirefoxDriver<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Now go to the Google home page</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">driver.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"http://www.google.com"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Find the search box, and (ummm...) search for something</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">WebElement searchBox = driver.<span style="color: #006600;">findElement</span><span style="color:#006600; font-weight:bold;">&#40;</span>By.<span style="color: #006600;">name</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"q"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">searchBox.<span style="color: #006600;">sendKeys</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"selenium"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">searchBox.<span style="color: #006600;">submit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// And now display the title of the page</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&#038;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Title: "</span> + driver.<span style="color: #006600;">getTitle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<blockquote><p>
<a href="http://code.google.com/p/webdriver/">WebDriver</a> has a simple API designed to be easy to work with and can drive both real browsers, for testing javascript heavy applications, and a pure 'in memory' solution for faster testing of simpler applications.
</p></blockquote>
<p>Interested? Check out <a href="http://code.google.com/p/webdriver/wiki/GettingStarted">the getting started guide</a> where you do a Google Suggest test, and watch Simon from waaaay back in 2007:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/tGu1ud7hk5I&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/tGu1ud7hk5I&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/selenium-webdriver-re-introduced/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JsContext to make your JsUnitTest look purty</title>
		<link>http://ajaxian.com/archives/jscontext-to-make-your-jsunittest-look-purty</link>
		<comments>http://ajaxian.com/archives/jscontext-to-make-your-jsunittest-look-purty#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:14:34 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=6470</guid>
		<description><![CDATA[Christian Johansen was sick of testNewUserWithClownShoesShouldSqueak code in his unit tests, so he took some inspiration from the Ruby Shoulda and Context frameworks and wrote JsContext which allows you to write: PLAIN TEXT JAVASCRIPT: &#160; new Test.Unit.Runner&#40;&#123; &#160; &#160; "A new User": JsContext&#40;&#123; &#160; &#160; &#160; &#160; "with clown shoes": JsContext&#40;&#123; &#160; &#160; &#160; &#160; <a href="http://ajaxian.com/archives/jscontext-to-make-your-jsunittest-look-purty">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Christian Johansen was sick of <code>testNewUserWithClownShoesShouldSqueak</code> code in his unit tests, so he took some inspiration from the Ruby Shoulda and Context frameworks and wrote <a href="http://www.cjohansen.no/en/javascript/syntactical_sugar_for_your_javascript_unit_tests">JsContext</a> which allows you to write:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-26');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-26">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">new</span> Test.<span style="color: #006600;">Unit</span>.<span style="color: #006600;">Runner</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"A new User"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"with clown shoes"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"should squeak"</span>: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"without clown shoes"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"should not squeak"</span>: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#123;</span> testLog: <span style="color: #3366CC;">"testlog"</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Using this, the test runner will label tests a lot more readable; where you may have been used to "testNewUserWithClownShoesShouldSqueak" you now get "A new user with clown shoes should squeak".</p>
<p>We are looking to standardize on a testing framework for Bespin. What do you like to use?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/jscontext-to-make-your-jsunittest-look-purty/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Improved Readability for JavaScript Unit Tests</title>
		<link>http://ajaxian.com/archives/improved-readability-for-javascript-unit-tests</link>
		<comments>http://ajaxian.com/archives/improved-readability-for-javascript-unit-tests#comments</comments>
		<pubDate>Mon, 30 Mar 2009 14:07:35 +0000</pubDate>
		<dc:creator>Ben Galbraith</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=6453</guid>
		<description><![CDATA[Christian Johansen is tired of: mentally decoding test names like "testNewUserWithClownShoesShouldSqueak", so I've written some code to improve readability for JavaScript unit tests written using JsUnitTest (from prototypejs). It's heavily inspired by Ruby frameworks Shoulda and Context. Tests with his new framework--called jscontext--look like this: PLAIN TEXT JavaScript: new Test.Unit.Runner&#40;&#123; &#160; &#160; "A new User": <a href="http://ajaxian.com/archives/improved-readability-for-javascript-unit-tests">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>Christian Johansen is tired of:</p>
<blockquote><p>
mentally decoding test names like "testNewUserWithClownShoesShouldSqueak", so I've written some code to improve readability for JavaScript unit tests written using JsUnitTest (from prototypejs). It's heavily inspired by Ruby frameworks Shoulda and Context.
</p></blockquote>
<p>Tests with his new framework--called <a href="http://github.com/cjohansen/jscontext">jscontext</a>--look like this:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-28');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JavaScript:</span>
<div id="javascript-28">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">new</span> Test.<span style="color: #006600;">Unit</span>.<span style="color: #006600;">Runner</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"A new User"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"with clown shoes"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"should squeak"</span>: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"without clown shoes"</span>: JsContext<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"should not squeak"</span>: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color: #000066; font-weight: bold;">with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...more tests and/or contexts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#123;</span> testLog: <span style="color: #3366CC;">"testlog"</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>Christian maintains that:</p>
<blockquote><p>
Using this, the test runner will label tests a lot more readable; where you may have been used to "testNewUserWithClownShoesShouldSqueak" you now get "A new user with clown shoes should squeak".
</p></blockquote>
<p>Christian's <a href="http://www.cjohansen.no/en/javascript/syntactical_sugar_for_your_javascript_unit_tests">introduction/announcement blog post</a> has a lot of additional details. Looks very cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/improved-readability-for-javascript-unit-tests/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TestSwarm: Scaling JavaScript Tests</title>
		<link>http://ajaxian.com/archives/testswarm-scaling-javascript-tests</link>
		<comments>http://ajaxian.com/archives/testswarm-scaling-javascript-tests#comments</comments>
		<pubDate>Wed, 25 Mar 2009 12:16:17 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=6420</guid>
		<description><![CDATA[John Resig is working on a new tool that tries to help us scale our JavaScript testing. When building an Ajax application, how nice would it be to have a system running tests across multiple browsers and platforms? This is necessary for anything more than a toy, especially since we have some flexible software that <a href="http://ajaxian.com/archives/testswarm-scaling-javascript-tests">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p>John Resig is working on a new tool <a href="http://ejohn.org/blog/javascript-testing-does-not-scale/">that tries to help us scale our JavaScript testing</a>. When building an Ajax application, how nice would it be to have a system running tests across multiple browsers and platforms? This is necessary for anything more than a toy, especially since we have some flexible software that allows us to shoot our feet very easily indeed. We need to fix this:</p>
<blockquote>
<p>All of this leads up to a new project that I'm working on: <b><a href="http://testswarm.com/">TestSwarm</a></b>. Its construction is very simple. It's a dumb JavaScript client that continually pings a central server looking for more tests to run. The server collects test suites and sends them out to the respective clients.</p>
<p><img src="http://ejohn.org/files/ts-swarm.png"/></p>
<p>All the test suites are collected. For example, 1 "commit" can have 10 test suites associated with it (and be distributed to a selection of browsers).</p>
<p>The nice thing about this construction is that it's able to work in a fault-tolerant manner. Clients can come-and-go. At any given time there might be no Firefox 2s connected, at another time there could be thirty. The jobs are queued and divvied out as the load requires it. Additionally, the client is simple enough to be able to run on mobile devices (while being completely test framework agnostic).</p>
<p>Here's how I envision TestSwarm working out: Open Source JavaScript libraries submit their test suite batches to the central server and users join up to help out. Library users can feel like they're participating and helping the project (which they are!) simply by keeping a couple extra browser windows open during their normal day-to-day activity.</p>
<p>The libraries can also push manual tests out to the users. A user will be notified when new manual tests arrive (maybe via an audible cue?) which they can then quickly run through.</p>
<p>All of this help from the users wouldn't be for nothing, though: There'd be high score boards keeping track of the users who participate the most and libraries could award the top participants with prizes (t-shirts, mugs, books, etc.).</p>
<p>The framework developers get the benefit of near-instantaneous test feedback from a seemingly-unlimited number of machines and the users get prizes, recognition, and a sense of accomplishment.</p>
<p>If this interests you then please <a href="http://testswarm.com/">sign up for the alpha</a>.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/testswarm-scaling-javascript-tests/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Load Testing Ajax is Hard</title>
		<link>http://ajaxian.com/archives/why-load-testing-ajax-is-hard</link>
		<comments>http://ajaxian.com/archives/why-load-testing-ajax-is-hard#comments</comments>
		<pubDate>Wed, 31 Dec 2008 14:01:56 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=5537</guid>
		<description><![CDATA[Today we are fortunate to have a guest post by Patrick Lightbody, most recently of BrowserMob fame (and previously Selenium work, OpenQA, WebWork, and more). Let's listen in to him talk to us about load testing, and let him know your thoughts in the comments below: I've been developing and testing complex web apps for <a href="http://ajaxian.com/archives/why-load-testing-ajax-is-hard">Read the rest...</a>]]></description>
			<content:encoded><![CDATA[<p><em>Today we are fortunate to have a guest post by Patrick Lightbody, most recently of BrowserMob fame (and previously Selenium work, OpenQA, WebWork, and more). Let's listen in to him talk to us about load testing, and let him know your thoughts in the comments below:</em></p>
<p>
    I've been developing and testing complex web apps for a long time. I was the co-creator of WebWork (now <a href="http://struts.apache.org/">Struts 2.0</a>) and an early champion of <a href="http://directwebremoting.org/">DWR</a>, writing one of the first AJAX form validation frameworks for Java web apps. But over the years, I noticed that as our web technologies and techniques got more sophisticated, our testing techniques were not keeping up.
</p>
</p>
<p>
    That was why I founded <a href="http://openqa.org">OpenQA</a> and helped grow <a href="http://seleniumhq.org/">Selenium</a> to the popular testing tool that it is today. Selenium helps with <b>functional testing</b> of complex AJAX apps, but there isn't an equivalent for load testing, which is why I started <a href="http://browsermob.com">BrowserMob</a>, a new type of load testing service.</p>
<p><b>Traditional load testing</b></p>
<p>
    In order to achieve high levels of concurrency, traditional load testing tools (both open source and commercial) work by sending large numbers of HTTP requests as a way to simulate many concurrent users interacting with your web page. These tools work by recording the traffic that comes from a browser session and then requiring that the load tester tweak a generated script so that it worked properly when played back X times concurrently.
</p>
<p>
    Common problems would be that the initial recording would embed in cookie values that were tied to individual sessions. Additional unique state might be encoded in other hidden form elements, all of which required some fine tuning after the fact. If you've ever tried to run a load test, this is probably a very familiar process. It has worked reasonably well up until recent years, but AJAX has made this process even more difficult.
</p>
<p><b>Ajax + load testing = hard</b></p>
<p>
    The reason Ajax has complicated things is that it encourages more logic and state to run inside the browser session. This means that just watching the traffic across the wire doesn't necessarily tell the full story. The richer an app gets, the more difficult it gets to simulate the exact effects of hundreds or thousands of users hitting your site.
</p>
<p>
    This is the problem I decided to solve when I started BrowserMob. It's on-demand, low-cost and uses <b>real browsers</b> to completely change the way load testing is <b>recorded</b> and <b>played</b> back.</p>
<p><b>Do real browsers really matter?</b></p>
<p>
    Real browsers absolutely matter. There are two major reasons:
</p>
<ol>
<li>It simplifies the script creation process by letting you avoid all the complexities and hacks you have to do with traditional load testing tools.</li>
<li>It ensures that you'll see 100% of the traffic and load against your site that a real user would cause.</li>
</ol>
<p>
    We'll look in-depth at each of these topics separately to see how use of real browsers helps and how a service like BrowserMob compares to existing load testing technologies.
</p>
<p><b>Simplifies script creation</b></p>
<p>
    In today's modern web applications, AJAX is just about everywhere. And we're not necessarily talking about super rich applications like Google Maps or Yahoo Mail, but even simple sites like <a href="http://google.com/">google.com</a> now use advanced AJAX techniques. See Google's auto-complete for a real-world example:
</p>
<p><img src="http://ajaxian.com/wp-content/uploads/google1.png" alt="" title="google1" width="400" height="338" class="alignnone size-full wp-image-5541" /></p>
<p>
    In this case, when typing values in to the search box, the web browser executes JavaScript logic that in turn makes AJAX calls to Google's search engine, asking for search suggestions to display. It does this on every keystroke that the user types in. This is a standard auto-complete control that most Ajaxian readers are very familiar with.
</p>
<p>
    When recording a script with a traditional load testing tool, one of two things may happen here:
</p>
<ul>
<li>The recorder will see the AJAX traffic and capture it for playback in the load test</li>
<li>The record will not see the AJAX traffic and will only capture the request made when the user clicks the "submit" button</li>
</ul>
<p>
    Obviously these Ajax requests are causing real load, so we want to make sure they get played back in a load test. Let's assume you're using a tool, such as JMeter, that does capture the AJAX traffic. Here's what that looks like:
</p>
<p><img src="http://ajaxian.com/wp-content/uploads/jmeter.png" alt="" title="jmeter" width="207" height="211" class="alignnone size-full wp-image-5540" /></p>
<p>The recorded traffic is effectively:</p>
<p>
<code></p>
<pre>

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=b

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=ba

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=ban

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=bana

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=banan

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=banana
</pre>
<p></code></p>
<p>
    Each key stroke by the user is included in each subsequent search term. Let's ignore the requirement of validating the results that come back from the AJAX requests for the moment (they are usually in JSON or XML format and difficult to validate using most tools). Instead, let's just add a twist to the load test requirement for doing searches: <i>the load test must search from 100 different search terms</i>.
</p>
<p>
    <b>Parameterization</b> is very common requirement, since it ensures that the load is realistic and doesn't get cached in any unnatural way. This means that now in addition to searching for the term "banana", we're also searching for "apple", and "orange", among others.
</p>
<p>    However, this means your script can't just blindly submit requests to those previous URLs either, since those were tied to the "banana" term. Instead, they must search for the sequential characters of the respective search term, such as:
</p>
<p>
<code></p>
<pre>

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=a

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=ap

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=app

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=appl

http://clients1.google.com/complete/search?hl=en&#038;gl=us&#038;q=apple
</pre>
<p></code>
</p>
<p>
    Unfortunately, this is where even the best traditional load testing tools fall down. They don't provide any help here, so it's up to you to figure out how to, if it's even possible, write complex scripting logic that breaks down the randomly selected search term by characters and then subsequently issue Ajax requests for each character in the term.
</p>
<p>
    At this point, you're basically rewriting the same logic that the web app developer wrote originally. If you're a QA engineer, this may be difficult since you don't know all the internal AJAX logic coded in to the application. If you're the developer, it's still annoying because it's tedious and likely in a language other than the original JavaScript that you wrote your code in.
</p>
<p><b>So how do real browsers help?</b></p>
<p>    Because BrowserMob uses real browsers to both record and playback load, that means you don't have to worry about trying to simulate the logic in a web browser. Instead, all you have to do is record the human interaction with the browser, such as typing in a randomly selected search term. BrowserMob will then pass those instructions on to the hundreds or thousands of browsers participating in the load test, and those browsers will in turn "do the right thing" and issue the proper AJAX requests.
</p>
<p>
    And if the underlying logic, such as the request URL pattern for those AJAX requests, changes? With traditional load testing it's up to you to detect and fix the problem. If your test uses real browsers to play back the traffic, your script won't need to change one bit - the new AJAX logic will be run by the browser in real time.
</p>
<p><b>Ensuring realistic playback</b></p>
<p>
    We've seen how use of real browsers helps with script creation, but what about playback? As we just learned, using real browsers simplifies the process of recording and shrinks the behavior coded in to the script itself. This means we're letting the real browser - the same type of program your end users will use - make the decisions about what requests to make.
</p>
<p>
    For example, when visiting http://ebay.com you might see the following page:
</p>
<p><img src="http://ajaxian.com/wp-content/uploads/ebay1.jpg" alt="" title="ebay1" width="480" height="320" class="alignnone size-full wp-image-5538" /></p>
<p>
    But reload the page and now you might see this:
</p>
<p><img src="http://ajaxian.com/wp-content/uploads/ebay2.jpg" alt="" title="ebay2" width="480" height="322" class="alignnone size-full wp-image-5539" /></p>
<p>
    Notice a difference? The upper right section has completely different images displayed. That's because eBay's home page chooses what to display based on complex and multi-variant logic determined at runtime. It's quite likely that it's going to be impossible for a load tester to know which images will be displayed on any given request.</p>
<p>
    It's true that some load testing tools will try to parse the pages in real time and figure out which images should be displayed, but that's hardly comforting once you've already learned they can't deal with even the most simply Ajax components, as we just saw. And as most AJAX developers know, resources such as images and stylesheets are more and more likely to come from complex JavaScript logic and not due to a simple static reference in an HTML page.
</p>
<p>
    Instead, the only way to guarantee that every single object (image, JavaScript, AJAX request, advertisement from an ad partner, etc) gets requested is to use a real web browser during playback. While it is much more resource intensive, it is also a major time saver on both the front-end, as scripts are much simpler to write, and the back-end, as you can be confident that the most realistic level of load was produced.
</p>
<p>
    So next time you hear of load testing happening on one of your Ajax apps, make sure those doing the testing understand the complexities and difficulties associated with testing a complex web app. Help them be on the lookout for the issues highlighted here.
</p>
<p><em>Thanks to Patrick for writing this. Do you have something important to say? If so, <a href="mailto:ajaxians@ajaxian.com">contact us</a> with your idea!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/why-load-testing-ajax-is-hard/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

