<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Can't see nothing but the source code</title>
	<atom:link href="http://codeforfun.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeforfun.wordpress.com</link>
	<description>Java development with an iPhone touch pad for the Atari 2600 from an urban hip-hop perspective</description>
	<lastBuildDate>Mon, 09 Nov 2009 14:21:06 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='codeforfun.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/8d21f8fd8dcc021adcd46592bfbddcda?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Can't see nothing but the source code</title>
		<link>http://codeforfun.wordpress.com</link>
	</image>
			<item>
		<title>Wave to me</title>
		<link>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:05:42 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1063</guid>
		<description><![CDATA[I received a Google Wave invite this morning from a friend and I was all excited and ready to jump in. You know that feeling you get when you put on your favorite hat and your best shoes, grab a six pack and run into the party but nobody&#8217;s there? Yeah, thats the feeling. It&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1063&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I received a Google Wave invite this morning from a friend and I was all excited and ready to jump in. You know that feeling you get when you put on your favorite hat and your best shoes, grab a six pack and run into the party but nobody&#8217;s there? Yeah, thats the feeling. It&#8217;s like the Music is playing but there&#8217;s no DJ on the turn tables. You got a full tank of gas, you mash the pedal but the transmission is slipping. It&#8217;s when you pour the most gigantimous bowl of Lucky Charms, grab the shovel from next to the microwave oven, dig it into the bowl then open the refrigerator door to find an empty milk carton. I&#8217;m not out of hope, if I gotta wave to complete strangers then that&#8217;s what I&#8217;ll do for now. It&#8217;d be much better if Google found a way to make it work with existing communications like AIM, email, MyBook and FaceSpace. Then people would have some use for it other than a place holder in an otherwise empty conversation, &#8220;&#8230;say y&#8217;know I got one uh dose G Wiz Googly Wave thing-a-ma-jigs&#8230; it&#8217;s awesome&#8230;&#8221;</p>
<p>If you&#8217;re in the same boat as I am, look for clifton.craig somewhere in the wave system. By the way, how do you search and find new contacts with this crazy thing? Until then, I&#8217;m waving but nobody&#8217;s waving back&#8230; holler&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1063/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1063&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Hard to test things</title>
		<link>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:21:03 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPhone TDD]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1059</guid>
		<description><![CDATA[So I&#8217;d been thinking. Because I&#8217;m back into iPhone development and getting warmed up not only to ObjC issues and errors but also C++ oddities, I&#8217;m wondering how do you write tests for some of the more difficult things to capture? For instance, I&#8217;ve figured out how to capture some of the manual reference counting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1059&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So I&#8217;d been thinking. Because I&#8217;m back into iPhone development and getting warmed up not only to ObjC issues and errors but also C++ oddities, I&#8217;m wondering how do you write tests for some of the more difficult things to capture? For instance, I&#8217;ve figured out how to capture some of the manual reference counting that&#8217;s required by CocoaTouch. (I assert that objects passed into other objects are properly retained and properly released when the object itself is released.) Still I can&#8217;t capture the more involved memory management problems. How do you assert an autorelease? What about dynamic memory allocation with pointers? I ended up with a single method that dynamically allocates for a pointer via malloc. I then changed it to use new with array notation. </p>
<p>void MySpecialObject::writeRequestToStream(CFStringRef aRequest, CFWriteStreamRef requestStream)<br />
{<br />
  if(CFWriteStreamGetStatus(requestStream) == kCFStreamStatusNotOpen) CFWriteStreamOpen(requestStream);<br />
  UInt8* convertedString =(UInt8*)convertToCString(aRequest);<br />
  CFWriteStreamWrite(requestStream, convertedString, CFStringGetLength(aRequest));<br />
  free(convertedString);<br />
}</p>
<p>It&#8217;s used in one spot so far and I&#8217;ve manually added the free without a prior failing test. I felt dirty. Assuming there were no call to free, how would you write a failing test for the code above? Is this just one of those things where you have to be extra careful? Maybe I should investigate the use of Velocity style code macros/templates that expand after keying special abbreviation similar to what we have in IntelliJ. I can imagine something like &#8220;cstr&#8221; expanding to:</p>
<p>char *myCStr = new char[size];<br />
// use myCStr here<br />
free(myCStr);</p>
<p>With the ability to tab through highlighting the variable name, declared size and commented insert code section. Any bright ideas?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1059/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1059&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Downgrade your iPhone DFU mode</title>
		<link>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 13:15:24 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[DFU Mode]]></category>
		<category><![CDATA[firmware hacks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1057</guid>
		<description><![CDATA[My iPhone crapped out on me this weekend. I went to use it and the screen wouldn&#8217;t show at all. I loaded iTunes which was able to recognize it and offer to restore it to factory. Word of advice, iTunes is very sneaky! I didn&#8217;t realize that the factory restore it offered came with a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1057&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My iPhone crapped out on me this weekend. I went to use it and the screen wouldn&#8217;t show at all. I loaded iTunes which was able to recognize it and offer to restore it to factory. Word of advice, iTunes is very sneaky! I didn&#8217;t realize that the factory restore it offered came with a complimentary upgrade to OS 3.1.2! It became apparent after I went to use the device and swiped right revealing the new spotlight search. Crap! I needed to keep it on 2.2 because I need to verify 2.2 compatibility. No worries, I&#8217;l just down grade when I get to the office. I then realized that I couldn&#8217;t build and run on device using XCode. I was getting &#8220;No Provisioned device connected&#8221; errors. I got concerned thinking I had to go through the whole re-provisioning my device hassle. Then I realized the &#8220;use for development&#8221; button in XCode. One thing lead to another then I finally realized all of the ugly truths about iPhone development. </p>
<p>1. OS 3.1.2 only accepts builds from XCode with iPhone SDK 3.1.2.<br />
2. The iPhone SDK 3.1.2 only installs on OSX 10.6 (Snow Leopard)<br />
3. Apple no longer offers any iPhone OS earlier than 3.1.2 on its website.<br />
4. If you are lucky enough to find a lingering copy of iPhone OS 3.0 or earlier, you cannot roll back from 3.1.2 (&#8230;easily) due to baseband errors.<br />
5. DFU mode is not easy to do or understand.<br />
6. You will likely spend the good part of a couple of days trying to recover from an unintentional upgrade as your first 5-7 rollbacks will leave you with misc errors.</p>
<p>The simple answer is that you cannot downgrade the OS without using DFU mode. DFU stands for Device Firmware Upgrade and is a secret mode that Apple doesn&#8217;t want you to know about. You have to use something similar to the old Nintendo Contra cheat (you remember up, up, down, down, left, right, left, right, b, a&#8230;) to enable it. I&#8217;ve tried it a couple of times so far and realized that you probably should have a completely installed OS before trying it. My second attempt (after a fresh iTunes restore) left me with an error and I&#8217;m hoping the third time is a charm. Here goes nothing&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1057/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1057&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Classic vs Mockist, TDD vs BDD</title>
		<link>http://codeforfun.wordpress.com/2009/10/21/classic-vs-mockist-tdd-vs-bdd/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/21/classic-vs-mockist-tdd-vs-bdd/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:00:18 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Behavior Driven Development]]></category>
		<category><![CDATA[Test Driven Development (TDD)]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1055</guid>
		<description><![CDATA[I&#8217;ve been having constant issues with Behavior Driven Design using xUnit tools. For those that don&#8217;t know what behavior driven design means check out Dan North&#8217;s introduction. When writing tests you can choose from a number of approaches. I feel I&#8217;ve followed an evolutionary chain through the most popular. Most people start with CWT, or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1055&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been having constant issues with Behavior Driven Design using xUnit tools. For those that don&#8217;t know what behavior driven design means check out <a href="http://dannorth.net/introducing-bdd/">Dan North&#8217;s introduction</a>. When writing tests you can choose from a number of approaches. I feel I&#8217;ve followed an evolutionary chain through the most popular. Most people start with CWT, or Coding While Testing. This is an approach where the tests are written with the code, not necessarily before but along side. People take this &#8220;feel good&#8221; approach in order to cover their code with tests and to gain confidence that their code won&#8217;t break without them knowing why/where. Eventually tests become brittle and break all around and the tests become a burden to maintain. Some people evolve into TDD or Test Driven Design. This is where the test is written first in an attempt to achieve better design. When I evolved this far I was still struggling in the &#8220;implementation zone&#8221;. That&#8217;s where most developers get their mail delivered. The implementation zone is where the major concern is how things work. You can&#8217;t rest well unless you know exactly how things work beneath a method call. There are no surprises because everything is understood. Doing TDD while living here leads to &#8220;White Box&#8221; tests. These are tests that mirror the implementation of the system. These test scream immediately when the system change in the slightest. It&#8217;s no fun. </p>
<p>Later I learned about the Behavior Driven approach which lead to my understanding DSLs, or Domain Specific Languages. Actually I picked up my understanding of DSLs when I started using JMock, which is still one of my favorite tools. I started to remember why programming languages were invented. &#8220;Code is for Humans&#8221; became my mantra. I stopped caring about <em>how</em> code worked and started concerning myself with <em>why</em> code was written. With today&#8217;s systems rivaling NASA in their complexity it becomes impossible to obsess over every implementation detail. It&#8217;s more natural to trust that something works through an automatable specification that says it works. Its hard to put in English, but there&#8217;s a subtle difference in how I look at code compared to how I see most of my co-workers look at code. I rely on a system of trust which helps both in design and in debugging. I digress.</p>
<p>This morning I began reading Martin Fowler&#8217;s revised <a href="http://martinfowler.com/articles/mocksArentStubs.html">write up on Mocks vs. Stubs</a>. If you do any automated testing of your system at all I demand you read this article. If you&#8217;ve read it in the past (as I had) I demand you read it again because it&#8217;s updated. If you read it last week then I demand you read it to your 5 year old tonight at bed time. The point is that Martin makes very good distinctions on what he calls classic TDD and Mockist TDD. He explains the difference between state verification and behavior verification. He explains it in a way that shocked me, because I&#8217;d classify myself as a mockist. The entire time I obsessed over implementation being secondary to design I see how and why the mockist frame of thought can easily shackle your design to your implementation details. I almost wanted to change ships, jump on the classical bandwagon. However the article very fairly points out several flaws in both approaches while not condemning either. In the end the choice is left to you. Well done Martin. Well done.</p>
<p>I titled this post, &#8220;Classic vs Mockist, TDD vs BDD&#8221; not to align BDD with the mockist approach though it fits better. The truth is that you can use Martin&#8217;s classic TDD style when doing BDD and vice versa. There really isn&#8217;t much of a difference between classic or mockist, TDD or BDD. It&#8217;s all really a matter of style as all these approaches aim in the same direction. Its similar to comparing Baptist to Methodist religions. There are differences but one is not more true than the other and its the faith or general direction that both point to that makes them equally as important. Here&#8217;s what&#8217;s really important.</p>
<p>Back to my problem. I posted on Stack overflow yesterday asking the question of <a href="http://stackoverflow.com/questions/1595952/how-to-write-tests-without-so-many-mocks">how to avoid so many mocks</a>. I have yet to receive a solution to the core problem I&#8217;m seeing. If you or someone you know has a mastery of TDD please chime in. I&#8217;d love to finally have a good discussion on how to solve a complex problem using the practice. I feel like I&#8217;m 80% there but I&#8217;m missing one piece of the pie.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1055/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1055/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1055/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1055/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1055/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1055/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1055/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1055/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1055/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1055/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1055&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/21/classic-vs-mockist-tdd-vs-bdd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>How to go really really slow at programming</title>
		<link>http://codeforfun.wordpress.com/2009/10/19/how-to-go-really-really-slow-at-programming/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/19/how-to-go-really-really-slow-at-programming/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 23:16:24 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1053</guid>
		<description><![CDATA[This morning I spent 10 minutes answering &#8220;ok&#8221; to 65,536 dialogs in Finder. This is the direct result of used the latest thing. I don&#8217;t do like I used to. I used to install bleeding edge software and constantly run around with napkins as my nose dripped red goo. I&#8217;ve learned my lesson. I now [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1053&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This morning I spent 10 minutes answering &#8220;ok&#8221; to 65,536 dialogs in Finder. This is the direct result of used the latest thing. I don&#8217;t do like I used to. I used to install bleeding edge software and constantly run around with napkins as my nose dripped red goo. I&#8217;ve learned my lesson. I now know to install software only after its been battle tested and at least 1/2 of my coworkers are using it. So what has happened? What I used was the latest version of SVN support in Versions&#8230; 1.6 support. It&#8217;s not what I would call bleeding edge. Version 1.6 of svn has been around long enough. It&#8217;s battle tested and proven. Why then do I have exactly 65,536 ok dialogs scattered across my screen, each informing me that &#8220;my client is too old to work with&#8230;&#8221;? And how did I know that there were exactly 65,536 dialogs? (An exercise left to the reader&#8230; YOU! Not your RSS reader!) A long time ago I installed a Tortoise-like plugin for Finder. It gives you little folder decorations for things that are up to date in svn, checked out, conflicting or whatever. I forget the name of the app. It was so long ago that I&#8217;ve since forgotten and lost the installer. I don&#8217;t even know if there&#8217;s an uninstaller. (Which reminds me&#8230; why is it soo difficult to remove software from a Mac?) Still it helps me. It&#8217;s one of those nice to have things that help but doesn&#8217;t do the job entirely. So this tool has been hanging around assiting Finder for the past year or so and keeping me out of trouble when I attempt to delete old work that I&#8217;m not sure is under a VCS. After I switched Versions to use 1.6 format for its checkouts I started getting these dialogs. I didn&#8217;t know which tool they were coming from because I also use IntelliJ which includes its own svn support. Also I&#8217;ve since irreparably hacked XCode to work with svn 1.5. The dialog could have been coming from any of these three svn related tools. (I&#8217;d completely forgotten about the Finder plugin.) So I restarted versions a few times which seemed to remedy the problem. I was sure it was a Versions problem because I had other minor glitches since taking a recent Versions upgrade. By the time I figured out the Finder plugin was the problem I was already in knee deep. Unable to delete the 4-5 projects checked out in 1.6 format. Today I got a small break and decided to address the problem. It took me 5-10 minutes to fix because I had to first answer ok to each dialog. Then I had to delete and checkout the projects again. I also had to delete and checkout the projects again after realizing I forgot to change the Versions flag before the first delete/checkout cycle.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1053/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1053&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/19/how-to-go-really-really-slow-at-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Let&#8217;s rewrite Hudson from scratch!</title>
		<link>http://codeforfun.wordpress.com/2009/10/16/lets-rewrite-hudson-from-scratch/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/16/lets-rewrite-hudson-from-scratch/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 23:22:56 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[build systems]]></category>
		<category><![CDATA[complexity]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1051</guid>
		<description><![CDATA[Because I have nothing better to do with the eight hours I spend in my company&#8217;s office building I felt it would be a great idea to sit down in from of a vi prompt and rewrite the Hudson build server all over again! From scratch! With no syntax highlighting! Without help from any of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1051&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Because I have nothing better to do with the eight hours I spend in my company&#8217;s office building I felt it would be a great idea to sit down in from of a vi prompt and rewrite the Hudson build server all over again! From scratch! With no syntax highlighting! Without help from any of its core dev team! Ain&#8217;t I cool? Hi, <a href="http://codeforfun.wordpress.com/about">I&#8217;m Cliff</a>. You&#8217;re here because you too would like to waste hours of development time toiling over a build tool or IDE setting for years&#8230; just to make it do what it was doing three weeks ago before the system admins decided to switch all network traffic to route through a SOCKs server then through an authenticating HTTP proxy which is managed by a complicated key based 256bit encryption mechanism hosted on a Novell server that mandates each employee drive across the parking lot.. in the rain&#8230; and place their thumb on a high-tech print-scanner to acquire a key that is only valid for 2 1/2 hours after which the entire process must be repeated to continue accessing private company systems. Yeah, that&#8217;s why you&#8217;re here. That&#8217;s why I&#8217;m here too. After all, if you don&#8217;t get that one particular tool working the rest of your life will be a living nightmare of, &#8220;why am I not getting optimal results? Oh yeah, it&#8217;s because I forgot to do the manual 37 step process just before checking my changes into svn. Lets add step number 38 to prevent the disaster that just occurred last Wednesday when we tried to demo for our CEO.&#8221;</p>
<p>On to today&#8217;s topic. No I didn&#8217;t actually decide to rewrite Hudson. I just got tasked with figuring out why we don&#8217;t have CI in our project. That turned into the, &#8220;oh yeah it&#8217;s because this part of our project runs on a later version of Hudson.&#8221; That became, &#8220;why can&#8217;t we downgrade?&#8221; Which was answered with, &#8220;because we put so many man hours into getting to this point all of which would need repeating.&#8221; this ultimately turned into a hack that depends on Bazaar brilliance. The hack intermittently falls over so it became my job to revisit why we can no longer use normal subversion tools. When I got deep into this task I found myself staring into a vi prompt on a Linux machine looking at the Java source code which propels Hudson into action. Its bad enough that I made several failed attempts to build Hudson from source on my Mac each which consumed valuable CPU cycles and upwards of 10-20 minutes. It became really painful when I knew I had to point Linux through ssh at the several hundred megabyte (Gigabyte?) source package sitting on my Mac. Why not just checkout the source directly in Linux? Well the initial checkout took hours on my Mac and I wasn&#8217;t sure whether it was due to rainy conditions in the weather or client side bandwidth or slow server side response time and I wasn&#8217;t willing to do yet another bout of research just to get the answer to question which really isn&#8217;t critical. So here I am, looking at Java source and unable to rapidly navigate it as I could in IntelliJ Idea. Its a sea of text and I&#8217;m lost in the middle without a clue. I have Spotlight which pin-pointed the location that needs to be fixed. but I have no confidence that the build I execute is responsible for the war file that I ultimately collect because this war file is in a non-standard location. Also, the instructions for building this war file are comparable in complexity to the non-standard structure of the project. This structure is, in turn, comparable to the complexity of the source code. I&#8217;m lost, frustrated, and I just want it to work. On a good day (a Monday) I&#8217;d love to obsess over how the Hudson team has managed to tackle whatever problem that lead to the complexity that is their current build system. But on a bad day (a Friday) I only care that the end result of their build system can find the source code that is locked behind yet another ocean of complicated security constraints. I just want things to work. I don&#8217;t want to learn their interiors. I want them to do the thing I they were designed to to.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1051/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1051/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1051/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1051/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1051/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1051/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1051/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1051/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1051/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1051/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1051&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/16/lets-rewrite-hudson-from-scratch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>AssertRunsInAnotherThread ?</title>
		<link>http://codeforfun.wordpress.com/2009/10/13/assertrunsinanotherthread/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/13/assertrunsinanotherthread/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:55:39 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone TDD]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Objective C unit tests]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1038</guid>
		<description><![CDATA[**Update**
I&#8217;ve updated my example below after realizing I left out some important pieces&#8230;
**Update**
How do you assert that something runs in a different thread? Or more generically, how do you assert that something runs asynchronously? I need to do this in ObjC but also in Java. The scenario is as follows. I have a WhatzItz object [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1038&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>**Update**</strong><br />
I&#8217;ve updated my example below after realizing I left out some important pieces&#8230;<br />
<strong>**Update**</strong></p>
<p>How do you assert that something runs in a different thread? Or more generically, how do you assert that something runs asynchronously? I need to do this in ObjC but also in Java. The scenario is as follows. I have a WhatzItz object instance stored in myWhatzItz. I tell myWhatzItz to doDisThing. I need to specify that myWhatzItz will doDisThing asynchronously. Experience tells the story that multi-threaded unit tests are dumb, complicated and wrong. So asking myWhatzItz to doDisThing then waiting or polling for completion of doDisThing is not what we want to do here. (It may be what you want to do but it&#8217;s not what I want. Since we&#8217;re on the same team and since I&#8217;m doing the writing you have to want what I want not what you want. I <em>want</em> you to want my wants&#8230; forget your wants&#8230; your wants are dumb anyhow!)</p>
<p>So how do we design myWhatzItz to doDisThing and doDisThing right? I&#8217;m going to suggest an interface&#8230; err prototcol. That is an abstraction for what we want to design. In unit testing we stay focused on one thing. All distractions are tossed behind abstractions. So after asking myWhatzItz to doDisThing I need to assert that it uses asynchronous behavior. That brings us a step back. I have to design a dependency on asynchronous behavior first. Right now you&#8217;re probably wondering how asynchronous behavior works. Right now I&#8217;m &#8217;bout to slap you like Bruce Lee slapped that boy in Enter the Dragon. (Or was that Return of the Dragon? Maybe it was the game of death? Bonus points to the 1st person that gets the movie correct with a link to the clip on YouTube!) &#8220;Don&#8217;t focus on the finger or you&#8217;ll miss the beauty in the sky above!&#8221;, says Bruce. We <em>don&#8217;t care</em> about how asynchronous behavior works, as its irrelevant to our design. We only care that our work is done asynchronously! So we&#8217;ll code this test in ObjectiveC:</p>
<pre class="brush: cpp;">
#import
@protocol MyAsynchronousBehavior
-(void) performAsynchronously:(SEL) aSelctor onTarget:(id)aTarget withObject:(id)anObject;
@end

@interface MyWhatzItzTest : SenTestCase &lt;MyAsynchronousBehavior&gt;
{
  MyWhatzItz *myWhatzItz;
  SEL selectorPerformed;
  id targetForSelector;
  id parameterForSelector;
  int performAsynchronouslyInvocationCount;
}
@end

@implementation MyWhatzItzTest

-(void) setUp
{
   myWhatzItz = [[MyWhatzItz alloc] init];
   //The test uses the self-shunt pattern to listen for MyAsynchronousBehavior interaction.
   id theAsynchronousBehavior = self;
   myWhatzItz.asynchronousBehavior = theAsynchronousBehavior;
}

-(void) testMyWhatzItzWillAsynchronouslyDoDisThingWhenAskedToDoDatThing
{
  STAssertEquals(performAsynchronouslyInvocationCount, 0, @&quot;Assuming that we haven't been asked to performAsynchronously&quot;);
  [myWhatzItz doDatThing];
  STAssertEquals(performAsynchronouslyInvocationCount, 1, @&quot;We SHOULD HAVE been asked to performAsynchronously&quot;);
  STAssertEquals(selectorPerformed, @selector(doDisThing:), @&quot;Should have asked to doDisThing using asynchronous behavior.&quot;);
  STAssertEquals(targetForSelector, myWhatzItz, @&quot;Should use myWhatzItz for asynchronous execution.&quot;);
}
@end
#pragma mark MyAsynchronousBehavior protocol methods
-(void) performAsynchronously:(SEL) aSelctor onTarget:(id)aTarget withObject:(id)anObject
{
  performAsynchronouslyInvocationCount++; selectorPerformed = aSelctor; targetForSelector = aTarget; parameterForSelector = anObject;
}
</pre>
<p>Supplying the asynchronous behavior becomes a construction/intialization concern, which could be extracted into a wiring framework like Interface Builder (or if you do Java, Springframework). The nice thing is that we can alternate our asynchronous behavior without touching the rest of the project. We can do something quick/dirty like detachThread&#8230; and later get more elegant with RunLoops. Today&#8217;s tip comes to you (me) completely by accident. I&#8217;ve been trying to test drive things in Java and ObjC for several years now and I&#8217;ve never got this part quite right. Feel free to share your opinions/experiences with threads and tests.</p>
<p><strong>**Update**</strong><br />
The above example demonstrates a few important unit testing concepts. first it uses the self-shunt pattern to allow the test to become a mock and listen for interactions between the tested object and its collaborator(s). Second, it demonstrates the importance of using tests to carve out the pieces that should NOT be under test. In this situation it&#8217;s multi-tasking, however in other scenarios it could be anything from a DBMS to a network call. I could have illustrated an example where I spin up a Thread pool of some sort from within the test started work, paused the main thread and waited for a response. That&#8217;s what I&#8217;ve done in the past and it becomes extremely complicated and brittle. In stead, I use the elegance of abstraction to make the test 100% predictable, 200% more simplistic, and 300% more maintainable. Where do I get those statistics? The short answer is they&#8217;re sequential. (The long story begins yesterday when my 5yr old spontaneously decided to count from 1 to infinity in the middle of our shopping trip. You see, she only recently learned her numbers up to 100 and after getting to 199 we all realized the child&#8217;s computational limits as she continued with one hundred one hundred then followed up with one hundred one hundred one, one hundred one hundred two&#8230;)<br />
<strong>**Update**</strong></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1038/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1038/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1038/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1038&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/13/assertrunsinanotherthread/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating symbolic links in a tar using the Maven Assembly plugin</title>
		<link>http://codeforfun.wordpress.com/2009/10/12/creating-symbolic-links-in-a-tar-using-the-maven-assembly-plugin/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/12/creating-symbolic-links-in-a-tar-using-the-maven-assembly-plugin/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 23:02:47 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1036</guid>
		<description><![CDATA[A while ago I posted some promising info on how one might go about creating symbolic links in a tar using the Maven Assembly plugin. But as luck would have it there is no promise here&#8230; not yet. It&#8217;s such a shame because this can actually be programmed using some clever platform detection and command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1036&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A while ago I posted some promising info on how one might go about <a href="http://codeforfun.wordpress.com/2009/05/19/create-sym-links-in-a-maven-assembly-not-quite/">creating symbolic links in a tar using the Maven Assembly plugin</a>. But as luck would have it there is no promise here&#8230; not yet. It&#8217;s such a shame because this can actually be programmed using some clever platform detection and command line trickery. It could also be done by enhancing the tar logic in whatever the open source project name is. However, I cannot do this today, nor do I have the time to investigate enhancing the tar objects in Java or anything else. The general idea is: given a directory with sym links, create a tar from the directory while maintaining the symbolic link structure within. I ran into the problem again this afternoon after revisiting the project. It&#8217;s funny how I thought I actually had a solution until I ran some of my old code searched Google and turned up my old blog post. If anyone has solved this problem speak up.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1036/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1036&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/12/creating-symbolic-links-in-a-tar-using-the-maven-assembly-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Voice over mobile&#8230; from an agile perspective&#8230;</title>
		<link>http://codeforfun.wordpress.com/2009/10/11/voice-over-mobile-from-an-agile-perspective/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/11/voice-over-mobile-from-an-agile-perspective/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 01:44:39 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1034</guid>
		<description><![CDATA[So I did this really spontaneous thing last week because the new lead VP of AOL Local and Maps came down from high. I love how that sounds&#8230; &#8220;came down from high&#8221;. It&#8217;s like these executives descend from their cloud cathedrals and bless us mere propeller heads with a visit. As it turns out, these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1034&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So I did this really spontaneous thing last week because the new lead VP of AOL Local and Maps came down from high. I love how that sounds&#8230; &#8220;came down from high&#8221;. It&#8217;s like these executives descend from their cloud cathedrals and bless us mere propeller heads with a visit. As it turns out, these guys are not heavenly at all. They get constipation just like I do when the diet doesn&#8217;t include an adequate supply of fiber and liquid. Hi, I&#8217;m Cliff. You&#8217;re here because you don&#8217;t think it&#8217;s possible to develop a mobile voice application using agile practices. I mean, you can&#8217;t honestly test drive something like text-to-speech or voice recognition&#8230; can you? Anyhow, like I was saying, I did a really &#8220;out-of-the-blue&#8221; thing. I&#8217;d been playing with Text-To-Speech ever since I started mobile development. I&#8217;d been fooling with it and trying to get a handle on voice recognition as well. So when I heard my director tell us that the execs were coming to town I thought, &#8220;This would be an ideal time to throw my work in front of their faces to see what kind of reaction I&#8217;d get.&#8221; At this point I had already taken voice in a double round trip from the iPhone to the server pinged back as text then ponged to the server which re-pings more voice. The example was simple and it demonstrated that we could not only do voice output from mobile, but that we could concatenate multiple audio streams in the client and perform recognition. I also had a good amount of confidence in my TTS engine, enough to spend the weekend prior roping in an ugly hack in one of our premier products. (We have two of them now&#8230; go grab the Navigator from the Apple store!)</p>
<p>I received favorable response from all who saw my prototype. So much favor that a subsequent demo was scheduled the next day on my behalf. (I missed my own subsequent demo.) That energized me even further as I decided two nights ago to begin officially bundling my idea. It&#8217;s one thing to hack something together but I needed a polished solution. I began to get back into my comfort zone with test driven design. My warm/fuzzy place. (Lately I&#8217;d been combing through miles of piles of other people&#8217;s non-tested non-reusable code regurgitating the bad practices I&#8217;d been swamped with.) </p>
<p>It began with a test. No. It began with a spec.<br />
Given the text, &#8220;hello Miami!&#8221;<br />
When I ask voiceOutput to speak the text<br />
Then I should get an audio response in return.</p>
<p>I then started to chip away. Nothing was talking. No sounds or audio files were connected to my code. It was just how I remember it. The sweet smell of JUnit&#8230; err&#8230; OCUnit&#8230; or SenTest&#8230;somethin&#8217; or other&#8230; I began to dream while I wrote test after test each followed by implementation logic. &#8220;What will the end picture look like?&#8221; Lower level details tried to sneak into my head but I fought them off&#8230; each time refocusing on the test before me. The task was only to accept text input and respond with an audio stream. </p>
<p>From the onset it seems difficult if not impractical. How does one validate that the voice engine is working? How do you verify the thing speaks&#8230; with sound your ears can pick up? How does it all work with unit tests? I tend to get tripped up on these details just as much as anyone who picks up TDD. When you look at the same problem, the same question with a slightly different view (in reverse even) it becomes obvious. Put the &#8220;D&#8221; in front of TDD. We aren&#8217;t <em>testing</em>, we&#8217;re <em>designing</em>! It&#8217;s Design Driven-by Tests or DDT. If you think <em>test</em> you think things like &#8220;how can I plug my ear drum into SenTestCase?&#8221;, or &#8220;how can I wire my optic nerve up to the JUnit Test runner?&#8221; When you think <em>design</em> you no longer care if it works right you care if you have the right works. So back to my original question, &#8220;How does one validate that the voice engine is working?&#8221; Let&#8217;s instead ask &#8220;How does one build the right voice engine?&#8221; The voice engine is right when it answers the question. The question become the point of focus. The question is the specification. So I don&#8217;t verify audio output. I verify the interface or logic in between. I didn&#8217;t write the voice engine code so verifying it is a wasted exercise. I only care about the code that sits between my phone and the voice engine. </p>
<p>On the outside I know that my phone code deals with english sentences. I also know that it is rather complicated so changing it to &#8220;fit into&#8221; a voice engine would be an exercise in complexity. So now that I&#8217;m not testing audio output or the engine that produces it I can totally forget about what the engine expects&#8230; for now. I continue design with specs and answers to specs. as long as my code returns an audio stream on the outside, I know I&#8217;m finished. The converter code is looking a lot more simple than one would imagine. I then know that I&#8217;l need to get the stream from somewhere. So I write the code to get the audio data from another thing. (Here&#8217;s where I make a subtle mis-step.) I start thinking about caching. Because I&#8217;m worried about cell network latency I want to include an on-device cache. </p>
<p>I continue adding a test that states (literally) that I&#8217;ll probably need a cache. The test asks for text to be converted to audio without using a cache then triggers a test failure if an exception isn&#8217;t thrown. The failure message states something like, &#8220;an exception should be thrown if a cache is not configured.&#8221; I satisfy this requirement and add more tests that anticipate cache inquiries prior to any conversion. I use the self-shunt pattern rather than OCMock objects because I don&#8217;t want to add a framework (layer of complexity) to my project just yet. I drive on with more tests that eventually shape the cache and also a network data provider that only exists as a protocol (analogous to a Java interface). I&#8217;m feeling good at this point. Not finished, not even close&#8230; but I have good progress with a relatively small amount of code. I&#8217;m also feeling slightly more comfortable with both XCode and Objective C. I feel best about the fact that I can actually test drive a feature that would likely seem impossible to most developers. That along with the fact that I managed to do an acceptable demo to our Senior VP team, one that got people giving the thumbs up. I think I can sleep well tonight.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1034/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1034/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1034/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1034&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/11/voice-over-mobile-from-an-agile-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Sorry for ignoring you</title>
		<link>http://codeforfun.wordpress.com/2009/10/07/sorry-for-ignoring-you/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/07/sorry-for-ignoring-you/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 01:00:19 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1032</guid>
		<description><![CDATA[These past few weeks have been chaotic. I&#8217;ve had more people asking for special favors than I&#8217;ve had seconds in each minute. If you are among those people who needed me to work on something, wanted me to research something, looked for a technical solution to something, or whatever then this post is for you. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1032&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>These past few weeks have been chaotic. I&#8217;ve had more people asking for special favors than I&#8217;ve had seconds in each minute. If you are among those people who needed me to work on something, wanted me to research something, looked for a technical solution to something, or whatever then this post is for you. I apologize. I&#8217;ve had to ignore you, the others, and my family members in order to make progress on a few initiatives I&#8217;d started recently. </p>
<p>I currently work on Blackberry mobile stuff for touch screen devices. We&#8217;re trying to port our product to more platforms and the deadline is here. Also, I now have voice/speech working both ways in an iPhone app. (That&#8217;s recognition and synthesizing.) I&#8217;m working on getting the same idea going on the Blackberry Storm. I did a demo for the new executive that came to visit yesterday. I&#8217;m also killing myself over a podcast me and a buddy did last week trying to convert it to a form that can be viewed, heard, and appreciated around the company. Lump that on top of the forty-five other things that brothers, sisters, mothers, wives (no I only have one of those), and friends have asked me to look into. I put everyone on hold&#8230; silently. I really wanna help you, I do. I appreciate doing tech stuff and I wish I had more arms and heads to solve these problems simultaneously. Alas, I am but one being. One tired, worn out being who disparately needs a new hard drive in his Mac because this thing has slowed to a crawl. (At this point I know it&#8217;s the hard drive that&#8217;s slowing everything else because I&#8217;ve killed enough programs to free memory.) I also plan to be more active on my site. There&#8217;s a ton of things I want to talk about. If you&#8217;re a regular visitor do me a favor&#8230; help a brother out&#8230; Could somebody research and find a good tutorial on Cover Story for iPhone development? I really, really, really, wanna do something devilish&#8230; I mean innovative with it. I have big plans for Cover Story&#8230; big plans indeed!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1032/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1032/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1032/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1032/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1032/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1032/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1032/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1032/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1032/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1032/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1032&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/07/sorry-for-ignoring-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
	</channel>
</rss>