<?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>Bradley Holt &#187; PHPUnit</title>
	<atom:link href="http://bradley-holt.com/tag/phpunit/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradley-holt.com</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 01:04:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>TEK·X Day Two</title>
		<link>http://bradley-holt.com/2010/05/tek%c2%b7x-day-two/</link>
		<comments>http://bradley-holt.com/2010/05/tek%c2%b7x-day-two/#comments</comments>
		<pubDate>Fri, 21 May 2010 04:50:26 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[Software Deployment]]></category>
		<category><![CDATA[SPL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tekX]]></category>
		<category><![CDATA[tekX10]]></category>
		<category><![CDATA[Xdebug]]></category>
		<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/?p=683</guid>
		<description><![CDATA[It&#8217;s hard to believe tomorrow is the last day of TEK·X. Where did the time go? Today started with Matthew Schmidt&#8217;s 10 Developer Trends in 2010. He talked about agile development, browser standards, AJAX, security vulnerabilities, RIAs, touch interfaces, key/value stores, version control, cloud computing, and dynamic languages. While not a bad keynote, the topics [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe tomorrow is the last day of <a href="http://tek.phparch.com/">TEK·X</a>. Where did the time go? Today started with Matthew Schmidt&#8217;s 10 Developer Trends in 2010. He talked about agile development, browser standards, AJAX, security vulnerabilities, RIAs, touch interfaces, key/value stores, version control, cloud computing, and dynamic languages. While not a bad keynote, the topics seemed fairly basic and obvious given the audience.</p>
<p>Next up for me was Derick Rethans&#8217; <a href="http://xdebug.org/">Xdebug</a> talk. Xdebug is an extremely useful tool for PHP developers. I&#8217;ve used its <a href="http://xdebug.org/docs/stack_trace">stack trace</a> feature as well as its <a href="http://www.phpunit.de/manual/3.4/en/code-coverage-analysis.html">code coverage analysis via PHPUnit</a>. I&#8217;ve also dabbled with its <a href="http://xdebug.org/docs/profiler">profiling</a> capabilities. The session introduced me to several other Xdebug features with which I&#8217;d like to experiment.</p>
<p>After that I had the pleasure of seeing Matthew Turland&#8217;s talk on <a href="http://matthewturland.com/2010/05/20/new-spl-features-in-php-5-3/">New SPL Features in PHP 5.3</a>. New SPL data structures in PHP 5.3 include stacks, queues, heaps, priority queues, and sets. Matthew provided test code that compared the performance and memory usage of each these new data structures to that of using PHP&#8217;s array functionality.</p>
<p>I skipped the first afternoon session to take part in the Hack Track which happened to coincide with Zend Framework&#8217;s <a href="http://devzone.zend.com/article/12150">May Bug Hunt Days</a>. I was granted commit access and directly committed my first bug fix, a small change to <a href="http://framework.zend.com/issues/browse/ZF-9845">make HTTP headers case-insensitive</a>.</p>
<p>Others stuck around to fix more bugs while I went to check out Bill Karwin&#8217;s <a href="http://www.slideshare.net/billkarwin/models-for-hierarchical-data">Models for Hierarchical Data with SQL and PHP</a>. Examples of hierarchical data include categories/subcategories, bill of materials, and threaded discussions. Bill talked about four main approaches to storing hierarchical data in SQL databases: adjacency list, path enumeration, nested sets, and usage of a closure table.</p>
<p>The <em>adjacency list</em> is a naive approach that almost everyone tries first. Basically, each entry knows its immediate parent. The problem with this approach is that querying deep trees can be very inefficient involving many joins. <em>Path enumeration</em> involves storing an enumerated chain of ancestors in each entry. This can be very efficient and take advantage of indexing. However, there is no referential integrity with this approach. The <em>nested set</em> approach seemed a bit complicated. I don&#8217;t feel I can explain it properly here, so you&#8217;ll have to check out Bill&#8217;s slides if you&#8217;re interested in how this works. The <em>closure table</em> approach made the most sense to me and didn&#8217;t seem overly complicated. Not only do you store each entry, but you also store every path including those from the parent node to each descendant, those from each ancestor to its child node, as well as a reflexive reference from the node to itself.</p>
<p>My final session of the day was Travis Swicegood&#8217;s Building Real-Time Applications with XMPP, the <a href="http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol">Extensible Messaging and Presence Protocol</a>. If you&#8217;ve use Google Talk then you&#8217;ve used XMPP. As a web developer, the request and response pattern in HTTP is ingrained into my thinking. However, XMPP is a very different creature in that it keeps a socket open during what can be a lengthy exchange of messages. While I don&#8217;t think HTTP is going away anytime soon, real-time applications involving potentially large numbers of publishers and subscribers (e.g. Twitter) are becoming more prevalent and XMPP is well suited for this environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2010/05/tek%c2%b7x-day-two/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unit Tests Are Not About Testing</title>
		<link>http://bradley-holt.com/2009/08/unit-tests-are-not-about-testing/</link>
		<comments>http://bradley-holt.com/2009/08/unit-tests-are-not-about-testing/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 21:19:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2009/08/unit-tests-are-not-about-testing/</guid>
		<description><![CDATA[I had the suspicion for a while but it didn&#8217;t become clear to me until recently that unit testing really is not about testing. Sure, you are writing tests and there is certainly value in having &#8220;tests.&#8221; However, the real value of unit testing becomes evident when you stop thinking of it in terms of [...]]]></description>
			<content:encoded><![CDATA[<p>I had the suspicion for a while but it didn&#8217;t become clear to me until recently that <a href="http://en.wikipedia.org/wiki/Unit_testing">unit testing</a> really is not about testing. Sure, you are writing tests and there is certainly value in having &#8220;tests.&#8221; However, the real value of unit testing becomes evident when you stop thinking of it in terms of testing. If it&#8217;s not about testing then what is it about? Unit testing is really about defining behavior. Enter <a href="http://behaviour-driven.org/">Behavior Driven Development</a> (BDD):</p>
</p>
<blockquote><p>It is not too surprising that it takes apprentice TDD [test-driven development] practitioners a while to realize that TDD is not about testing when all of the nomenclature surrounding it is described in terms of testing.</p>
<p>The aim of Behaviour Driven Development (BDD) is to address this shortcoming. By using terminology focused on the behavioural aspects of the system rather than testing, BDD attempts to help direct developers towards a focus on the real value to be found in TDD at its most successful.</p></blockquote>
<p>If you&#8217;re using PHPUnit then check out the <a href="http://www.phpunit.de/manual/current/en/behaviour-driven-development.html">Behaviour-Driven Development chapter</a> for more details on how you can use this approach.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2009/08/unit-tests-are-not-about-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

