<?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>MIH SWAT &#187; open source</title>
	<atom:link href="http://www.mihswat.com/tag/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mihswat.com</link>
	<description>MIH SWAT - the official blog of MIH's Strategic Worldwide Applications and Technology Team.</description>
	<lastBuildDate>Mon, 06 Sep 2010 10:24:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>My Journey to planet Android</title>
		<link>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/</link>
		<comments>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 09:11:17 +0000</pubDate>
		<dc:creator>Bradley Wells</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[SWAT]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=838</guid>
		<description><![CDATA[Coming from a Flash Developer background I have had no experience with mobile application development. From the time I saw the first phone to run Android, the G1, I have been itching to get into Android development. So when I was recently given the go-ahead to take this journey into the Android world, plus a [...]]]></description>
			<content:encoded><![CDATA[<p>Coming from a Flash Developer background I have had no experience with mobile application development. From the time I saw the first phone to run Android, the G1, I have been itching to get into Android development. So when I was recently given the go-ahead to take this journey into the <a title="Android" href="http://www.android.com/" target="_blank">Android</a> world, plus a shiny new Android phone <img src='http://www.mihswat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , I was both excited and nervous<span id="more-838"></span> . Why nervous? Firstly, I had never developed for a mobile device before, secondly I had never written  a Java application before and lastly because I had no idea how the Android framework actually worked . But this is what we as SWAT employees love, new territory to conquer ! If you havent seen a Android device yet, see the video below of the new HTC Hero.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/FKTDSfbcbBU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="400" height="295" src="http://www.youtube.com/v/FKTDSfbcbBU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Nowadays it&#8217;s almost impossible to write an article about mobile phones without mentioning the very successful<a title="iPhone" href="http://www.mihswat.com/2009/09/22/i-dont-like-the-iphone/" target="_self"> iPhone</a>. <a title="Apple" href="http://www.apple.com" target="_blank">Apple</a> had practically turned the mobile  industry upside down with its touch screen device. Some people will argue to the death about how the iPhone, or the &#8220;Jesus Phone&#8221; as some call it, is the best thing since sliced bread &#8211; and nobody can argue against how successful this device has become. But I am predicting a total onslaught of Android devices within 2 years. The Android army of phones will be everywhere you look and you will not be able to visit any cellphone store without running into at least 50 different phones running this OS. OK &#8211; maybe that is going a bit far but I think you get the message and already we are seeing signs of it. At the time of writing this article there are 16 official Android devices. How will this army of Android devices be created you ask ? Enter the Open Handset Alliance.</p>
<p>The <a title="Open Handset Alliance" href="http://en.wikipedia.org/wiki/Open_Handset_Alliance" target="_blank">Open Handset Alliance</a> was formed in 2007 and currently has 47 members. It is a consortium of technology and mobile companies all dedicated to bringing us better mobile experiences, with Android being their first project . There are some big names amongst the 47 members, including Google, Intel, Nvidia, HTC, Asus, SonyEriccson, LG, Ebay. With so many big names dedicated to Android development, it is bound to be amongst the top mobile device OS&#8217;s. You can read more about this <a title="before" href="http://www.mihswat.com/2008/10/07/why-android-will-win-or-iphone-in-the-long-run/" target="_self">argument here</a>, let me get to the Android architecture.</p>
<p>Android is a Linux based software stack. On top of the Linux kernel layer lies a layer for the system libraries such as SQLite, SSL, OpenGL, etc. This layer also houses the Android runtime, which runs the Dalvik Virtual Machine. On top of this there&#8217;s the Application Framework, housing the managers like the Activity Manager, Window Manager, etc. Then finally there is the application layer, which is the layer we are most interested in.</p>
<p><img class="alignnone size-full wp-image-844" title="system-architecture" src="http://www.mihswat.com/wp-content/uploads/2009/09/system-architecture.jpg" alt="system-architecture" width="428" height="307" /></p>
<p>Android applications can consist of different sections, namely Activities, Services, Broadcast Recievers and Content Providers. Activities form the User Interface(UI) part of the application, Services run in the background similar to RSS feed readers checking for updates. Broadcast Receivers just listen for particular system broadcasts, for example , when the battery is low. Content Providers just provide content to any asking application , for example your application asking the contact book to provide the users contacts for use within your application. We will mostly be concerned with Activities.</p>
<p>Activities were designed to be totally integrated with one another. What I mean is that Activities can call one another and pass data to one another, basically  like an event driven system, but on a system wide level. An application is thus a group of Activities passing Intents to one another. It is then possible to include , lets say, a Google Maps Activity into your application by passing a Google Maps Intent to it and waiting for a result from it. It would seem to the end user that you created a Google Maps section to your app. I think this is pretty powerful.</p>
<p>To get started with creating these applications you need the free <a title="Android SDK" href="http://developer.android.com/sdk/1.6_r1/index.html">Android SDK</a>, Apple iPhone developers need to register first($99!). Then you going to need an IDE, there is an Eclipse plugin, the <a title="Android Development Tools" href="http://dl.google.com/android/ADT-0.9.3.zip">Android Development Tools</a>(ADT) plugin that has everything including the latest stable SDK. You don&#8217;t immediately need a phone to test on as ADT comes with an Android emulator that you can debug and test with but you will eventually need a phone to properly test with. ADT is pretty awesome as it comes with many tools to tell you exactly whats happening on the phone, which threads are running,it has code completion, wizards to quickly create sub classes and much more. It took me less than 30 minutes to get a  &#8220;Hello World&#8221; application running on the Android emulator from the time I installed the ADT!</p>
<p>Since ActionScript 3 is a lot like Java I could easily jump in even though there were a few syntax differences &#8211; but after about 2 days and the help of ADT I had a basic application drawing a ball bouncing round the screen. But that was only the beginning and have rewritten sections of the game many times. Now after two weeks of lots of learning I have created the game and have it running on my phone. It is still a prototype and even though it needs weeks more spit and polish, after demonstrating the game I have gotten the thumbs up to turn it into a real game which we will be registering in the Android market.  There is still a lot to learn from this wonderful framework but the <a title="Android Groups" href="http://groups.google.com/group/android-beginners">Android groups</a> have been great help, as well as all the <a title="Android forums" href="http://www.anddev.org/" target="_blank">Android forums</a> and of course, <a title="developers guide" href="http://developer.android.com/guide/topics/graphics/2d-graphics.html">the Reference guide</a> which ships with the SDK. It has been a challenge to get to grips with this entirely new development area but it was far easier than imagined it would be. I spent about 10 times longer getting to know Flash, and that was with people available to help me.</p>
<p>What about my experience using the phone? I can honestly say I am now more connected than ever before. My email, both gmail and exchange, is pushed to the phone. My Twitter application runs in the background constantly fetching  tweets, while my Facebook application gets all my buddies&#8217; status updates to me as often as I want to see them. News and weather is updated all the time. My calendar and contacs are synchronised between my phone and my mobile. I never get lost anymore, maps are always available and my Gtalk status is always &#8220;available&#8221; and running in the background, unlike on some other phones <img src='http://www.mihswat.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Oh, and it makes phone calls as well.</p>
<p>I will follow up with another article of my findings, good and bad, this time focusing on the actual Android game development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/09/28/my-journey-to-planet-android/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHPT: Writing tests for PHP</title>
		<link>http://www.mihswat.com/2009/09/01/phpt-writing-tests-for-php/</link>
		<comments>http://www.mihswat.com/2009/09/01/phpt-writing-tests-for-php/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 09:12:50 +0000</pubDate>
		<dc:creator>Rafael Dohms</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[phpt]]></category>
		<category><![CDATA[phptestfest]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=792</guid>
		<description><![CDATA[This year the PHP Community promoted the PHPTestFest in various places around the globe and it was a success. I participated in the event promoted by the PHPSP UG (PHP Sao Paulo User Group) which ended up as being the team with the most tests committed. After participating in the event I kept going and [...]]]></description>
			<content:encoded><![CDATA[<p>This year the PHP Community promoted the PHPTestFest in various places around the globe and it was a success. I participated in the event promoted by the PHPSP UG (PHP Sao Paulo User Group) which ended up as being the team with the most tests committed. After participating in the event I kept going and have since obtained an SVN account and karma to be an official test committer to PHP.<span id="more-792"></span> If you did not get the chance to learn how to write tests during your local TestFest, I will now go over the steps taken so you can be ready for next year. PHPT is an extremely simple test framework designed to test PHP itself. Its atomic nature and independent test execution makes it perfect for the kind of tests needed, so tests can be really focused on testing specific functions and/or bugs. <strong>What do I need to know?</strong> The beauty of PHPT is that you need to know very little other than how to write PHP code. A little knowledge of the inner workings of PHP will of course help you in finding areas of code that need testing, and how best to test them, but just knowing PHP is enough to start. I have divided this post into 5 parts:</p>
<ol>
<li>Preparing the Environment</li>
<li>Choosing what to test</li>
<li>Writing a test</li>
<li>Executing a test</li>
<li>Submitting a test to PHP</li>
</ol>
<p><!--more--></p>
<h2><strong>1. Preparing the Environment </strong></h2>
<p>Your test environment needs the correct version of PHP and the ability to run tests, I&#8217;m going to focus on *nix/MacOS systems here  as I have not had experience with tests on Windows. The first step is to compile PHP from source. During the testfest we focused on PHP 5.3, but you should head over to the PHP QA Page (<a href="http://qa.php.net/">qa.php.net</a>) to see what version is being targeted, or else take you pick from the PHP SVN. In any case &#8211; you need to download the source code that is appropriate for your system. The basic compilation process means you need to execute ./configure with your correct settings, and then run <em>make</em>. After running <em>make</em> you are already ready to run tests using the <em>make</em> test command. The latter will run all the current tests (9000+) and prompt you to send a report to the QA Team. But before you begin writing your own tests I recommend that you also run <em>make install</em> so you can have a proper PHP executable for the version you are testing. Later on we will see how to use <em>make test</em> to target only the tests you wish to execute.</p>
<h2><strong>2. Choosing what to test </strong></h2>
<p>Before you begin writing a test you must decide on what you are writing a test for. You will usually be either writing a test for a specific bug or to cover areas of PHP without &#8220;code coverage&#8221;. To figure out the bugs that have/need tests you should get on the QA mailing list or check out the correct path (for example for GD go to ext/gd/tests) for a filename with the bug-id. To write tests to cover untouched areas of the source code your best bet is to head over to <a href="http://gcov.php.net/">http://gcov.php.net</a> where you should pick you branch/version and look for the areas with less code coverage. In this year&#8217;s testfest the PHPSP group focused on the GD extension, so we where basically looking at the coverage for the gd.c file, which i will use for examples in this article. To decide what to test took a little bit of bit-scrubbing, so this is why I remarked earlier that knowing the inner working of PHP helps. However &#8211; after a few examples you will easily pick up what needs to be done.</p>
<p>Let&#8217;s start by analysing these lines of code from gd.c:</p>
<p><a href="http://www.mihswat.com/wp-content/uploads/2009/08/Picture-1.png"><img class="size-medium wp-image-798 alignnone" src="http://www.mihswat.com/wp-content/uploads/2009/08/Picture-1-300x68.png" alt="PHPT - C code" width="300" height="68" /></a></p>
<p>What we are looking for here are the red lines, which means that these lines were not executed. The main objective is to get all lines to either blue (executed) or white (non-executable code) as you can see above. The first thing you should notice here is that this is the code for the imageclorallocatealpha function as displayed online 1848 by the PHP_FUNCTION construct. Now you should look at the red lines where we can easily see that line 1856 is never executed, and judging by the IF construct before it we can state that this line is never executed because the zend_parse_parameters function (nevermind what it does for now) never returns the FAILURE state. As it happens, the zend_parse_parameters is responsible for parsing and validating the parameters passed to the function, so we can guess that this means that the current tests never pass an invalid parameter to the function, thus never testing if it actually returns a proper error message. This seems like  good place to begin learning about tests.</p>
<h2><strong>3. Writing a test </strong></h2>
<p>Writing the actual test is usually really simple, as it should be since tests need to be atomic. You should limit the scope of your test to testing only the function at hand and the particular situation you want to test &#8211; this will also help you name the test properly, as we will see next.</p>
<h3><strong>3.1 Naming test files </strong></h3>
<p>Naming test files is simple if you defined you scope correctly:</p>
<ul>
<li>Bug test: bug&lt;bugid&gt;.phpt</li>
<li>Basic function usage: &lt;função&gt;_basic.phpt</li>
<li>Function error behaviours: &lt;função&gt;_error.phpt</li>
<li>Variations of function usage: &lt;função&gt;_variation.phpt</li>
<li>Extensions: &lt;extensão&gt;_&lt;#&gt;.phpt</li>
</ul>
<h3><strong>3.2 Structure of a .phpt file </strong></h3>
<p>The simple structure of PHPT tests follows this basic pattern:</p>
<blockquote>
<pre>--TEST--
strtr() function - basic test for strstr()
--FILE--
/* Do not change this test it is a README.TESTING example. */
$trans = array("hello"=&gt;"hi", "hi"=&gt;"hello", "a"=&gt;"A", "world"=&gt;"planet");
var_dump(strtr("# hi all, I said hello world! #", $trans));
?&gt;
--EXPECT--
string(32) "# hello All, I sAid hi planet! #"</pre>
</blockquote>
<p>As we can see the &#8211;TEST&#8211; section holds a one-line title for the test and should make it pretty clear as to what is being tested. The &#8211;FILE&#8211; section is the actual test code which will be internally converted into a .php file and executed. And finally the &#8211;EXPECT&#8211; section will be compared to the .php output to see if they are the same, var_dump is recommended for the tests. These are just the most standard sections &#8211; the full documentation can be checked on the QA site under <a href="http://qa.php.net/phpt_details.php">phpt format,</a>. You will come across situations where these blocks are not sufficient, but generally you will be checking if function X is returning value Y when passed parameter Z, so the above is usually all you need. One block is very important namely the &#8211;CREDIT&#8211; block. Putting your name here is very important so you can be reached in case of problems, and also to ensure that you get credit for writing tests for PHP. We used this format in our testfest:</p>
<blockquote>
<pre>--CREDIT--
Rafael Dohms &lt;myemail@gmail.com&gt;
#PHPSPTestFest 2009-04-DD</pre>
</blockquote>
<p>Getting back to the code above, let&#8217;s try to write a test to cover the untested line we selected above. Let&#8217;s look closely at the parse function and figure out what we need to test:</p>
<blockquote>
<pre><span>zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, <strong>"rllll"</strong>, &amp;IM, &amp;red, &amp;green, &amp;blue, &amp;alpha)</span></pre>
</blockquote>
<p>The important part to look at is the <em>&#8220;rllll&#8221;</em> as it defines the type needed for each of the parameters. The first parameter for example requires a Resource as stated by the &#8220;r&#8221;, whereas the rest of them need Long value. If we look at the PHP manual for this function we will get:</p>
<blockquote>
<pre>int imagecolorallocatealpha ( resource $image , int $red , int $green , int $blue , int $alpha )</pre>
</blockquote>
<p>It confirms what we saw in the code, but it might also show wrong information, so this would be another point where you can help PHP updating and fixing the documentation. Let&#8217;s write a test to make sure that the function sends an error message if we pass something that is not a Resource as its first parameter. Looking inside the ext/gd/tests folder we do not find any imagecolorallocatealpha files, so according to the naming conventions above we should use the name <em>imagecolorallocatealpha_error1.phpt</em> for our test file, since we are checking error conditions and it is the first error test for this function. (in sequence we can user error2, error3&#8230; for the other parameters)</p>
<blockquote>
<pre>--TEST--
Testing imagecolorallocatealpha(): Wrong types for parameter 1
--CREDITS--
Rafael Dohms &lt;rdohms [at] gmail [dot] com&gt;</pre>
</blockquote>
<p>The first step is to get the test title right and tag it with our credit so we can be found in case of future changes or problems. Make sure your title describes the objective without being an essay.</p>
<blockquote>
<pre>--SKIPIF--
&lt;?php
    if (!extension_loaded("gd")) die("skip GD not present");
?&gt;</pre>
</blockquote>
<p>We did not mention the &#8211;SKIPIF&#8211; section before, but it is a key section in this case. This is very important because we are testing a function of the GD extension, so this means that depending on the local environment it might actually not be available, for example if GD is not enabled. In this case we do not want to execute these tests since they would all fail, leading to false negatives. This section can also be used for other skip criteria, like 32 bit Vs. 64 bit tests, or any other condition that you feel might affect your test. The section itself is very simple &#8211; just do a check and in case the conditions for skipping are met, call a die command and the test will be marked as SKIP not FAIL in the final execution.</p>
<blockquote>
<pre>--FILE--</pre>
<pre>&lt;?php $resource = tmpfile();

imagecolorallocatealpha($resource, 255, 255, 255, 50);
imagecolorallocatealpha('string', 255, 255, 255, 50);
imagecolorallocatealpha(array(), 255, 255, 255, 50);
imagecolorallocatealpha(null, 255, 255, 255, 50);
?&gt;</pre>
</blockquote>
<p>This is the body of the actual test &#8211; it is really simple and atomic. What we did is to call the function various times with different types of parameters. In the first call we are actually testing line 1859, because tmpfile returns a valid Resource, however not an Image Resource and line 1859 should catch that. The rest of the parameters receive valid values, in this case integers. Testing various types is interesting because you might find a specific type that causes non-expected behavior. Since we are hoping for error messages, we do not even need the return value of the function.</p>
<blockquote>
<pre>--EXPECTF--
Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d</pre>
<pre>Warning: imagecolorallocatealpha() expects parameter 1 to be resource, %s given in %s on line %d</pre>
<pre>Warning: imagecolorallocatealpha() expects parameter 1 to be resource, array given in %s on line %d</pre>
<pre>Warning: imagecolorallocatealpha() expects parameter 1 to be resource, null given in %s on line %d</pre>
</blockquote>
<p>Finally we now have a &#8211;EXPECTF&#8211; block which is the same as a &#8211;EXPECT&#8211; block but uses a printf-like structure to skip out on dynamic parts of the test. As we can see strings such as file name or line are replaced by %s or %d meaning it will fit any value. This is important because different environments might return different file paths. You can also use blocks with regular expressions, but this format is much more simple and easy to read. As we can see we are expecting an error message for each of the calls we made. <em><strong> </strong></em></p>
<p><em><strong>Tip: </strong>To get these error messages, execute the phpt file using a php executable, like: php imagecolorallocatealpha_error1.phpt. The file will be executed and everything outside &lt;? tags will be output, and the actual output for the &#8211;FILE&#8211; block will be output as well, just copy-paste and replace dynamic bits.</em> <em><strong> </strong></em></p>
<p><em><strong>Tip 2:</strong> the error message usually states the given type, as in: string given; If you are expecting the string type in the error message, replace it with %s to make your test compatible with PHP 5.3- and PHP6, since in this case it would print &#8220;unicode string&#8221; instead of &#8220;string&#8221; </em></p>
<h2><strong>4. Executing a test </strong></h2>
<p>Your test is ready for the drill, now we need the drillmaster to pick it up and make it jump through the hoops. We have seen that <em>make test</em> executes the PHP tests, but with 9000+ tests this is too time consuming to test one new test. So we should get it to execute only our test and the related tests we need. To do this we can use the TESTS parameter which will define which tests should be executed:</p>
<blockquote>
<pre>make test TESTS=ext/gd/tests/imagecolorallocatealpha_*.phpt</pre>
</blockquote>
<p>You can either pass it the full path to your test or use a wildcard (*) to execute all tests that match the pattern &#8211; this is useful if we decided to write tests for all parameters and want to run them all at once. This is the resulting output:</p>
<p><a href="http://www.mihswat.com/wp-content/uploads/2009/08/Picture-2.png"><img class="alignnone size-medium wp-image-799" src="http://www.mihswat.com/wp-content/uploads/2009/08/Picture-2-300x142.png" alt="PHPT - Shell" width="300" height="142" /></a></p>
<p><a href="http://www.rafaeldohms.com.br/wp-content/uploads/Picture-2.png"></a> The test passes as we can see by the PASS text present before the test title (&#8211;TEST&#8211; block). Note that if this test had failed, the test framework would have created a few additional files to help you debug the problem. These files have the same name as the original .phpt but different extensions:</p>
<ul>
<li>.out &#8211; the output for the php code</li>
<li>.php &#8211; source code generated for the test (&#8211;FILE&#8211;)</li>
<li>.diff &#8211; a diff between &#8211;EXPECT&#8211; and the actual output</li>
<li>.exp &#8211; the isolated text in the &#8211;EXPECT&#8211; section</li>
<li>.log &#8211; a log of all information related (output, expected&#8230;)</li>
</ul>
<p>These files are extremely useful in debugging. They are auto-removed once you get the test to PASS.</p>
<h2><strong>5. Submitting you test to PHP </strong></h2>
<p>There are a few ways to get your test into the PHP SVN. The easiest one is to participate in a TestFest event. All tests written at these events are submitted to a separate repository and then migrated to the official repository. The second way is to send your test file to the QA mailing list (use pastebin) and get someone to review it. The final way is a mix of the previous ones, participate in a TestFest event.. get a taste for tests, write a whole bunch of them,  and at the end, apply for a SVN account. If you play your cards right and keep on writing tests you will easily get Karma and will become an official test committer in PHP.  Hey it happened to me, true story, so it just depends on you and your willingness to write tests.</p>
<h2><strong>Conclusion</strong></h2>
<p>Now htat you have all the tools you need, what are you waiting for? Go help out the PHP Community. But don&#8217;t stop there, get the taste for tests and bring them to your application as well using PHPUnit and TDD &#8211; which I hope to write more about soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/09/01/phpt-writing-tests-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossing the divide &#8211; the move to open source</title>
		<link>http://www.mihswat.com/2009/01/13/crossing-the-divide-the-move-to-open-source/</link>
		<comments>http://www.mihswat.com/2009/01/13/crossing-the-divide-the-move-to-open-source/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 09:51:04 +0000</pubDate>
		<dc:creator>Jacques van Niekerk</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Jacques van Niekerk]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[platforms]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=306</guid>
		<description><![CDATA[Last year brought many changes to our team &#8211; and not all of these changes have been of a positive nature. Nevertheless there were positive outcomes, not the least of which has been changing our development platform of choice away from Microsoft technology. Let me provide some background. The majority of our team members, both [...]]]></description>
			<content:encoded><![CDATA[<p>Last year brought many changes to our team &#8211; and not all of these changes have been of a positive nature. Nevertheless there <em>were</em> positive outcomes, not the least of which has been changing our development platform of choice away from Microsoft technology.</p>
<p><span id="more-306"></span>Let me provide some background. The majority of our team members, both in South Africa and Brazil, had been Microsoft .Net developers at some point in their careers, and some had never been anything else. We used to hire people based &#8211; in part &#8211; on their expertise with Microsoft development tools.</p>
<p>As a business unit, SWAT comes into contact with a large number of organisations from around the globe that are members of the MIH group. In our interaction with these companies we were experiencing a great deal of resistance to implementing Microsoft software.</p>
<p>The reasons for this resistance were varied but often based on cost &#8211; both the cost of the software and the cost of the people who are skilled in the use of Microsoft tools. Cost was not the only consideration &#8211; the general perception out there is that the Web is built on open source software, and that open source is where the best developers want to place their efforts and build their reputations.</p>
<p>It was very clear that we had to cross the great divide if we wanted to stay relevant in the markets where the group operates.</p>
<p>Although we had never been a pure Microsoft shop &#8211; we used Flash technologies, Javascript , CSS and their kin, as well as various tools for mobile development &#8211; our core development tools were Microsoft Visual Studio, using C# with .Net and ASP.Net, and the challenge was to change our primary development platform.</p>
<p>Our greatest concern was what the reaction of the team members would be &#8211; I mentioned earlier that the majority of people in the team at that time were skilled in Microsoft technology, and we were worried that the re-skilling that would be required would present us with a very steep (and costly) learning curve. A further concern was that the changeover may cause people to leave the team, rather than lose the skills they have already acquired in Microsoft technologies.</p>
<p>Once the decision had been made to shift our focus to open source development, we had to choose a platform. The obvious choice was PHP 5.0. &#8220;Obvious&#8221; because of the wide popularity of the language within the group, the wide support for PHP and the vibrant PHP community. An additional consideration was that PHP is fairly similar to C#, in terms of syntax and in terms of being a &#8220;traditional&#8221; object oriented language. Although we considered options such as Ruby, we concluded that PHP would represents the best option for migrating to open source.</p>
<p>It has been more or less a year since we finally phased out Microsoft tools, and here&#8217;s the summary of our experience:</p>
<ul>
<li>Great programmers do not care about the language. We lost no-one because they wanted to work only on Microsoft platforms.</li>
<li>The web IS built with open source tools &#8211; and using open source tools gave us a wider audience.</li>
<li>Costs for software development tools have plummeted to virtually zero.</li>
<li>The Microsoft Visual Studio <a href="http://en.wikipedia.org/wiki/Integrated_development_environment" target="_blank">IDE</a> is one of the best (if not the best) development environments available.</li>
<li>If you are going to use open source, you must be willing to change and adapt <em>all the time</em>. Frameworks, tools and methodologies are continuously changing in the open source world &#8211; forget about well-planned migration routes for technology. Be pragmatic, and use what works. We still use Microsoft tools when our clients require it.</li>
<li>Because it is open source, it is possible to look into the code to find why things do not work as expected. Often it is very hard to find the solution, and there is hardly ever a helpdesk which you can call. But you can look if you want &#8211; the option is there.</li>
<li>Microsoft is not bad. In our experience it is simply a matter of choosing the most appropriate tool for the job, and the Microsoft tools are more suited for enterprise development. Although of course the platform CAN be used for web development.</li>
</ul>
<p>In summary &#8211; the decision to go open source was the best decision for our team, and I would encourage every team that does web development to do the same thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/01/13/crossing-the-divide-the-move-to-open-source/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
