<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" version="2.0">

<channel>
	<title>Stefan Macke</title>
	
	<link>http://blog.stefan-macke.com</link>
	<description>Anwendungsentwicklung - Netzwerkadministration - Webdesign</description>
	<lastBuildDate>Thu, 18 Mar 2010 14:43:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/StefanMacke" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="stefanmacke" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How often are functions returning an array for PHP’s foreach statement called?</title>
		<link>http://blog.stefan-macke.com/2010/03/18/how-often-are-functions-returning-an-array-for-phps-foreach-statement-called/</link>
		<comments>http://blog.stefan-macke.com/2010/03/18/how-often-are-functions-returning-an-array-for-phps-foreach-statement-called/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 14:43:54 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=783</guid>
		<description><![CDATA[Today I was asked a question regarding PHP&#8217;s foreach statement: If the array through wich a script iterates is generated by a function, how often is this function called? In this example, will getArray() be called only once or three times?




$c = 0;


function getArray&#40;&#41;


&#123;


&#160; &#160; &#160; &#160; global $c;


&#160; &#160; &#160; &#160; echo &#40;++$c&#41; . [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was asked a question regarding PHP&#8217;s <tt>foreach</tt> statement: If the array through wich a script iterates is generated by a function, how often is this function called? In this example, will <tt>getArray()</tt> be called only once or three times?</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">$c</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> getArray<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">global</span> <span class="re0">$c</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="br0">&#40;</span><span class="sy0">++</span><span class="re0">$c</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st0">&quot;. call to &quot;</span> <span class="sy0">.</span> <span class="kw4">__FUNCTION__</span> <span class="sy0">.</span> <span class="st0">&quot;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/array" class="liexternal"><span class="kw3">array</span></a><span class="br0">&#40;</span>1<span class="sy0">,</span> 2<span class="sy0">,</span> 3<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">foreach</span> <span class="br0">&#40;</span>getArray<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">as</span> <span class="re0">$e</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">echo</span> <span class="st0">&quot;ForEach: &quot;</span> <span class="sy0">.</span> <span class="re0">$e</span> <span class="sy0">.</span> <span class="st0">&quot;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>I didn&#8217;t know the answer myself, although I presumed the function gets called only once. Interestingly, the <a href="http://de.php.net/manual/de/control-structures.foreach.php" title="PHP Manual: foreach" class="liexternal">PHP Manual</a> doesn&#8217;t say a word about this question.</p>
<p>So, what&#8217;s the answer? <strong>The function gets called only once</strong>, as I suspected. Here&#8217;s the output of the code above:</p>
<pre>1. call to getArray
ForEach: 1
ForEach: 2
ForEach: 3</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=V5TRX3bSSbs:9C8CXyr7Afw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=V5TRX3bSSbs:9C8CXyr7Afw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=V5TRX3bSSbs:9C8CXyr7Afw:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2010/03/18/how-often-are-functions-returning-an-array-for-phps-foreach-statement-called/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash: Get IP address of SSH remote user</title>
		<link>http://blog.stefan-macke.com/2010/03/14/bash-get-ip-address-of-ssh-remote-user/</link>
		<comments>http://blog.stefan-macke.com/2010/03/14/bash-get-ip-address-of-ssh-remote-user/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 20:10:05 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=780</guid>
		<description><![CDATA[Today I needed to find out the IP address of the currently logged on user (e.g. via SSH) on a Linux system to use it in a bash script. After searching the web for a simple tool for this task for quite some time, I finally came up with the following bash script to get [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to find out the IP address of the currently logged on user (e.g. via SSH) on a Linux system to use it in a bash script. After searching the web for a simple tool for this task for quite some time, I finally came up with the following bash script to get me the needed information. Is there any way to obtain the IP address in a simpler way by using built in Linux tools?</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="re2">HOST</span>=<span class="sy0">`</span><span class="kw2">who</span> am i <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.*\((.*)\).*/\\1/&quot;</span><span class="sy0">`</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">IP</span>=<span class="sy0">`</span>host <span class="re1">$HOST</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.* has address (.*)/\\1/&quot;</span><span class="sy0">`</span></div>
</li>
</ol>
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=Q6K2nUwwrZ8:I1egdeTNjxs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=Q6K2nUwwrZ8:I1egdeTNjxs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=Q6K2nUwwrZ8:I1egdeTNjxs:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2010/03/14/bash-get-ip-address-of-ssh-remote-user/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NUNIT: A Unit-Test-Framework for Natural</title>
		<link>http://blog.stefan-macke.com/2009/12/29/nunit-a-unit-test-framework-for-natural/</link>
		<comments>http://blog.stefan-macke.com/2009/12/29/nunit-a-unit-test-framework-for-natural/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 20:43:46 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[masterarbeit]]></category>
		<category><![CDATA[Natural]]></category>
		<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Studium]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=752</guid>
		<description><![CDATA[As part of my Master&#8217;s thesis about Test Driven Development (TDD) I developed a Unit-Test-Framework for the programming language Natural. This 4GL language from Software AG is in use for over 30 years now but the notion of automated tests has not been spread throughout the developer community. Perhaps now, with a framework for tests [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my Master&#8217;s thesis about <a href="http://en.wikipedia.org/wiki/Test-driven_development" title="Wikipedia: Test Driven Development" rel="nofollow" class="liwikipedia">Test Driven Development (TDD)</a> I developed a Unit-Test-Framework for the programming language <a href="http://www.softwareag.com/corporate/products/natural/default.asp" title="Software AG Natural website" class="liexternal">Natural</a>. This <a href="http://en.wikipedia.org/wiki/4GL" title="Wikipedia: Fourth Generation Language" rel="nofollow" class="liwikipedia">4GL</a> language from <a href="http://www.softwareag.com" title="Software AG website" class="liexternal">Software AG</a> is in use for over 30 years now but the notion of automated tests has not been spread throughout the developer community. Perhaps now, with a framework for tests available, this will change <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The Unit-Tests that can be run by NUNIT are subprograms and need to have the following structure. As you can see, the fixture&#8217;s and tests&#8217; names are simply plain text to allow strings that are longer than 32 characters (the longest possible name for a Natural module) to provide meaningful names as in <a href="http://en.wikipedia.org/wiki/Behavior_Driven_Development" title="Wikipedia: Behaviour Driven Development" rel="nofollow" class="liwikipedia">Behaviour Driven Development</a>. The TestCases are parsed by NUNIT for this structure to make sure that all the needed parameters, subroutines etc. are available. To create a new TestCase all you have to do is copy the example source code and change the names and the implementation of the tests in the <tt>IF</tt>-branches.</p>
<div class="codesnip-container" >
<div class="natural codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">DEFINE</span> <span class="kw1">DATA</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">PARAMETER</span> <span class="kw1">USING</span> NUTESTP <span class="co2">/* parameters for a single test</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">LOCAL</span> <span class="kw1">USING</span> NUCONST <span class="co2">/* NUNIT constants (error code etc.)</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">LOCAL</span> <span class="kw1">USING</span> NUASSP <span class="co2">/* parameters for the assertions</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">END-DEFINE</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1">NUTESTP.FIXTURE <span class="sy0">:=</span> <span class="st0">&#8216;Example TestCase 1&#8242;</span> <span class="co2">/* this TestCase&#8217;s fixture</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">INCLUDE</span> NUTCTEMP <span class="co2">/* the template method (SETUP -&gt; TEST -&gt; TEARDOWN)</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">INCLUDE</span> NUTCSTUB <span class="co2">/* stub implementations of SETUP and TEARDOWN</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">DEFINE</span> <span class="kw2">SUBROUTINE</span> TEST <span class="co2">/* the main test routine</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">**************************************************************</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">IF</span> NUTESTP.TEST <span class="kw2">EQ</span> <span class="st0">&#8216;comparing two equal numbers should pass&#8217;</span> <span class="co2">/* name of first test</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">**************************************************************</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; ASSERT-LINE <span class="sy0">:=</span> <span class="sy0">*</span>LINE; <span class="kw1">PERFORM</span> ASSERT-NUM-EQUALS NUASSP 2 2 </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">END-IF</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">**************************************************************</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">IF</span> NUTESTP.TEST <span class="kw2">EQ</span> <span class="st0">&#8216;comparing two different numbers should fail&#8217;</span> <span class="co2">/* name of second test</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">**************************************************************</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; ASSERT-LINE <span class="sy0">:=</span> <span class="sy0">*</span>LINE; <span class="kw1">PERFORM</span> ASSERT-NUM-EQUALS NUASSP 1 2 </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">END-IF</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">END-SUBROUTINE</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">*</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">END</span></div>
</li>
</ol>
</div>
</div>
<p>The following diagram shows NUNIT&#8217;s architecture. I tried to make the adaption of NUNIT to a different platform than ours (Solaris with Natural modules saved in the file system) as easy as possible and encapsulated the OS-specific implementation into two modules that need to be changed accordingly. I have also included some basic assertions like <tt>ASSERT-NUM-EQUALS</tt>, <tt>ASSERT-STRING-EQUALS</tt> and <tt>ASSERT-ARRAY-EQUALS</tt> and some example TestCases in the source code you can download below.</p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ArchitekturNUNIT.png"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ArchitekturNUNIT-194x300.png" alt="Architecture of NUNIT" width="194" height="300" /></a></div>
<p>The TestCases&#8217; names are defined in a user-specific workfile in the home directory (in the current configuration, but this may be changed e.g. to a DB <tt>READ</tt>). A run of all defined TestCases is as simple as calling the main program <tt>NUNIT</tt> and produces an output like the following (even with a &#8220;red bar&#8221; <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).</p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ScreenshotNUNITBalken.jpg"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ScreenshotNUNITBalken-300x96.jpg" alt="NUNIT test run (red bar)" width="300" height="96" /></a></div>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ScreenshotNUNITDetailedResults.jpg"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/ScreenshotNUNITDetailedResults-300x121.jpg" alt="NUNIT detailed test results" width="300" height="121" /></a></div>
<p>Notice the nice failure/error messages including the module names, line numbers etc. <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p>I developed NUNIT by applying TDD which means the framework tests itself. After you &#8220;installed&#8221; it (which means importing the NUNIT modules into a library of your choice, preferably a steplib if you plan on using it throughout your application) you can run a simple <tt>TESTNU</tt> to make sure NUNIT behaves as expected.</p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/NUNITSelbsttest.jpg"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/NUNITSelbsttest-296x300.jpg" alt="NUNIT self tests" width="296" height="300" /></a></div>
<p>All NUNIT modules include a detailed header comment so they should be pretty self-explanatory. But in fact, all you need to start are the programs <tt>TESTNU</tt>, <tt>NUNIT</tt> and <tt>NUSINGLE</tt> (with which you can run a single TestCase) and a TestCase like <tt>TCEXMPL1</tt>. Just try it out and let me know if you like it <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>Downloads</h3>
<ul>
<li><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/NUNITsrc.zip" title="NUNITs source code" class="lizip">NUNIT&#8217;s source code</a> (including intermediary versions as described in the thesis)</li>
<li><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/StefanMacke-Masterarbeit-TDD-EntwicklungVonNUNIT.pdf" title="Masters thesis about the development of NUNIT" class="lipdf">The part of my Master&#8217;s thesis about the development of NUNIT</a> (German)</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=WGrqmyLdGoY:DhoR0CB67-I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=WGrqmyLdGoY:DhoR0CB67-I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=WGrqmyLdGoY:DhoR0CB67-I:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/12/29/nunit-a-unit-test-framework-for-natural/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to mock System.Net.Sockets.Socket</title>
		<link>http://blog.stefan-macke.com/2009/12/28/how-to-mock-system-net-sockets-socket/</link>
		<comments>http://blog.stefan-macke.com/2009/12/28/how-to-mock-system-net-sockets-socket/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 17:05:24 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mocking]]></category>
		<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=733</guid>
		<description><![CDATA[In one of my C# projects I wanted to add tests for a class that uses System.Net.Sockets.Socket. The problem was that the class (FTPConnection) depended directly on Socket as shown in the following class diagram. So I had to find a way to get rid of this direct dependency and mock the Socket class to [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my C# projects I wanted to add tests for a class that uses <tt>System.Net.Sockets.Socket</tt>. The problem was that the class (<tt>FTPConnection</tt>) depended directly on <tt>Socket</tt> as shown in the following class diagram. So I had to find a way to get rid of this direct dependency and mock the <tt>Socket</tt> class to be able to test <tt>FTPConnection</tt> without connecting to a live FTP server for each test. </p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocket.png"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocket-300x162.png" alt="Direct dependency between FTPConnection and System.Net.Sockets.Socket" width="300" height="162" /></a></div>
<p>The problem with mocking <tt>System.Net.Sockets.Socket</tt> is that it implements no abstract interface and is also sealed (which means you cannot derive from the class). Therefore, you cannot mock the class directly with <a href="http://www.ayende.com/projects/rhino-mocks.aspx" title="Website of RhinoMocks" class="liexternal">RhinoMocks</a> (which otherwise would be able to mock the class directly without the need for an interface). So we have a (framework) class to whose source code we have no access (which we would need to add something like <tt>Socket : ISocket</tt>) and from wich we cannot derive a new class. How do we mock such a seemingly isolated class?</p>
<p>First of all, we need a common interface that we can use for mocking. The problem is that we have to make sure <tt>Socket</tt> implements this interface (let&#8217;s call it <tt>ISocket</tt>). How do we do that? We find a possible answer to that question in the <a href="http://www.amazon.de/gp/product/0201633612?ie=UTF8&#038;tag=blovonstemac-21&#038;linkCode=as2&#038;camp=1638&#038;creative=19454&#038;creativeASIN=0201633612" title="Amazon: Design Patterns. Elements of Reusable Object-Oriented Software." class="liexternal">GoF design patterns catalog</a>:</p>
<blockquote><p>The <strong>adapter</strong> design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. (<a href="http://en.wikipedia.org/wiki/Adapter_pattern" title="Wikipedia: Adapter pattern" rel="nofollow" class="liwikipedia">Wikipedia</a>)</p></blockquote>
<p>So we have to create an adapter class that implements <tt>ISocket</tt> and simply delegates all calls to its methods to an instance of <tt>Socket</tt>. Then we make sure <tt>FTPConnection</tt> uses the adapter class (or rather <tt>ISocket</tt>) instead of <tt>Socket</tt> directly and provide a constructor through which we can inject our own implementation of <tt>ISocket</tt> (e.g. the mocked one) as shown in the following class diagram.</p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocketMocked.png"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocketMocked-300x148.png" alt="Mocked System.Net.Sockets.Socket" width="300" height="148" /></a></div>
<p>It is quite a bit of effort to mock the <tt>Socket</tt> class (you have to define every needed method in <tt>ISocket</tt> and implement the delegation in <tt>SocketAdapter</tt>) but it definitely pays off! The resulting design is less coupled due to <tt>FTPConnection</tt> depending on <tt>ISocket</tt> instead of <tt>Socket</tt> directly and can be tested easily by providing a mocked socket that simulates valid or invalid FTP server responses. Examples of how to simulate FTP calls and responses using RhinoMocks are included in my example project below.</p>
<h3>Example project in C#</h3>
<p>I have created a small console application in C# according to the second class diagram above which demonstrates the mocking of <tt>System.Net.Sockets.Socket</tt> and produces the output shown in the following screenshot.</p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocketOutput.jpg"  rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocketOutput-300x197.jpg" alt="Console output of MockASocket" width="300" height="197" /></a></div>
<p>You can download the project here:</p>
<ul>
<li><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/12/MockASocket.zip" title="MockASocket (Visual Studio 2008 project including executables and NUnit/RhinoMocks DLLs)" class="lizip">MockASocket (Visual Studio 2008 project including executables and needed DLLs)</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=p0b8cNBDtI4:oZjiOV4Hu7k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=p0b8cNBDtI4:oZjiOV4Hu7k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=p0b8cNBDtI4:oZjiOV4Hu7k:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/12/28/how-to-mock-system-net-sockets-socket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hochzeitsfotos auf Bali</title>
		<link>http://blog.stefan-macke.com/2009/10/31/hochzeitsfotos-auf-bali/</link>
		<comments>http://blog.stefan-macke.com/2009/10/31/hochzeitsfotos-auf-bali/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 17:03:05 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bilder]]></category>
		<category><![CDATA[Hochzeit]]></category>
		<category><![CDATA[Privat]]></category>
		<category><![CDATA[Reisen]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=707</guid>
		<description><![CDATA[Wir haben einen Tag unserer Hochzeitsreise nach Bali mit unserem Hochzeitsfotografen Michael Stange (und seiner Frau, sowie dem einheimischen Fahrer Nyoman) verbracht und wunderschöne Bilder am Strand, in den Reisfeldern und im Monkey Forest machen lassen. Hier sind die entsprechenden Blog-Einträge von Michael dazu:

Hochzeitsfotos auf Bali (&#8221;normales&#8221; Blog)
Hochzeitsfotos auf Bali (Hochzeitsblog)

Einige Fotos kann man (in [...]]]></description>
			<content:encoded><![CDATA[<p>Wir haben einen Tag unserer Hochzeitsreise nach <a href="http://de.wikipedia.org/wiki/Bali" title="Wikipedia: Bali" rel="nofollow" class="liwikipedia">Bali</a> mit unserem <a href="http://michaelstange.de" title="Hochzeitsblog von Michael Stange" class="liexternal">Hochzeitsfotografen</a> <a href="http://michaelstange.de" title="Blog von Michael Stange" class="liexternal">Michael Stange</a> (und seiner Frau, sowie dem einheimischen Fahrer <a href="http://www.balier.info/menu/touristen/touristen-html/touristeninfo.html" title="Informationen zu den balinesischen Vornamen" class="liexternal">Nyoman</a>) verbracht und wunderschöne Bilder am Strand, in den Reisfeldern und im <a href="http://www.monkeyforestubud.com/" title="Website des Monkey Forest" class="liexternal">Monkey Forest</a> machen lassen. Hier sind die entsprechenden Blog-Einträge von Michael dazu:</p>
<ul>
<li><a href="http://michaelstange.de/blog/hochzeitsfotos-auf-bali" title="Hochzeitsfotos auf Bali" class="liexternal">Hochzeitsfotos auf Bali (&#8221;normales&#8221; Blog)</a></li>
<li><a href="http://michaelstange.eu/hochzeitsfotos-auf-bali/" title="Hochzeitsfotos auf Bali" class="liexternal">Hochzeitsfotos auf Bali (Hochzeitsblog)</a></li>
</ul>
<p>Einige Fotos kann man (in hoher Auflösung) bei Flickr bewundern: <a href="http://www.flickr.com/photos/11326701@N03/archives/date-posted/2009/10/26/" title="Fotostream von michaelstange" class="liexternal">Fotostream von michaelstange (26.10.2009)</a>. </p>
<p>Und ein paar davon gibt es auch hier zu sehen. Kommentare sind erwünscht <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  </p>
<p>Es war wirklich sehr heiß bei 35° Grad im Anzug und Kleid, obwohl man das auf den Bildern dank Puder nicht sieht <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p>Das grüne Tuch, das z.B. auf dem vorletzten Bild zu sehen ist, ist ein <a href="http://de.wikipedia.org/wiki/Sarong" title="Wikipedia: Sarong" rel="nofollow" class="liwikipedia">Sarong</a>. Den muss man auf Bali tragen, wenn man den mittleren Hof eines Tempels (in diesem Fall der Tempel im Monkey Forest) betreten möchte. Da der untere Teil des Körpers dort als unrein gilt (bzw. den Dämonen nahesteht), muss er durch den Sarong bedeckt und durch einen Gürtel vom oberen Körper abgegrenzt werden.</p>
<p>Die Affen im Monkey Forest heißen <a href="http://de.wikipedia.org/wiki/Makaken" title="Wikipedia: Makaken" rel="nofollow" class="liwikipedia">Makaken</a> (wie passend zu meinem Namen <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) und einer von ihnen hat hartnäckig versucht, die Perlen vom Kleid abzuknabbern, was ihm bei einer auch tatsächlich gelungen ist. Ansonsten waren die Affen aber friedlich und faul.</p>
<p>Sehr witzig war, dass <a href="http://www.imdb.com/name/nm0000210/" title="IMDB: Julia Roberts" class="liexternal">Julia Roberts</a> an dem Tag, an dem wir die Fotos gemacht haben, <a href="http://balinewsonline.com/bali-news/2009/10/09/julia-robert-will-ride-a-bicycle-in-monkey-forest/" title="Julia Robert will Ride a Bicycle in Monkey Forest" class="liexternal">auch im Monkey Forest war</a> (allerdings erst nachmittags als wir schon weg waren) und die einheimischen Besucher sie mit Jaqueline verwechselt haben, weshalb sie fast mehr Fotos von ihr gemacht haben als Michael. Wir Europäer/Amerikaner sehen für die Balineser wohl alle so &#8220;gleich&#8221; aus wie sie für uns <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p style="text-align: center;">
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali01.jpg" title="Hochzeitsfotos auf Bali 01" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali01-300x200.jpg" alt="Hochzeitsfotos auf Bali 01" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali02.jpg" title="Hochzeitsfotos auf Bali 02" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali02-300x200.jpg" alt="Hochzeitsfotos auf Bali 02" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali03.jpg" title="Hochzeitsfotos auf Bali 03" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali03-300x200.jpg" alt="Hochzeitsfotos auf Bali 03" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali04.jpg" title="Hochzeitsfotos auf Bali 04" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali04-200x300.jpg" alt="Hochzeitsfotos auf Bali 04" width="200" height="300" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali05.jpg" title="Hochzeitsfotos auf Bali 05" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali05-300x200.jpg" alt="Hochzeitsfotos auf Bali 05" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali06.jpg" title="Hochzeitsfotos auf Bali 06" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali06-300x200.jpg" alt="Hochzeitsfotos auf Bali 06" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali07.jpg" title="Hochzeitsfotos auf Bali 07" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali07-200x300.jpg" alt="Hochzeitsfotos auf Bali 07" width="200" height="300" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali08.jpg" title="Hochzeitsfotos auf Bali 08" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali08-200x300.jpg" alt="Hochzeitsfotos auf Bali 08" width="200" height="300" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali09.jpg" title="Hochzeitsfotos auf Bali 09" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali09-300x200.jpg" alt="Hochzeitsfotos auf Bali 09" width="300" height="200" class="size-medium wp-image-708" /></a><br />
<a href="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali10.jpg" title="Hochzeitsfotos auf Bali 10" rel="lightbox"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/10/HochzeitsreiseBali10-300x200.jpg" alt="Hochzeitsfotos auf Bali 10" width="300" height="200" class="size-medium wp-image-708" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=5aZ6HhkA0oQ:-cM300W5oP4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=5aZ6HhkA0oQ:-cM300W5oP4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=5aZ6HhkA0oQ:-cM300W5oP4:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/10/31/hochzeitsfotos-auf-bali/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>LaTeX: Zitierte Autorennamen im Fließtext in Kapitälchen schreiben</title>
		<link>http://blog.stefan-macke.com/2009/09/04/latex-zitierte-autorennamen-im-fliesstext-in-kapitaelchen-schreiben/</link>
		<comments>http://blog.stefan-macke.com/2009/09/04/latex-zitierte-autorennamen-im-fliesstext-in-kapitaelchen-schreiben/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 15:03:39 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Knowledge Base]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[masterarbeit]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=697</guid>
		<description><![CDATA[Um die Namen von Autoren, die in LaTeX mittels \citep oder \citet zitiert werden, im Fließtext (und nicht etwa im Literaturverzeichnis!) in Kapitälchen zu setzen, war bei mir eine winzige Anpassung in der Datei natdin.bst nötig (via mrunix.de).
Diese sorgt dafür, dass in die *.bbl-Datei die entsprechende Auszeichnung in die \bibitems eingetragen wird: In der Funktion [...]]]></description>
			<content:encoded><![CDATA[<p>Um die Namen von Autoren, die in LaTeX mittels <tt>\citep</tt> oder <tt>\citet</tt> zitiert werden, <strong>im Fließtext</strong> (und nicht etwa im Literaturverzeichnis!) in <span style="font-variant: small-caps;">Kapitälchen</span> zu setzen, war bei mir eine winzige Anpassung in der Datei <tt>natdin.bst</tt> nötig (via <a href="http://www.mrunix.de/forums/showthread.php?t=50538#11" title="mrunix.de: Wunschzitatstil" class="liexternal">mrunix.de</a>).</p>
<p>Diese sorgt dafür, dass in die <tt>*.bbl</tt>-Datei die entsprechende Auszeichnung in die <tt>\bibitem</tt>s eingetragen wird: In der Funktion <tt>output.bibitem</tt> musste der Output <tt>"\bibitem["</tt> lediglich durch <tt>"\bibitem[<strong>\scshape{}</strong>"</tt> ersetzt werden.</p>
<p>Und schon sehen die Zitate aus wie hier:</p>
<div style="text-align: center;"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/09/LaTeXciteKapitaelchen1.jpg" alt="LaTeX: Zitierte Autoren in Kapitälchen" title="LaTeX: Zitierte Autoren in Kapitälchen" width="311" height="114" class="size-full wp-image-699" /></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=KJpB0PCWxjw:WN-Lmxiv3qU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=KJpB0PCWxjw:WN-Lmxiv3qU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=KJpB0PCWxjw:WN-Lmxiv3qU:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/09/04/latex-zitierte-autorennamen-im-fliesstext-in-kapitaelchen-schreiben/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blog-Parade: Die 3 beliebtesten Fachbücher aus dem .NET-Umfeld</title>
		<link>http://blog.stefan-macke.com/2009/09/02/blog-parade-die-3-beliebtesten-fachbuecher-aus-dem-net-umfeld/</link>
		<comments>http://blog.stefan-macke.com/2009/09/02/blog-parade-die-3-beliebtesten-fachbuecher-aus-dem-net-umfeld/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:23:47 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Bücher]]></category>
		<category><![CDATA[Blog-Parade]]></category>
		<category><![CDATA[Programmierung]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=696</guid>
		<description><![CDATA[Heute nehme ich mal an meiner ersten Blog-Parade teil, weil das Thema gerade sehr gut passt: Die 3 beliebtesten Fachbücher aus dem .NET-Umfeld (gestartet von Wolfgang Kluge). Bei der Literaturrecherche zu meiner Masterarbeit zum Thema Test Driven Development habe ich nämlich durchaus auch das ein oder andere .NET-Buch gelesen.
Meine drei aktuellen Favoriten im .NET-Umfeld sind [...]]]></description>
			<content:encoded><![CDATA[<p>Heute nehme ich mal an meiner ersten <a href="http://de.wikipedia.org/wiki/Blog-Parade" title="Wikipedia: Blog-Parade" rel="nofollow" class="liwikipedia">Blog-Parade</a> teil, weil das Thema gerade sehr gut passt: <a href="http://gehirnwindung.de/post/2009/09/01/Blog-Parade-Die-3-beliebtesten-Fachbucher-aus-dem-NET-Umfeld.aspx" title="Blog-Parade: Die 3 beliebtesten Fachbücher aus dem .NET-Umfeld" class="liexternal">Die 3 beliebtesten Fachbücher aus dem .NET-Umfeld</a> (gestartet von <a href="http://gehirnwindung.de/author/Wolfgang.aspx" title="Artikel von Wolfgang Kluge" class="liexternal">Wolfgang Kluge</a>). Bei der Literaturrecherche zu meiner Masterarbeit zum Thema <a href="http://de.wikipedia.org/wiki/Testgetriebene_Entwicklung" title="Wikipedia: Test Driven Development" rel="nofollow" class="liwikipedia">Test Driven Development</a> habe ich nämlich durchaus auch das ein oder andere .NET-Buch gelesen.</p>
<p>Meine drei aktuellen Favoriten im .NET-Umfeld sind die folgenden Bücher:</p>
<ol>
<li><strong><a href="http://www.amazon.de/dp/ASIN/1933988274/ref=nosim?tag=blovonstemac-21" title="The Art of Unit Testing" class="liexternal">The Art of Unit Testing</a> von Roy Osherove.</strong><br />Kurz und knapp: das Buch hat alles, was man zum Thema Unit-Tests mit .NET wissen muss. Es ist meiner Meinung nach aktuell die praxisnahste Einführung in das Thema Unit-Tests und enthält von einer lockeren Einführung, über die Eigenschaften <em>guter</em> Tests bis hin zu Mocking-Frameworks und testgetriebener Entwicklung alle Kernthemen aus dem Bereich der automatischen Software-Tests.<br />Wer sich einen Eindruck vom Autor verschaffen will, kann dies u.a. in Form eines <a href="http://www.hanselminutes.com/default.aspx?showID=187" title="Hanselminutes: The Art of Unit Testing with Roy Osherove" class="liexternal">Podcasts bei Hanselminutes</a> oder als <a href="http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/445_low.wmv" title="David Platt im Interview mit Roy Osherove" class="liexternal">Video von der TechEd</a> tun.
</li>
<li><strong><a href="http://www.amazon.de/dp/ASIN/059652773X/ref=nosim?tag=blovonstemac-21" title="C# 3.0 Design Patterns" class="liexternal">C# 3.0 Design Patterns</a> von Judith Bishop.</strong><br />Wer sich in das Thema Entwurfsmuster einarbeiten will, kommt normalerweise nicht um  <a href="http://www.amazon.de/dp/ASIN/0201633612/ref=nosim?tag=blovonstemac-21" title="Design Patterns. Elements of Reusable Object-Oriented Software." class="liexternal">das altbekannte Buch der Gang of Four</a> herum. Allerdings hat es nun mittlerweile 14 Jahre auf dem Buckel. Judith Bishop schlägt in ihrem Buch die Brücke zwischen den altbewährten Design Patterns und den Sprachmöglichkeiten in C# 3.0. Sie zeigt, wie sich die Muster im Stile von .NET umsetzen lassen und liefert dafür sehr anschauliche Beispiele. Auch für Einsteiger ins Thema ist das Buch gut geeignet, allen anderen zeigt es vielleicht interessante moderne Ansätze zur Implementierung der langjährigen Pattern-Wegbegleiter.</li>
<li><strong><a href="http://www.amazon.de/dp/ASIN/0132350882/ref=nosim?tag=blovonstemac-21" title="Clean Code: A Handbook of Agile Software Craftsmanship" class="liexternal">Clean Code: A Handbook of Agile Software Craftsmanship</a> von Robert C. Martin.</strong><br />Ok, etwas geschummelt. Das Buch hat erstmal nichts mit .NET zu tun. Aber ich halte Clean Code für ein so wichtiges Buch, dass es einfach auf diese Liste gehört. Nicht umsonst haben <a href="http://www.ralfw.de/default.html" title="Website von Ralf Westphal" class="liexternal">Ralf Westphal</a> und <a href="http://www.lieser-online.de/" title="Website von Stefan Lieser" class="liexternal">Stefan Lieser</a> (deren Vortrag ich mir übrigens nächste Woche <a href="http://www.gi-hb-ol.de/" title="Gesellschaft für Informatik, Regionalgruppe Bremen Oldenburg" class="liexternal">in Bremen</a> anhöre) ihre Initiative <a href="http://www.clean-code-developer.de/" title="Clean-Code-Developer-Wiki" class="liexternal">Clean Code Developer</a> nach diesem Buch benannt. Es enthält so viele wichtige Tipps für Entwickler (egal welcher Programmiersprache), dass ich gar nicht weiß, wo ich anfangen soll. Aber wahrscheinlich ist das Buch eh ein alter Hut für die meisten Leser, oder? <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</li>
</ol>
<p>So. Das waren meine Top 3. Vielleicht ist ja was Interessantes dabei oder es hagelt Kritiken, warum ich ausgerechnet diese Bücher ausgewählt habe&#8230; Wie auch immer, Kommentare sind ausdrücklich erwünscht <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=LBU6xThsCB0:LolKlaYwJyk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=LBU6xThsCB0:LolKlaYwJyk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=LBU6xThsCB0:LolKlaYwJyk:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/09/02/blog-parade-die-3-beliebtesten-fachbuecher-aus-dem-net-umfeld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/445_low.wmv" length="31991170" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>Anwendungsentwickler/in und Student/in der Wirtschaftsinformatik in Vechta gesucht</title>
		<link>http://blog.stefan-macke.com/2009/08/19/anwendungsentwicklerin-und-studentin-der-wirtschaftsinformatik-in-vechta-gesucht/</link>
		<comments>http://blog.stefan-macke.com/2009/08/19/anwendungsentwicklerin-und-studentin-der-wirtschaftsinformatik-in-vechta-gesucht/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 18:53:42 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ausbildung]]></category>
		<category><![CDATA[Job]]></category>
		<category><![CDATA[Studium]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=694</guid>
		<description><![CDATA[Die ALTE OLDENBURGER Krankenversicherung in Vechta sucht zu sofort eine/n Anwendungsentwickler/in im Adabas/Natural- und/oder Java-Umfeld. Voraussetzung ist eine abgeschlossene Ausbildung zum Fachinformatiker Anwendungsentwicklung oder ein Studium der (Wirtschafts-)Informatik.
Außerdem soll im kommenden Jahr ab dem 01. August 2010 wieder ein/e Student/in der Wirtschaftsinformatik in Kooperation mit der BA Emsland ausgebildet werden. Bei der ALTE OLDENBURGER wird [...]]]></description>
			<content:encoded><![CDATA[<p>Die <a href="http://www.alte-oldenburger.de/web/html/start/" title="Website der ALTE OLDENBURGER" class="liexternal">ALTE OLDENBURGER Krankenversicherung</a> in Vechta sucht zu sofort eine/n Anwendungsentwickler/in im Adabas/<a href="http://www.softwareag.com/de/products/natural/default.asp" title="Natural-Website der Software AG" class="liexternal">Natural</a>- und/oder Java-Umfeld. Voraussetzung ist eine abgeschlossene Ausbildung zum Fachinformatiker Anwendungsentwicklung oder ein Studium der (Wirtschafts-)Informatik.</p>
<p>Außerdem soll im kommenden Jahr ab dem 01. August 2010 wieder ein/e Student/in der <a href="http://www.ba-emsland.de/studiengaenge/studiengaenge_wirtschaftsinformatik.html" title="Studiengang Wirtschaftsinformatik an der BA Emsland" class="liexternal">Wirtschaftsinformatik</a> in Kooperation mit der <a href="http://www.ba-emsland.de/" title="Website der BA Emsland" class="liexternal">BA Emsland</a> ausgebildet werden. Bei der ALTE OLDENBURGER wird bei diesem <em>dualen Studium</em> die Ausbildung zum <em>Fachinformatiker Anwendungsentwicklung</em> absolviert, während das Studium in zehnwöchigen Praxisphasen an der BA Emsland in Lingen stattfindet.</p>
<div style="text-align: center;"><a href="http://www.alte-oldenburger.de/web/html/start/unternehmen/beruf_und_karriere/stellenangebote/" title="Stellenangebote bei der ALTE OLDENBURGER"><img style="background: none;" src="http://blog.stefan-macke.com/wp-content/uploads/2009/08/logoao.gif" alt="Logo der ALTE OLDENBURGER" title="Logo der ALTE OLDENBURGER" width="230" height="36" /></a></div>
<p>Die Kontaktdaten für die schriftlichen oder elektronischen Bewerbungsunterlagen gibt es hier: <a href="http://www.alte-oldenburger.de/web/html/start/unternehmen/beruf_und_karriere/stellenangebote/" title="ALTE OLDENBURGER: Stellenangebote" class="liexternal">Stellenangebote bei der ALTE OLDENBURGER</a>.</p>
<p>Dann also mal nichts wie ran an die Bewerbung und vielleicht sind wir bald Kollegen <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=--sWCAUa9EQ:iH-l_2sqcGc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=--sWCAUa9EQ:iH-l_2sqcGc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=--sWCAUa9EQ:iH-l_2sqcGc:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/08/19/anwendungsentwicklerin-und-studentin-der-wirtschaftsinformatik-in-vechta-gesucht/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Die acht Eigenschaften guter Unit-Tests</title>
		<link>http://blog.stefan-macke.com/2009/08/18/die-acht-eigenschaften-guter-unit-tests/</link>
		<comments>http://blog.stefan-macke.com/2009/08/18/die-acht-eigenschaften-guter-unit-tests/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 17:48:25 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[masterarbeit]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit-Tests]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=693</guid>
		<description><![CDATA[Bei meinen Recherchen im Rahmen meiner Masterarbeit zum Thema &#8220;Test Driven Development als Maßnahme zur Qualitätssicherung bei der Softwareentwicklung&#8221; habe ich versucht, herauszufinden, welche Eigenschaften &#8220;gute&#8221; Unit-Tests aufweisen sollten. Herausgekommen ist die folgende Liste aus acht Eigenschaften, für die ich leider auch nach mehreren Versuchen mit unterschiedlichen Wörtern kein leicht zu merkendes Akronym finden konnte:

korrekt: [...]]]></description>
			<content:encoded><![CDATA[<p>Bei meinen Recherchen im Rahmen meiner Masterarbeit zum Thema &#8220;<em>Test Driven Development als Maßnahme zur Qualitätssicherung bei der Softwareentwicklung</em>&#8221; habe ich versucht, herauszufinden, welche Eigenschaften &#8220;gute&#8221; Unit-Tests aufweisen sollten. Herausgekommen ist die folgende Liste aus acht Eigenschaften, für die ich leider auch <a href="http://www.wordsmith.org/anagram/index.html" title="Internet Anagram Server" class="liexternal">nach mehreren Versuchen</a> mit unterschiedlichen Wörtern kein leicht zu merkendes Akronym finden konnte:</p>
<ul>
<li><strong>korrekt</strong>: Die Test müssen in sich fehlerfrei sein und zu den Anforderungen passen.</li>
<li><strong>schnell</strong>: Die Tests müssen schnell laufen, um häufig durchgeführt werden zu können.</li>
<li><strong>abgeschlossen</strong>: Die Tests müssen ein klares Ergebnis liefern und dürfen keine Interpretation benötigen.</li>
<li><strong>isoliert</strong>: Die Tests müssen unabhängig von anderen Tests durchführbar sein und dürfen andere Tests nicht beeinflussen.</li>
<li><strong>sprechend</strong>: Die Tests sollten ihre Absicht durch sprechende Benennung kundtun (wie etwa beim BDD).</li>
<li><strong>wartbar</strong>: Die Tests sollten den Regeln für sauberen Code folgen und sich leicht an den veränderten Produktivcode anpassen lassen.</li>
<li><strong>begrenzt</strong>: Die Tests sollten jeweils nur einen kleinen Bereich des Testobjekts prüfen (und nicht etwa mehrere Methoden gleichzeitig).</li>
<li><strong>einfach durchführbar</strong>: Die Tests müssen so einfach wie möglich (am besten auf Knopfdruck) durch einen beliebigen Entwickler durchführbar sein.</li>
</ul>
<p>Wer hat noch mehr zu bieten?</p>
<h3>Quellen</h3>
<ul>
<li>Roy Osherove: <em><a href="http://www.amazon.de/dp/1933988274/ref=nosim?tag=blovonstemac-21" class="liexternal">The Art of Unit Testing</a></em>. Manning Publications, 2008.</li>
<li>Michael Feathers: <em><a href="http://www.artima.com/weblogs/viewpost.jsp?thread=126923" title="A Set of Unit Testing Rules" class="liexternal">A Set of Unit Testing Rules</a></em>. 2005.</li>
<li>Kent Beck: <em><a href="http://www.amazon.de/dp/0321146530/ref=nosim?tag=blovonstemac-21" title="Test-Driven Development: by Example" class="liexternal">Test-Driven Development: by Example</a></em>. Addison-Wesley, 2003.</li>
<li>Klaus Meffert: <em><a href="http://www.amazon.de/dp/3935042760/ref=nosim?tag=blovonstemac-21" title="JUnit Profi-Tipps" class="liexternal">JUnit Profi-Tipps</a></em>. Entwickler.Press, 2006.</li>
<li>David Astels: <em><a href="http://www.amazon.de/dp/0131016490/ref=nosim?tag=blovonstemac-21" title="Test Driven Development: A Practical Guide" class="liexternal">Test Driven Development: A Practical Guide</a></em>. Prentice Hall International, 2003.</li>
<li>Robert C. Martin: <em><a href="http://www.amazon.de/dp/0132350882/ref=nosim?tag=blovonstemac-21" title="Clean Code: A Handbook of Agile Software Craftsmanship" class="liexternal">Clean Code: A Handbook of Agile Software Craftsmanship</a></em>. Prentice Hall PTR, 2008.</li>
<li>Arie van Deursen et.al.: <em><a href="http://homepages.cwi.nl/~arie/papers/xp2001.pdf" title="Refactoring Test Code" class="lipdf">Refactoring Test Code</a></em>. Proceedings of the 2nd International Conference on Extreme Programming	and Flexible Processes in Software Engineering, 2001.</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=rRA5SQuyRbA:qUWn3h3Au9Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=rRA5SQuyRbA:qUWn3h3Au9Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=rRA5SQuyRbA:qUWn3h3Au9Q:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/08/18/die-acht-eigenschaften-guter-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vortrag zum Thema ‘Tod durch PowerPoint’</title>
		<link>http://blog.stefan-macke.com/2009/08/10/vortrag-zum-thema-tod-durch-powerpoint/</link>
		<comments>http://blog.stefan-macke.com/2009/08/10/vortrag-zum-thema-tod-durch-powerpoint/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 11:29:35 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PowerPoint]]></category>
		<category><![CDATA[Präsentieren]]></category>
		<category><![CDATA[Vorträge]]></category>

		<guid isPermaLink="false">http://blog.stefan-macke.com/?p=689</guid>
		<description><![CDATA[Am kommenden Donnerstag, den 13.08. um 19 Uhr halte ich einen zweistündigen Vortrag zum Thema &#8220;Tod durch PowerPoint&#8221; bei der Kolpingsfamilie Rulle. Im Rahmen ihres Projektes 3KR (Kompetent Kommunizieren) werde ich auf die Gestaltung von PowerPoint-Vorträgen eingehen, die das Publikum nicht nach 5 Minuten in den Schlaf wiegen, sondern es vielmehr ansprechen und mitreißen.

Die übliche [...]]]></description>
			<content:encoded><![CDATA[<p>Am kommenden Donnerstag, den 13.08. um 19 Uhr halte ich einen zweistündigen Vortrag zum Thema &#8220;Tod durch PowerPoint&#8221; bei der <a href="http://www.kolping-rulle.de/termine/index.html" title="Kolpingsfamilie Rulle" class="liexternal">Kolpingsfamilie Rulle</a>. Im Rahmen ihres <a href="http://www.kolping-rulle.de/termine/3kr/index.html" title="Projekt 3KR" class="liexternal">Projektes 3KR</a> (Kompetent Kommunizieren) werde ich auf die Gestaltung von PowerPoint-Vorträgen eingehen, die das Publikum nicht nach 5 Minuten in den Schlaf wiegen, sondern es vielmehr ansprechen und mitreißen.</p>
<div style="text-align: center;"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/08/titelfolieklein.jpg" alt="Titelfolie Tod durch PowerPoint" title="Titelfolie Tod durch PowerPoint" width="300" height="225" /></div>
<p>Die übliche Literatur dazu sollte inzwischen allgemein bekannt sein. Wenn nicht, erfolgt hiermit der absolute Lesebefehl <img src='http://blog.stefan-macke.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<ul>
<li><a href="http://www.amazon.de/dp/0321525655/ref=nosim?tag=blovonstemac-21" title="Presentation Zen bei Amazon" class="liexternal">Presentation Zen</a> von <a href="http://www.presentationzen.com/presentationzen/" title="Blog von Garr Reynolds" class="liexternal">Garr Reynolds</a></li>
<li><a href="http://www.amazon.de/dp/0596522347/ref=nosim?tag=blovonstemac-21" title="Slide:ology bei Amazon" class="liexternal">Slide:ology</a> von <a href="http://blog.duarte.com/" title="Blog von Duarte Design" class="liexternal">Nancy Duarte</a></li>
<li><a href="http://www.amazon.de/dp/1400064287/ref=nosim?tag=blovonstemac-21" title="Made to Stick bei Amazon" class="liexternal">Made to Stick</a> von <a href="http://www.madetostick.com/blog/" title="Blog von Made to Stick" class="liexternal">Chip und Dan Heath</a></li>
</ul>
<p>Wer sich nicht gleich alle Bücher zulegen will, kann auch erstmal mit dem Vortrag von Garr Reynolds bei Google anfangen: <a href="http://www.youtube.com/watch?v=DZ2vtQCESpk" title="Authors@Google: Garr Reynolds" class="liexternal">Authors@Google: Garr Reynolds</a>. Da wird schon so ziemlich alles beschrieben, worauf es bei Präsentationen ankommt.</p>
<h3>Handout zum Vortrag</h3>
<p>Mein Handout zum Vortrag gibt es hier: <a href="http://blog.stefan-macke.com/wp-content/uploads/2009/08/tod-durch-powerpoint.pdf" title="Handout zum Vortrag Tod durch PowerPoint" class="lipdf">Tod durch PowerPoint</a>. </p>
<div style="text-align: center;"><a href="http://blog.stefan-macke.com/wp-content/uploads/2009/08/tod-durch-powerpoint.pdf" title="Handout zum Vortrag Tod durch PowerPoint"><img src="http://blog.stefan-macke.com/wp-content/uploads/2009/08/titelblatt-handout.jpg" alt="Titelblatt Handout Tod durch PowerPoint" title="Titelblatt Handout Tod durch PowerPoint" width="177" height="250" /></a></div>
<p>Es fasst die Oberpunkte meines Vortrags zusammen:</p>
<ul>
<li>Warum unsere bisherigen Präsentationen in den Müll gehören</li>
<li>Wie kann man es besser machen?</li>
<li>Wie entwickle ich meine Präsentation?</li>
<li>Design der Folien</li>
<li>Tipps für den Vortrag</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/StefanMacke?a=ypfxu0JfjKA:Phn4SgWDkhI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/StefanMacke?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/StefanMacke?a=ypfxu0JfjKA:Phn4SgWDkhI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/StefanMacke?i=ypfxu0JfjKA:Phn4SgWDkhI:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.stefan-macke.com/2009/08/10/vortrag-zum-thema-tod-durch-powerpoint/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
