<?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>Sooey &#187; testing</title>
	<atom:link href="http://old-journal.sooey.com/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://old-journal.sooey.com</link>
	<description></description>
	<lastBuildDate>Fri, 04 Dec 2009 08:44:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>レガシーなPHPコードをモック関数でテストする</title>
		<link>http://old-journal.sooey.com/2009/03/29/1039/</link>
		<comments>http://old-journal.sooey.com/2009/03/29/1039/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 03:24:32 +0000</pubDate>
		<dc:creator>juno</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.sooey.com/journal/?p=1039</guid>
		<description><![CDATA[クラスをあまり使っておらず、関数を中心に構築されているレガシーなPHPコードをテストするにはどうするか。

テストしたい対象がユーザ定義関数であれば、実際の関数定義を含んだファイルとは別にテスト用の挙動をするモック関数の定義を含んだファイルを用意しておき、ユニットテスト時には後者をrequireするという手法があるが、例えばmysql_connect()のような組み込みの関数の場合はそうもいかない。

Test your Legacy PHP Application with Function Mocks!では、PECLのrunkitモジュールを使うことで実行時に関数を再定義してしまう方法が紹介されている。

テスト対象となるすべての関数をいちいち置き換えていくのは大変だし、組み込みの関数を書き換えてしまう場合の副作用も気になるので常に使えるというわけではないけれど、憶えておくと役に立つ時があるかもしれない。
]]></description>
			<content:encoded><![CDATA[<p>クラスをあまり使っておらず、関数を中心に構築されているレガシーなPHPコードをテストするにはどうするか。</p>

<p>テストしたい対象がユーザ定義関数であれば、実際の関数定義を含んだファイルとは別にテスト用の挙動をするモック関数の定義を含んだファイルを用意しておき、ユニットテスト時には後者を<code>require</code>するという手法があるが、例えば<code>mysql_connect()</code>のような組み込みの関数の場合はそうもいかない。</p>

<p><a href="http://www.whitewashing.de/blog/articles/115">Test your Legacy PHP Application with Function Mocks!</a>では、PECLの<a href="http://pecl.php.net/package/runkit">runkit</a>モジュールを使うことで実行時に関数を再定義してしまう方法が紹介されている。</p>

<p>テスト対象となるすべての関数をいちいち置き換えていくのは大変だし、組み込みの関数を書き換えてしまう場合の副作用も気になるので常に使えるというわけではないけれど、憶えておくと役に立つ時があるかもしれない。</p>
]]></content:encoded>
			<wfw:commentRss>http://old-journal.sooey.com/2009/03/29/1039/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>次世代のPHPアジャイル開発へ向けて</title>
		<link>http://old-journal.sooey.com/2006/10/10/631/</link>
		<comments>http://old-journal.sooey.com/2006/10/10/631/#comments</comments>
		<pubDate>Tue, 10 Oct 2006 04:18:48 +0000</pubDate>
		<dc:creator>juno</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://www.sooey.com/journal/2006/10/10/631/</guid>
		<description><![CDATA[Xdebug 2.0.0RC1のリリースを受けて、PHPUnit 3.0 Beta 1が公開されました。PHPUnit3ではjMockライクなモックオブジェクト生成のサポートやSelenium RCとの統合など、これまで自前で用意する必要があった部分の多くがカバーされているので、PHP開発者の間にもアジャイル開発が定着していくと良いですね。
]]></description>
			<content:encoded><![CDATA[<p>Xdebug 2.0.0RC1の<a href="http://derickrethans.nl/the_first_release_candidate_of_xdebug_2.php">リリース</a>を受けて、<a href="http://sebastian-bergmann.de/archives/632-PHPUnit-3.0-Beta-1.html">PHPUnit 3.0 Beta 1</a>が公開されました。PHPUnit3ではjMockライクなモックオブジェクト生成のサポートやSelenium RCとの統合など、これまで自前で用意する必要があった部分の多くがカバーされているので、PHP開発者の間にもアジャイル開発が定着していくと良いですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://old-journal.sooey.com/2006/10/10/631/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selenium で Ajax アプリケーションをテスト</title>
		<link>http://old-journal.sooey.com/2005/12/01/68/</link>
		<comments>http://old-journal.sooey.com/2005/12/01/68/#comments</comments>
		<pubDate>Thu, 01 Dec 2005 04:25:27 +0000</pubDate>
		<dc:creator>juno</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.sooey.com/journal/2005/12/01/68/</guid>
		<description><![CDATA[Agile Reality にて、Selenium の waitForValue と waitForCondition が Ajax アプリケーションのテストに使えますよ、というようなことが話題にされています。具体的にどう使うのかといったあたりには言及されていませんが、まあ便利なんでしょう。

Selenium もそろそろ本格的に使い始めないとなー（と思いつつ半年経過…）。
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.josephmoore.net/2005/11/using-seleniums-waitforvalue.html">Agile Reality</a> にて、<a href="http://selenium.thoughtworks.com/">Selenium</a> の waitForValue と waitForCondition が Ajax アプリケーションのテストに使えますよ、というようなことが話題にされています。具体的にどう使うのかといったあたりには言及されていませんが、まあ便利なんでしょう。</p>

<p>Selenium もそろそろ本格的に使い始めないとなー（と思いつつ半年経過…）。</p>
]]></content:encoded>
			<wfw:commentRss>http://old-journal.sooey.com/2005/12/01/68/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ジョエル・テスト</title>
		<link>http://old-journal.sooey.com/2004/11/15/389/</link>
		<comments>http://old-journal.sooey.com/2004/11/15/389/#comments</comments>
		<pubDate>Mon, 15 Nov 2004 06:13:26 +0000</pubDate>
		<dc:creator>juno</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.sooey.com/journal/2004/11/15/389/</guid>
		<description><![CDATA[ジョエル・テスト。ソフトウェア開発チームの質を評価するための12項目。2000年に書かれた文書のようですが、いまだにこれらをすべて満たしている開発会社は（特に日本では）少ないのではないかと思います。

ソース管理システムを使っているか？
１オペレーションでビルドを行えるか？
毎日ビルドを行うか？
障害票データベースを持っているか？

最低限、このあたりはカバーしておきたいですね。
あと個人的には「プログラマを採用するときにコードを書かせるか？」という項目も大きなポイントではないかと思います。むしろ書いてもらったコードを読むより、コーディングの過程を見ることで色々とわかることがありそうです。
]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://japanese.joelonsoftware.com/Articles/TheJoelTest.html">ジョエル・テスト</a>。ソフトウェア開発チームの質を評価するための12項目。2000年に書かれた文書のようですが、いまだにこれらをすべて満たしている開発会社は（特に日本では）少ないのではないかと思います。
</p>

<ul>
<li>ソース管理システムを使っているか？</li>
<li>１オペレーションでビルドを行えるか？</li>
<li>毎日ビルドを行うか？</li>
<li>障害票データベースを持っているか？</li>
</ul>

<p>
最低限、このあたりはカバーしておきたいですね。
あと個人的には「プログラマを採用するときにコードを書かせるか？」という項目も大きなポイントではないかと思います。むしろ書いてもらったコードを読むより、コーディングの過程を見ることで色々とわかることがありそうです。</p>
]]></content:encoded>
			<wfw:commentRss>http://old-journal.sooey.com/2004/11/15/389/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCMock</title>
		<link>http://old-journal.sooey.com/2004/09/07/351/</link>
		<comments>http://old-journal.sooey.com/2004/09/07/351/#comments</comments>
		<pubDate>Tue, 07 Sep 2004 04:31:20 +0000</pubDate>
		<dc:creator>juno</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.sooey.com/journal/2004/09/07/351/</guid>
		<description><![CDATA[Objective-C用のモックオブジェクト実装 OCMock。
]]></description>
			<content:encoded><![CDATA[<p>Objective-C用のモックオブジェクト実装 <a href="http://www.mulle-kybernetik.com/software/OCMock/">OCMock</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://old-journal.sooey.com/2004/09/07/351/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->