<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to get Started with TDD</title>
	<atom:link href="http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Tue, 09 Mar 2010 04:29:26 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marcin</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2625</link>
		<dc:creator>Marcin</dc:creator>
		<pubDate>Thu, 17 Dec 2009 18:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2625</guid>
		<description>@ Łukasz

I think in that example State design pattern can&#039;t be used anymore,
then you will be forced to replace it by &quot;ifology&quot;. 
I&#039;m looking for answer too;]</description>
		<content:encoded><![CDATA[<p>@ Łukasz</p>
<p>I think in that example State design pattern can&#8217;t be used anymore,<br />
then you will be forced to replace it by &#8220;ifology&#8221;.<br />
I&#8217;m looking for answer too;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukasz</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2613</link>
		<dc:creator>Lukasz</dc:creator>
		<pubDate>Thu, 17 Dec 2009 10:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2613</guid>
		<description>@Misko

I see the point, at this moment all State and CalculatorNumber objects are newable. But lets go further with this example. Let&#039;s say the state objects have dependency to object A, so I will have to ask for it in a constructor. In that case all state objects become incjectables while Operator objects and CalculatorNumber remain newable. In current implementation state objects ask for newables (Operator, CalculatorNumber), but after adding the dependency A, I would break rule: &quot;Injectable can never ask for a non-Injectable (Newable) in its constructor&quot;. What do you suggest, how to deal with new requirement??

cheers</description>
		<content:encoded><![CDATA[<p>@Misko</p>
<p>I see the point, at this moment all State and CalculatorNumber objects are newable. But lets go further with this example. Let&#8217;s say the state objects have dependency to object A, so I will have to ask for it in a constructor. In that case all state objects become incjectables while Operator objects and CalculatorNumber remain newable. In current implementation state objects ask for newables (Operator, CalculatorNumber), but after adding the dependency A, I would break rule: &#8220;Injectable can never ask for a non-Injectable (Newable) in its constructor&#8221;. What do you suggest, how to deal with new requirement??</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2607</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Wed, 16 Dec 2009 17:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2607</guid>
		<description>@Lukasz,

1) yes the new operators, may be a problem, but in this case they are not since what they are instantiating are essentially new operations, which are leafs. see: http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/ This is a thin line to walk, since as soon as your operations become more of services the whole thing will need to become refactored for proper DI. So my comment is that new operators here are OK for now, since they don&#039;t prevent testability and there is no need to control the wiring in a different state

2) This is another tricky one. I don&#039;t like it out of principle, but again it is not a problem since there is no global state hidden in the operators. But, I don&#039;t like it since it is too easy for someone to add state and bring the whole thing down, so I am with you that it should be avoided. A better way to do that which is structurally equivalent is through Enumerations in java, as that is a bigger hint that you should not put state in there as they are global.</description>
		<content:encoded><![CDATA[<p>@Lukasz,</p>
<p>1) yes the new operators, may be a problem, but in this case they are not since what they are instantiating are essentially new operations, which are leafs. see: <a href="http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/" rel="nofollow">http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/</a> This is a thin line to walk, since as soon as your operations become more of services the whole thing will need to become refactored for proper DI. So my comment is that new operators here are OK for now, since they don&#8217;t prevent testability and there is no need to control the wiring in a different state</p>
<p>2) This is another tricky one. I don&#8217;t like it out of principle, but again it is not a problem since there is no global state hidden in the operators. But, I don&#8217;t like it since it is too easy for someone to add state and bring the whole thing down, so I am with you that it should be avoided. A better way to do that which is structurally equivalent is through Enumerations in java, as that is a bigger hint that you should not put state in there as they are global.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukasz</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2606</link>
		<dc:creator>Lukasz</dc:creator>
		<pubDate>Wed, 16 Dec 2009 16:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2606</guid>
		<description>@Misko


looking at Marcin&#039;s solution it seems it is well OO designed and implemented.  Anyway I think there are places for fixes.

1) I am not sure, but I think he mixes business concert with graph instantiation. If you take a look at this class http://bitbucket.org/niedvied/calculator/src/0e9853c1f48f/blog/tdd/01_Calculator/src/calculatorstate/AddingSecondNumber.java and all other state classes, there is plenty of new operator.  He creates other State  and CalculatorNumber objects. According to yours advises all new operators should go to factories. 

2) http://bitbucket.org/niedvied/calculator/src/tip/blog/tdd/01_Calculator/src/operator/OperatorProvider.java. What about this static initialization and field ??

Can you conform my issues? If I am right can you explain how to fix it.

 I&#039;d be grateful, thx</description>
		<content:encoded><![CDATA[<p>@Misko</p>
<p>looking at Marcin&#8217;s solution it seems it is well OO designed and implemented.  Anyway I think there are places for fixes.</p>
<p>1) I am not sure, but I think he mixes business concert with graph instantiation. If you take a look at this class <a href="http://bitbucket.org/niedvied/calculator/src/0e9853c1f48f/blog/tdd/01_Calculator/src/calculatorstate/AddingSecondNumber.java" rel="nofollow">http://bitbucket.org/niedvied/calculator/src/0e9853c1f48f/blog/tdd/01_Calculator/src/calculatorstate/AddingSecondNumber.java</a> and all other state classes, there is plenty of new operator.  He creates other State  and CalculatorNumber objects. According to yours advises all new operators should go to factories. </p>
<p>2) <a href="http://bitbucket.org/niedvied/calculator/src/tip/blog/tdd/01_Calculator/src/operator/OperatorProvider.java" rel="nofollow">http://bitbucket.org/niedvied/calculator/src/tip/blog/tdd/01_Calculator/src/operator/OperatorProvider.java</a>. What about this static initialization and field ??</p>
<p>Can you conform my issues? If I am right can you explain how to fix it.</p>
<p> I&#8217;d be grateful, thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcin</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2542</link>
		<dc:creator>Marcin</dc:creator>
		<pubDate>Sat, 05 Dec 2009 18:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2542</guid>
		<description>Sorry for my comment above.
I didn&#039;t have time so I wrote my nick instead of first name
(it&#039;s a bad practice) and I didn&#039;t give you feedback. 

It was my first application with tests and I think it was a very
positive experience.

* I almost didn&#039;t run application during development, very cool;]
* I can refactor without stress and I my application still work at the end.
* Writting test wasn&#039;t to much overhead

I know It&#039;s like from books feedback  but It&#039;s really true.

It would be great if you find some time to review my code

PS. Sorry for my english 

http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/</description>
		<content:encoded><![CDATA[<p>Sorry for my comment above.<br />
I didn&#8217;t have time so I wrote my nick instead of first name<br />
(it&#8217;s a bad practice) and I didn&#8217;t give you feedback. </p>
<p>It was my first application with tests and I think it was a very<br />
positive experience.</p>
<p>* I almost didn&#8217;t run application during development, very cool;]<br />
* I can refactor without stress and I my application still work at the end.<br />
* Writting test wasn&#8217;t to much overhead</p>
<p>I know It&#8217;s like from books feedback  but It&#8217;s really true.</p>
<p>It would be great if you find some time to review my code</p>
<p>PS. Sorry for my english </p>
<p><a href="http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/" rel="nofollow">http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nvd</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2510</link>
		<dc:creator>nvd</dc:creator>
		<pubDate>Wed, 02 Dec 2009 21:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2510</guid>
		<description>http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/

Comments are welcome too.</description>
		<content:encoded><![CDATA[<p><a href="http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/" rel="nofollow">http://bitbucket.org/niedvied/calculator/changeset/0e9853c1f48f/</a></p>
<p>Comments are welcome too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2493</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 30 Nov 2009 20:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2493</guid>
		<description>@raul:
There are some files missing.

I started a fork at bitbucket
https://bitbucket.org/michaelkebe/misko-hevery-blog/overview/

Any comments are as always welcome.</description>
		<content:encoded><![CDATA[<p>@raul:<br />
There are some files missing.</p>
<p>I started a fork at bitbucket<br />
<a href="https://bitbucket.org/michaelkebe/misko-hevery-blog/overview/" rel="nofollow">https://bitbucket.org/michaelkebe/misko-hevery-blog/overview/</a></p>
<p>Any comments are as always welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raul</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2492</link>
		<dc:creator>raul</dc:creator>
		<pubDate>Sat, 28 Nov 2009 22:19:33 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2492</guid>
		<description>Hi Misko,

I&#039;ve been working on your TDD exercise, and i&#039;ve pretty much got all functionality of the calculator. TDD really makes me being more focused and confident that my code is working as expected. It has been a great practice, especially because it made me understand my bad decisions! :)

After implementing sum and decimals, i&#039;ve noticed that the CalculatorController was getting too big, so I&#039;ve created an interface (Calculation) and a single implementation (StandardCalculation) and passed it to the Controller. The goal of this class was to take care of the calculation itself, while the CalculatorController would do the conversion between character-&gt;number and back to string for the view. However, i now can tell that it was a bit too premature. I&#039;ve ended up getting a big StandardCalculation class (carried away with adding more functionality and not stopping to think about refactoring it), and also realized that the interface definition that i&#039;ve forced at that point was not the best choice. It now seems not flexible at all because this Calculation interface only accepts the numbers digit by digit (funny, i&#039;ve realized this when refactoring test code of CalculatorController).
Another thing that I&#039;ve noticed is that i&#039;ve ended up almost replicating my tests between the CalculatorController and StandardCalculation. Not sure how to improve that though..
Other than that, i&#039;m having plenty of conditionals in the StandardCalculation class, because I&#039;ve ended up not dividing concerns in this class, so I should now try to refactor it to look more OO.

Here&#039;s a gist with the most important classes. Anyone feel free to comment on it: http://gist.github.com/244657

Cheers,
Raul</description>
		<content:encoded><![CDATA[<p>Hi Misko,</p>
<p>I&#8217;ve been working on your TDD exercise, and i&#8217;ve pretty much got all functionality of the calculator. TDD really makes me being more focused and confident that my code is working as expected. It has been a great practice, especially because it made me understand my bad decisions! <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After implementing sum and decimals, i&#8217;ve noticed that the CalculatorController was getting too big, so I&#8217;ve created an interface (Calculation) and a single implementation (StandardCalculation) and passed it to the Controller. The goal of this class was to take care of the calculation itself, while the CalculatorController would do the conversion between character-&gt;number and back to string for the view. However, i now can tell that it was a bit too premature. I&#8217;ve ended up getting a big StandardCalculation class (carried away with adding more functionality and not stopping to think about refactoring it), and also realized that the interface definition that i&#8217;ve forced at that point was not the best choice. It now seems not flexible at all because this Calculation interface only accepts the numbers digit by digit (funny, i&#8217;ve realized this when refactoring test code of CalculatorController).<br />
Another thing that I&#8217;ve noticed is that i&#8217;ve ended up almost replicating my tests between the CalculatorController and StandardCalculation. Not sure how to improve that though..<br />
Other than that, i&#8217;m having plenty of conditionals in the StandardCalculation class, because I&#8217;ve ended up not dividing concerns in this class, so I should now try to refactor it to look more OO.</p>
<p>Here&#8217;s a gist with the most important classes. Anyone feel free to comment on it: <a href="http://gist.github.com/244657" rel="nofollow">http://gist.github.com/244657</a></p>
<p>Cheers,<br />
Raul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TDD unlimited &#171; monkey island</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2477</link>
		<dc:creator>TDD unlimited &#171; monkey island</dc:creator>
		<pubDate>Thu, 26 Nov 2009 22:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2477</guid>
		<description>[...] please try to influence others to write more tests and learn TDD. How much inspirational is this or that! Anyway, it&#8217;s just my humble request to the world. Of course, you can write whatever you [...]</description>
		<content:encoded><![CDATA[<p>[...] please try to influence others to write more tests and learn TDD. How much inspirational is this or that! Anyway, it&#8217;s just my humble request to the world. Of course, you can write whatever you [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Einführung in TDD &#38; Clean Code Talks &#124; geekcloud.org</title>
		<link>http://misko.hevery.com/2009/11/17/how-to-get-started-with-tdd/comment-page-1/#comment-2426</link>
		<dc:creator>Einführung in TDD &#38; Clean Code Talks &#124; geekcloud.org</dc:creator>
		<pubDate>Sun, 22 Nov 2009 14:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=599#comment-2426</guid>
		<description>[...] über das Interview mit Miško Hevery auf DZone berichtet. Kurz zuvor hat dieser eine kleine Einführung mit einem entsprechendem Beispiel zum Thema Test Driven Development verfasst. Das ganze ist als [...]</description>
		<content:encoded><![CDATA[<p>[...] über das Interview mit Miško Hevery auf DZone berichtet. Kurz zuvor hat dieser eine kleine Einführung mit einem entsprechendem Beispiel zum Thema Test Driven Development verfasst. Das ganze ist als [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
