<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Agile Developer Venkat's Blog</title>
    <link>http://www.agiledeveloper.com/blog/</link>
    <description>Agile Developer: Venkat Subramaniam</description>
    <copyright>Agile Developer, Inc.</copyright>
    <lastBuildDate>Sun, 24 Jan 2010 14:40:13 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.7.5016.2</generator>
    <managingEditor>venkats@agiledeveloper.com</managingEditor>
    <webMaster>venkats@agiledeveloper.com</webMaster>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</wfw:commentRss>
      <slash:comments>0</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">2010 is going to be busy for conference
   and use group speaking.<br />
   I'm excited the following conferences and user groups have invited me to speak in
   2010.<br /><br /><b>Conferences:</b><table><tbody><tr><td><a href="http://www.nofluffjuststuff.com" target="_blank"><img src="http://www.agiledeveloper.com/blog/content/binary/nfjs.jpg" border="0" /></a></td><td>
               USville (Several US locations)</td><td>
               Click on image for dates near you</td><td>
               NFJS is 10 years old now! I started on the NFJS tour fairly early and it's been absolute
               fun. The attendees on this tour are smart and the speakers have become close friends.
               Love the show and glad to be on it again in 2010. My topics include Java, Scala, Groovy,
               and agile practices.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.devnexus.com" target="_blank"><img src="http://www.agiledeveloper.com/blog/content/binary/logo_devnexus_600x150.png" border="0" height="38" width="152" /></a></td><td>
               Atlanta</td><td>
               March 8-9</td><td>
               Quite a variety of topics and speakers at this event. I will be giving a keynote and
               will talk about effective Java.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.ciol.com/SparkIT/2010" target="_blank"><img src="content/binary/spark_Logo.jpg" border="0" height="73" width="154" /></a></td><td>
               Bangalore</td><td>
               March 18-19</td><td>
               Covers quite a variety of topics across language and framework boundaries. My topics
               include Java, Groovy, .NET, and Javascript.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.phillyemergingtech.com" target="_blank"><img src="content/binary/logo_ete.png" border="0" height="30" width="156" /></a></td><td>
               Philadelphia</td><td>
               April 8-9</td><td>
               I am really looking forward to this conference so I can meet some of the people I've
               been wanting to meet for a while. My topic is related to DSL in Groovy.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.gr8conf.org" target="_blank"><img src="content/binary/gr8.jpg" border="0" height="57" width="169" /></a></td><td>
               Minneapolis</td><td>
               April 16</td><td>
               Centered around technologies, tools, and frameworks related to Groovy, this one day
               conference will bring some of the key people in the Groovy community together. I will
               be giving the kick-off talk at this event and a few Groovy related sessions.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.developersummit.com" target="_blank"><img src="content/binary/GIDS_Logo.jpg" border="0" height="49" width="162" /></a></td><td>
               Bangalore</td><td>
               April 20-23</td><td>
               This would be my third year at this conference. It is organized really well and one
               of the best polyglot conferences in India. I will be giving a keynote and speaking
               on F#, Java, Scala, Groovy, Functional Programming, and agile practices.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.iasahome.org/web/itarc/denver2010" target="_blank"><img src="content/binary/iasa.jpg" border="0" height="48" width="162" /></a></td><td>
               Denver</td><td>
               May 6</td><td>
               This is a conference focused on Architecture. This is the first time I will be at
               this conference and looking forward to learning from others at the event. My talk
               most likely will be "Tell me about your Architecture, I will tell you about your Organization."<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://uberconf.com" target="_blank"><img src="content/binary/UberConf_125x125_speaking.png" border="0" height="92" width="125" /></a></td><td>
               Denver</td><td>
               June 14-17</td><td>
               Summer in Denver this year is going to be hotter than usual with Über Conf coming
               to town. This conference will offer an eclectic mixture of languages on the JVM and
               practical agility. The speaker round up looks awesome and the conference price includes
               a number of interesting workshops. Can't wait for this one.<br /></td></tr><tr><td colspan="4"><hr /></td></tr><tr><td><a href="http://www.houstontechfest.com" target="_blank"><img src="content/binary/houstontechfest.jpg" border="0" height="56" width="174" /></a></td><td>
               Houston</td><td>
               October 9</td><td>
               I could not make it to this event in the past few years, but I have promised to speak
               there this year. This is another good polyglot event with several great speakers and
               good participation from the attendees.<br /></td></tr></tbody></table><br /><b>User Groups:</b><table><tbody><tr><td><a href="http://javamug.org/mainpages/2010Meetings.html#Jan">Java Metroplex User Group</a></td><td>
               Testing with Groovy</td><td>
               Jan. 13</td></tr><tr><td><a href="http://www.memphisjug.org">Memphis Java User Group</a></td><td>
               How to approach refactoring</td><td>
               Feb. 18</td></tr><tr><td><a href="http://groups.google.com/group/boston-scala">Boston Area Scala Enthusiasts</a></td><td>
               Scala Idioms and Design Patterns</td><td>
               March 4</td></tr></tbody></table><img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=284e8162-936b-4f67-86b9-f8e3c91a02c7" /></body>
      <title>Conferences in 2010</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</link>
      <pubDate>Sun, 24 Jan 2010 14:40:13 GMT</pubDate>
      <description>2010 is going to be busy for conference and use group speaking.&lt;br&gt;
I'm excited the following conferences and user groups have invited me to speak in
2010.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Conferences:&lt;/b&gt; 
&lt;table&gt;
   &lt;tbody&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.nofluffjuststuff.com" target="_blank"&gt;&lt;img src="http://www.agiledeveloper.com/blog/content/binary/nfjs.jpg" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            USville (Several US locations)&lt;/td&gt;
         &lt;td&gt;
            Click on image for dates near you&lt;/td&gt;
         &lt;td&gt;
            NFJS is 10 years old now! I started on the NFJS tour fairly early and it's been absolute
            fun. The attendees on this tour are smart and the speakers have become close friends.
            Love the show and glad to be on it again in 2010. My topics include Java, Scala, Groovy,
            and agile practices.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.devnexus.com" target="_blank"&gt;&lt;img src="http://www.agiledeveloper.com/blog/content/binary/logo_devnexus_600x150.png" border="0" height="38" width="152"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Atlanta&lt;/td&gt;
         &lt;td&gt;
            March 8-9&lt;/td&gt;
         &lt;td&gt;
            Quite a variety of topics and speakers at this event. I will be giving a keynote and
            will talk about effective Java.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.ciol.com/SparkIT/2010" target="_blank"&gt;&lt;img src="content/binary/spark_Logo.jpg" border="0" height="73" width="154"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Bangalore&lt;/td&gt;
         &lt;td&gt;
            March 18-19&lt;/td&gt;
         &lt;td&gt;
            Covers quite a variety of topics across language and framework boundaries. My topics
            include Java, Groovy, .NET, and Javascript.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.phillyemergingtech.com" target="_blank"&gt;&lt;img src="content/binary/logo_ete.png" border="0" height="30" width="156"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Philadelphia&lt;/td&gt;
         &lt;td&gt;
            April 8-9&lt;/td&gt;
         &lt;td&gt;
            I am really looking forward to this conference so I can meet some of the people I've
            been wanting to meet for a while. My topic is related to DSL in Groovy.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.gr8conf.org" target="_blank"&gt;&lt;img src="content/binary/gr8.jpg" border="0" height="57" width="169"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Minneapolis&lt;/td&gt;
         &lt;td&gt;
            April 16&lt;/td&gt;
         &lt;td&gt;
            Centered around technologies, tools, and frameworks related to Groovy, this one day
            conference will bring some of the key people in the Groovy community together. I will
            be giving the kick-off talk at this event and a few Groovy related sessions.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.developersummit.com" target="_blank"&gt;&lt;img src="content/binary/GIDS_Logo.jpg" border="0" height="49" width="162"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Bangalore&lt;/td&gt;
         &lt;td&gt;
            April 20-23&lt;/td&gt;
         &lt;td&gt;
            This would be my third year at this conference. It is organized really well and one
            of the best polyglot conferences in India. I will be giving a keynote and speaking
            on F#, Java, Scala, Groovy, Functional Programming, and agile practices.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.iasahome.org/web/itarc/denver2010" target="_blank"&gt;&lt;img src="content/binary/iasa.jpg" border="0" height="48" width="162"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Denver&lt;/td&gt;
         &lt;td&gt;
            May 6&lt;/td&gt;
         &lt;td&gt;
            This is a conference focused on Architecture. This is the first time I will be at
            this conference and looking forward to learning from others at the event. My talk
            most likely will be "Tell me about your Architecture, I will tell you about your Organization."&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://uberconf.com" target="_blank"&gt;&lt;img src="content/binary/UberConf_125x125_speaking.png" border="0" height="92" width="125"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Denver&lt;/td&gt;
         &lt;td&gt;
            June 14-17&lt;/td&gt;
         &lt;td&gt;
            Summer in Denver this year is going to be hotter than usual with Über Conf coming
            to town. This conference will offer an eclectic mixture of languages on the JVM and
            practical agility. The speaker round up looks awesome and the conference price includes
            a number of interesting workshops. Can't wait for this one.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="4"&gt;
            &lt;hr&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.houstontechfest.com" target="_blank"&gt;&lt;img src="content/binary/houstontechfest.jpg" border="0" height="56" width="174"&gt;&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Houston&lt;/td&gt;
         &lt;td&gt;
            October 9&lt;/td&gt;
         &lt;td&gt;
            I could not make it to this event in the past few years, but I have promised to speak
            there this year. This is another good polyglot event with several great speakers and
            good participation from the attendees.&lt;br&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
   &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;b&gt;User Groups:&lt;/b&gt; 
&lt;table&gt;
   &lt;tbody&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://javamug.org/mainpages/2010Meetings.html#Jan"&gt;Java Metroplex User Group&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Testing with Groovy&lt;/td&gt;
         &lt;td&gt;
            Jan. 13&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://www.memphisjug.org"&gt;Memphis Java User Group&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            How to approach refactoring&lt;/td&gt;
         &lt;td&gt;
            Feb. 18&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;
            &lt;a href="http://groups.google.com/group/boston-scala"&gt;Boston Area Scala Enthusiasts&lt;/a&gt;&lt;/td&gt;
         &lt;td&gt;
            Scala Idioms and Design Patterns&lt;/td&gt;
         &lt;td&gt;
            March 4&lt;/td&gt;
      &lt;/tr&gt;
   &lt;/tbody&gt;
&lt;/table&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=284e8162-936b-4f67-86b9-f8e3c91a02c7"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=284e8162-936b-4f67-86b9-f8e3c91a02c7</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      As more programmers are getting excited about test driven development (TDD), one concern
      I am<br />
      hearing more these days is "my tests and mocks make it hard to refactor code." 
   </p>
        <p>
      Remember we took a while to learn how to write better code. Similarly we will take
      a while to learn<br />
      how to write better unit tests. 
   </p>
        <p>
      I want to talk about unit testing and mocking here with an example that was brought
      up yesterday at 
      <br />
      the (<a href="http://sdtconf.com" target="_blank">#sdtconf</a>). A fine gentleman <a href="http://twitter.com/zdsbs/statuses/4775202736" target="_blank">Zachary
      Shaw</a> lead an open space discussion on the <a href="http://en.wikipedia.org/wiki/Hollywood_Principle" target="_blank">Hollywood
      Principle</a><br />
      and mocking. A number of very bright programmers who're very passionate about TDD
      were in the session. 
   </p>
        <p>
      When talking about the principles, etc. Zack demanded a concrete example. We tossed
      around a few examples<br />
      and I mentioned my friend <a href="http://twitter.com/bokmann" target="_blank">David
      Bock's</a><a href="//http://www.ccs.neu.edu/research/demeter/demeter-method/LawOfDemeter/paper-boy/" target="_blank">Paper
      Boy example</a>. Taking that example and tweaking it to our 
      <br />
      discussion and desires (as we programmers often do), we ended up with something like
      this: 
   </p>
        <pre>public class PaperBoy {<br />
   public void collectPayments(List<customer>
      customers) {<br />
      for(Customer customer : customers) {<br />
      customer.getPayment(this, 200);<br />
      }<br />
      }<br />
      //...<br /></customer></pre>
        <p>
      David, in his example, does not suggest that getPayment() accept an instance of PaperBoy,
      the example in our 
      <br />
      discussion deviated from his example rather quickly. 
   </p>
        <p>
      Now, how would the getPayment() method of the Customer look like? 
   </p>
        <pre>public class Customer {<br />
   public void getPayment(PaperBoy paperBoy, int amount) {<br />
   if (hasNoMoney || doesNotCareToPay)<br />
   paperBoy.stiff(this);<br />
   else {<br />
   deductMoney(amount);<br />
   paperBoy.acceptPayment(this, amount);<br />
   }<br />
   }<br />
   //...<br /></pre>
        <p>
      It was suggested in the discussion that, in getPayment() method, the customer may
      decide to pay or based on some<br />
      condition may decide to stiff the paperboy. 
   </p>
        <p>
      So, how do we unit test this getPayment() method? Most of us readily agreed that we
      should mock-out (or stub out 
      <br />
      or spy out, it does not matter for our discussion here) the PaperBoy. That will help
      us run the unit test on the 
      <br />
      getPayment() method by isolating the PaperBoy. 
   </p>
        <p>
      Not so fast. Yes, if the getPayment() method has to be written like above, then mocking
      out PaperBoy may be one 
      <br />
      way to unit test it. However, there are at least three problem (that I can think of
      at the moment) with the above code. 
   </p>
        <p>
      Problem 1. The above code has some unnecessary coupling and bi-directional relationship.
      The Customer depends 
      <br />
      on PaperBoy. That is a coupling that I would seriously question. 
   </p>
        <p>
      Problem 2. The unit test is now made to do more. It has to create a mock of the PaperBoy.
      Even if you tell me it is not 
      <br />
      much code, a single line of code that is not absolutely needed is a lot of code IMHO.
      You don't have to maintain code 
      <br />
      that you do not write. 
   </p>
        <p>
      Problem 3. Are you really stiffing the PaperBoy? Who decides that? Can a paperboy
      decide that under very hard economic 
      <br />
      conditions, a loyal customer may be deserves a break? I have no problem the customer
      deciding to pay or not, but if that is 
      <br />
      stiffing or not is for the paperboy to decide IMO. 
   </p>
        <p>
      So, yes, you can certainly consider writing mocks for the PaperBoy, but I would not.
      Mocking is a tool I would use as the 
      <br />
      last resort when unit testing. 
   </p>
        <p>
      How would I approach the above getPayment() method? Let's take a look: 
   </p>
        <pre>public class Customer<br />
   {<br />
   public int getPayment(int amount) {<br />
   if (hasNoMoney || doesNotCareToPay)<br />
   return 0;<br />
   else {<br />
   deductMoney(amount);<br />
   return amount;<br />
   }<br />
   }<br />
   //...<br /></pre>
        <p>
      Here the payment method does not depend on the PaperBoy. (If necessary you can pass
      information on what the payment is<br />
      for—paper, magazine, lawn moving, ...). The customer focuses on his/her own logic,
      whether to pay or not. 
   </p>
        <p>
      Now, how would the PaperBoy's collectPayment look like? 
   </p>
        <pre>public class PaperBoy {<br />
   public void collectPayments(List<customer>
      customers) {<br />
      for(Customer customer : customers) {<br />
      int payment = customer.getPayment(200);<br /><strike>if (payment == 0)</strike><br /></customer>
   if (payment &gt; 0)<br /><customer>
       acceptPayment(customer, payment);<br />
      else<br />
      stiff(customer);<br />
      }<br />
      }<br />
      //...<br /></customer></pre>
        <p>
      Our paperboy thinks that if payment has not been received, he's been stiffed. He could
      change his view at anytime without<br />
      affecting the customer class. The paperboy is a bit more complex now, but that decision
      as to whether he's been stiffed or not<br />
      belongs to him, not the customer. 
   </p>
        <p>
      Now, how would we unit test the getPayment() method of the Customer. That's not a
      big deal. No mocking is needed. Simply<br />
      run your test on your customer instance. 
   </p>
        <p>
      If you think returning 0 for payment amount is not clear enough, you can return a
      Payment object with more details contained<br />
      in it like Cash, CreditCard, BrokeCantPay, DontFeelLikePaying, etc. as the type of
      payment. It can then include additional details<br />
      like credit card number, etc. or you can even extend the payment information object.
      That can be used for any payment, not just 
      <br />
      payment for paper. The decoupling also makes the code more extensible. 
   </p>
        <p>
      So, when would I use a mock or a stub? I would first try to remove or reduce dependency
      as much as I can. After a serious effort 
      <br />
      to do that, then for those dependencies that are still left I would do one of the
      following: 
   </p>
        <p>
      A. Separate the business logic in my code from the object it collaborates with. That
      way, I can run unit test on the logic. Depending 
      <br />
      on the situation, I am quite content with integration testing the code that collaborate
      and unit test the code that does the important 
      <br />
      logic. I do not think 100% of the code needs to be unit tested. I do think that 100%
      of the code should be exercised. So, if I can get 
      <br />
      coverage of the code that does business logic through unit test and coverage of the
      code that collaborates, with the object it depends 
      <br />
      on, through integration tests, I'm quite happy assuming it gives me a reasonable (not
      necessarily instantaneous) feedback loop. 
   </p>
        <p>
      B. If that separation is hard or if I think I need to really get a quick feedback
      on the code while testing the collaboration not just logic,<br />
      then and only then will I consider writing a mock. In short, I use mock as the last
      option when I do TDD. I will first try to knock it out.<br />
      Only if I really can't I will try to mock it out. <b><i><emph>
         First try to knockout before you consider to mock-out.
      </emph></i></b></p>
        <img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=8b6d0c24-1b69-4df2-9ddd-de86c3556688" />
      </body>
      <title>Try to knockout before you consider to mock-out</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</link>
      <pubDate>Sun, 11 Oct 2009 11:53:39 GMT</pubDate>
      <description>&lt;p&gt;
   As more programmers are getting excited about test driven development (TDD), one concern
   I am&lt;br&gt;
   hearing more these days is "my tests and mocks make it hard to refactor code." 
&lt;/p&gt;
&lt;p&gt;
   Remember we took a while to learn how to write better code. Similarly we will take
   a while to learn&lt;br&gt;
   how to write better unit tests. 
&lt;/p&gt;
&lt;p&gt;
   I want to talk about unit testing and mocking here with an example that was brought
   up yesterday at 
   &lt;br&gt;
   the (&lt;a href="http://sdtconf.com" target="_blank"&gt;#sdtconf&lt;/a&gt;). A fine gentleman &lt;a href="http://twitter.com/zdsbs/statuses/4775202736" target="_blank"&gt;Zachary
   Shaw&lt;/a&gt; lead an open space discussion on the &lt;a href="http://en.wikipedia.org/wiki/Hollywood_Principle" target="_blank"&gt;Hollywood
   Principle&lt;/a&gt; 
   &lt;br&gt;
   and mocking. A number of very bright programmers who're very passionate about TDD
   were in the session. 
&lt;/p&gt;
&lt;p&gt;
   When talking about the principles, etc. Zack demanded a concrete example. We tossed
   around a few examples&lt;br&gt;
   and I mentioned my friend &lt;a href="http://twitter.com/bokmann" target="_blank"&gt;David
   Bock's&lt;/a&gt; &lt;a href="//http://www.ccs.neu.edu/research/demeter/demeter-method/LawOfDemeter/paper-boy/" target="_blank"&gt;Paper
   Boy example&lt;/a&gt;. Taking that example and tweaking it to our 
   &lt;br&gt;
   discussion and desires (as we programmers often do), we ended up with something like
   this: 
&lt;/p&gt;
&lt;pre&gt;public class PaperBoy {&lt;br&gt;
public void collectPayments(List&lt;customer&gt;
   customers) {&lt;br&gt;
   for(Customer customer : customers) {&lt;br&gt;
   customer.getPayment(this, 200);&lt;br&gt;
   }&lt;br&gt;
   }&lt;br&gt;
   //...&lt;br&gt;
&lt;/customer&gt;
&lt;/pre&gt;
&lt;p&gt;
   David, in his example, does not suggest that getPayment() accept an instance of PaperBoy,
   the example in our 
   &lt;br&gt;
   discussion deviated from his example rather quickly. 
&lt;/p&gt;
&lt;p&gt;
   Now, how would the getPayment() method of the Customer look like? 
&lt;/p&gt;
&lt;pre&gt;public class Customer {&lt;br&gt;
public void getPayment(PaperBoy paperBoy, int amount) {&lt;br&gt;
if (hasNoMoney || doesNotCareToPay)&lt;br&gt;
paperBoy.stiff(this);&lt;br&gt;
else {&lt;br&gt;
deductMoney(amount);&lt;br&gt;
paperBoy.acceptPayment(this, amount);&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
//...&lt;br&gt;
&lt;/pre&gt;
&lt;p&gt;
   It was suggested in the discussion that, in getPayment() method, the customer may
   decide to pay or based on some&lt;br&gt;
   condition may decide to stiff the paperboy. 
&lt;/p&gt;
&lt;p&gt;
   So, how do we unit test this getPayment() method? Most of us readily agreed that we
   should mock-out (or stub out 
   &lt;br&gt;
   or spy out, it does not matter for our discussion here) the PaperBoy. That will help
   us run the unit test on the 
   &lt;br&gt;
   getPayment() method by isolating the PaperBoy. 
&lt;/p&gt;
&lt;p&gt;
   Not so fast. Yes, if the getPayment() method has to be written like above, then mocking
   out PaperBoy may be one 
   &lt;br&gt;
   way to unit test it. However, there are at least three problem (that I can think of
   at the moment) with the above code. 
&lt;/p&gt;
&lt;p&gt;
   Problem 1. The above code has some unnecessary coupling and bi-directional relationship.
   The Customer depends 
   &lt;br&gt;
   on PaperBoy. That is a coupling that I would seriously question. 
&lt;/p&gt;
&lt;p&gt;
   Problem 2. The unit test is now made to do more. It has to create a mock of the PaperBoy.
   Even if you tell me it is not 
   &lt;br&gt;
   much code, a single line of code that is not absolutely needed is a lot of code IMHO.
   You don't have to maintain code 
   &lt;br&gt;
   that you do not write. 
&lt;/p&gt;
&lt;p&gt;
   Problem 3. Are you really stiffing the PaperBoy? Who decides that? Can a paperboy
   decide that under very hard economic 
   &lt;br&gt;
   conditions, a loyal customer may be deserves a break? I have no problem the customer
   deciding to pay or not, but if that is 
   &lt;br&gt;
   stiffing or not is for the paperboy to decide IMO. 
&lt;/p&gt;
&lt;p&gt;
   So, yes, you can certainly consider writing mocks for the PaperBoy, but I would not.
   Mocking is a tool I would use as the 
   &lt;br&gt;
   last resort when unit testing. 
&lt;/p&gt;
&lt;p&gt;
   How would I approach the above getPayment() method? Let's take a look: 
&lt;/p&gt;
&lt;pre&gt;public class Customer&lt;br&gt;
{&lt;br&gt;
public int getPayment(int amount) {&lt;br&gt;
if (hasNoMoney || doesNotCareToPay)&lt;br&gt;
return 0;&lt;br&gt;
else {&lt;br&gt;
deductMoney(amount);&lt;br&gt;
return amount;&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
//...&lt;br&gt;
&lt;/pre&gt;
&lt;p&gt;
   Here the payment method does not depend on the PaperBoy. (If necessary you can pass
   information on what the payment is&lt;br&gt;
   for—paper, magazine, lawn moving, ...). The customer focuses on his/her own logic,
   whether to pay or not. 
&lt;/p&gt;
&lt;p&gt;
   Now, how would the PaperBoy's collectPayment look like? 
&lt;/p&gt;
&lt;pre&gt;public class PaperBoy {&lt;br&gt;
public void collectPayments(List&lt;customer&gt;
   customers) {&lt;br&gt;
   for(Customer customer : customers) {&lt;br&gt;
   int payment = customer.getPayment(200);&lt;br&gt;
   &lt;strike&gt;if (payment == 0)&lt;/strike&gt;
   &lt;br&gt;
&lt;/customer&gt;
if (payment &amp;gt; 0)&lt;br&gt;
&lt;customer&gt;
   &amp;nbsp;acceptPayment(customer, payment);&lt;br&gt;
   else&lt;br&gt;
   stiff(customer);&lt;br&gt;
   }&lt;br&gt;
   }&lt;br&gt;
   //...&lt;br&gt;
&lt;/customer&gt;
&lt;/pre&gt;
&lt;p&gt;
   Our paperboy thinks that if payment has not been received, he's been stiffed. He could
   change his view at anytime without&lt;br&gt;
   affecting the customer class. The paperboy is a bit more complex now, but that decision
   as to whether he's been stiffed or not&lt;br&gt;
   belongs to him, not the customer. 
&lt;/p&gt;
&lt;p&gt;
   Now, how would we unit test the getPayment() method of the Customer. That's not a
   big deal. No mocking is needed. Simply&lt;br&gt;
   run your test on your customer instance. 
&lt;/p&gt;
&lt;p&gt;
   If you think returning 0 for payment amount is not clear enough, you can return a
   Payment object with more details contained&lt;br&gt;
   in it like Cash, CreditCard, BrokeCantPay, DontFeelLikePaying, etc. as the type of
   payment. It can then include additional details&lt;br&gt;
   like credit card number, etc. or you can even extend the payment information object.
   That can be used for any payment, not just 
   &lt;br&gt;
   payment for paper. The decoupling also makes the code more extensible. 
&lt;/p&gt;
&lt;p&gt;
   So, when would I use a mock or a stub? I would first try to remove or reduce dependency
   as much as I can. After a serious effort 
   &lt;br&gt;
   to do that, then for those dependencies that are still left I would do one of the
   following: 
&lt;/p&gt;
&lt;p&gt;
   A. Separate the business logic in my code from the object it collaborates with. That
   way, I can run unit test on the logic. Depending 
   &lt;br&gt;
   on the situation, I am quite content with integration testing the code that collaborate
   and unit test the code that does the important 
   &lt;br&gt;
   logic. I do not think 100% of the code needs to be unit tested. I do think that 100%
   of the code should be exercised. So, if I can get 
   &lt;br&gt;
   coverage of the code that does business logic through unit test and coverage of the
   code that collaborates, with the object it depends 
   &lt;br&gt;
   on, through integration tests, I'm quite happy assuming it gives me a reasonable (not
   necessarily instantaneous) feedback loop. 
&lt;/p&gt;
&lt;p&gt;
   B. If that separation is hard or if I think I need to really get a quick feedback
   on the code while testing the collaboration not just logic,&lt;br&gt;
   then and only then will I consider writing a mock. In short, I use mock as the last
   option when I do TDD. I will first try to knock it out.&lt;br&gt;
   Only if I really can't I will try to mock it out. &lt;b&gt;&lt;i&gt;
   &lt;emph&gt;
      First try to knockout before you consider to mock-out.
   &lt;/emph&gt;
   &lt;/i&gt;&lt;/b&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=8b6d0c24-1b69-4df2-9ddd-de86c3556688"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=8b6d0c24-1b69-4df2-9ddd-de86c3556688</comments>
      <category>Software Practices</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I often get asked "Which web development
   framework should I use?" The answer generally depends on when I'm asked that question.
   Over the years I have played with, offered courses in, and written production code
   using various frameworks in the .NET space, the Java/Groovy space, and on Rails. My
   answer varies over time as, thankfully, different frameworks emerge and current frameworks
   evolve. 
   <p>
      The tools and techniques for developing web applications on the .NET platform has
      come a long way. There was a time it was leading, then there was a time when it had
      to catch up. If you are developing web application on the .NET platform using Microsoft
      tools (as many developers do), I can't imagine today not relying on the MVC pattern
      and the capabilities of ASP.NET MVC Web Application Development framework.
   </p><p>
      The recently released <a href="http://www.amazon.com/ASP-NET-MVC-Action-Jeffrey-Palermo/dp/1933988622" target="_blank">"ASP.NET
      MVC In Action"</a> from Manning by Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard
      is a great way to deep dive into it. 
   </p><p>
      The book is written for developers with practical knowledge of web development with
      ASP.NET. The authors get right into showing us how we will benefit from ASP.NET MVC
      and without wasting our time. 
   </p><p>
      One of my favorites in the book is the emphasis on automated testing from the get-go. 
   </p><p>
      The book does a good job of not only showing you what to do, but also provides cautionary
      words to avoid poor practices that may lead to maintenance issues on non-trivial applications.
      You'll learn how to organize and manage large applications, and also to what extent
      you can use your current ASP.NET skills and knowledge in ASP.NET MVC. 
   </p><p>
      I feel that the discussion of MonoRail and Rails, taking one chapter, was a bit too
      much than I cared for. However, the authors do provide an objective comparison to
      ASP.NET MVC in the end of this chapter. 
   </p><p>
      Overall, the book is a good read and well written. It certainly assumes you are familiar
      with web development and ASP.NET. If you have that background, it should be a breeze
      to get through the concept that will help you take good advantage of ASP.NET MVC. 
   </p><p>
      Disclaimer: As I was reading the book, I was quite surprised to find that Ben had
      mentioned my name. Please do not hold it against him. :) It had no influence on my
      comments above.
   </p><img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=0c319246-1cfe-47a4-9c4e-30880ede88fa" /></body>
      <title>ASP.NET MVC In Action</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</link>
      <pubDate>Sun, 20 Sep 2009 04:48:01 GMT</pubDate>
      <description>I often get asked "Which web development framework should I use?"
The answer generally depends on when I'm asked that question.
Over the years I have played with, offered courses in, and written
production code using various frameworks in the .NET space, the Java/Groovy space, and on Rails. My answer varies over time as, 
thankfully, different frameworks emerge and current frameworks evolve.

&lt;p&gt;
   The tools and techniques for developing web applications on the .NET platform has
   come a long way. There was a time it was leading, then there was a time when it had
   to catch up. If you are developing web application on the .NET platform using Microsoft
   tools (as many developers do), I can't imagine today not relying on the MVC pattern
   and the capabilities of ASP.NET MVC Web Application Development framework.
&lt;/p&gt;
&lt;p&gt;
   The recently released &lt;a href="http://www.amazon.com/ASP-NET-MVC-Action-Jeffrey-Palermo/dp/1933988622" target="_blank"&gt;"ASP.NET
   MVC In Action"&lt;/a&gt; from Manning by Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard
   is a great way to deep dive into it. 
&lt;/p&gt;
&lt;p&gt;
   The book is written for developers with practical knowledge of web development with
   ASP.NET. The authors get right into showing us how we will benefit from ASP.NET MVC
   and without wasting our time. 
&lt;/p&gt;
&lt;p&gt;
   One of my favorites in the book is the emphasis on automated testing from the get-go. 
&lt;/p&gt;
&lt;p&gt;
   The book does a good job of not only showing you what to do, but also provides cautionary
   words to avoid poor practices that may lead to maintenance issues on non-trivial applications.
   You'll learn how to organize and manage large applications, and also to what extent
   you can use your current ASP.NET skills and knowledge in ASP.NET MVC. 
&lt;/p&gt;
&lt;p&gt;
   I feel that the discussion of MonoRail and Rails, taking one chapter, was a bit too
   much than I cared for. However, the authors do provide an objective comparison to
   ASP.NET MVC in the end of this chapter. 
&lt;/p&gt;
&lt;p&gt;
   Overall, the book is a good read and well written. It certainly assumes you are familiar
   with web development and ASP.NET. If you have that background, it should be a breeze
   to get through the concept that will help you take good advantage of ASP.NET MVC. 
&lt;/p&gt;
&lt;p&gt;
   Disclaimer: As I was reading the book, I was quite surprised to find that Ben had
   mentioned my name. Please do not hold it against him. :) It had no influence on my
   comments above.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=0c319246-1cfe-47a4-9c4e-30880ede88fa"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=0c319246-1cfe-47a4-9c4e-30880ede88fa</comments>
      <category>.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</wfw:commentRss>
      <slash:comments>0</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I'm excited about the 2GX conference coming
   up in New Orleans October 19th to 22nd.<br />
   If you're interested in attending, the early bird registration ends Friday September
   18th.<br />
   There is a $75 discount if you use promotion code SPRINGONE2GX75.<br /><br />
   The conference is all about Next Generation Java (<a href="http://www.springone2gx.com" target="_blank">http://www.springone2gx.com</a>).<br />
   It is two great events in one—SpringOne and 2GX—running concurrently with eight<br />
   tracks and over 100 sessions.<br /><br />
   I am looking forward to speak there and, more so, to meet and listen to some of the
   leaders<br />
   and practitioners in the industry.<br /><img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=e19d2f37-71e0-4d19-be83-b2590f028c9f" /></body>
      <title>Speaking at SpringOne 2GX 2009</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</link>
      <pubDate>Tue, 15 Sep 2009 12:03:59 GMT</pubDate>
      <description>I'm excited about the 2GX conference coming up in New Orleans October 19th to 22nd.&lt;br&gt;
If you're interested in attending, the early bird registration ends Friday September
18th.&lt;br&gt;
There is a $75 discount if you use promotion code SPRINGONE2GX75.&lt;br&gt;
&lt;br&gt;
The conference is all about Next Generation Java (&lt;a href="http://www.springone2gx.com" target="_blank"&gt;http://www.springone2gx.com&lt;/a&gt;).&lt;br&gt;
It is two great events in one—SpringOne and 2GX—running concurrently with eight&lt;br&gt;
tracks and over 100 sessions.&lt;br&gt;
&lt;br&gt;
I am looking forward to speak there and, more so, to meet and listen to some of the
leaders&lt;br&gt;
and practitioners in the industry.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=e19d2f37-71e0-4d19-be83-b2590f028c9f"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=e19d2f37-71e0-4d19-be83-b2590f028c9f</comments>
      <category>Groovy</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I recently had the pleasure of chatting
   with Scott Davis during an <a href="http://www.nofluffjuststuff.com" target="_blank">NFJS</a> stop<br />
   in Phoenix. At the start of the interview, Scott surprised me with the question<br />
   "Does Groovy know that you are seeing other languages?" You can listen to<br />
   the full interview at <a href="http://blip.tv/file/2484840" target="_blank">http://blip.tv/file/2484840</a>.<img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=514ff099-a99c-4ee2-8faf-7d04abf31d59" /></body>
      <title>Chat with Scott Davis on Scala and Groovy</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</link>
      <pubDate>Tue, 18 Aug 2009 15:09:18 GMT</pubDate>
      <description>I recently had the pleasure of chatting with Scott Davis during an &lt;a href="http://www.nofluffjuststuff.com" target="_blank"&gt;NFJS&lt;/a&gt; stop&lt;br&gt;
in Phoenix. At the start of the interview, Scott surprised me with the question&lt;br&gt;
"Does Groovy know that you are seeing other languages?" You can listen to&lt;br&gt;
the full interview at &lt;a href="http://blip.tv/file/2484840" target="_blank"&gt;http://blip.tv/file/2484840&lt;/a&gt;.&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=514ff099-a99c-4ee2-8faf-7d04abf31d59"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=514ff099-a99c-4ee2-8faf-7d04abf31d59</comments>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I'm sure you've seen your share of long methods—methods that run several hundred lines.<br />
      Some of us may have even written them, probably in those days before we gained our<br />
      wisdom to write better quality code. 
   </p>
        <p>
      Long methods are evil on several grounds: 
   </p>
        <ul>
          <li>
         They're hard to understand</li>
          <li>
         They're hard to change</li>
          <li>
         They're hard to reuse</li>
          <li>
         They're hard to test</li>
          <li>
         They have low cohesion</li>
          <li>
         They may have high coupling</li>
          <li>
         They ten to be overly complex</li>
        </ul>
        <p>
        </p>
        <p>
      Often programmers ask, how "long" is a long method? A method is too long if 
   </p>
        <ul>
          <li>
         you have to scroll down to look at the complete method</li>
          <li>
         it takes several minutes to understand</li>
          <li>
         you can't easily write an automated test for it</li>
          <li>
         you can't state the one prominent purpose for the method</li>
        </ul>
        <p>
        </p>
        <p>
      One easy way to address long methods is to use the so called <a href="http://c2.com/ppr/wiki/WikiPagesAboutRefactoring/ComposedMethod.html" target="_blank">Compose
      Method Pattern.</a><br />
      Your methods then focuses on doing one thing and invokes other methods, all of which<br />
      are at the same level of abstraction. The result is shorter, easier to understand
      methods<br />
      in your application. 
   </p>
        <p>
      You say, "OK, I get it, but what about my colleague who has a compulsive disorder
      to 
      <br />
      write very long methods, how do I convince that colleague?" 
   </p>
        <p>
      So you have tried to state the benefits, showed examples, and your colleague still
      does not get it.<br />
      OK, I can suggest one final drastic measure. 
   </p>
        <p>
      On a Monday morning, when you go to work, your colleague asks how your weekend was.<br />
      You could say, "It was good, I took the kids to the movie on Saturday and went to
      the park<br />
      on Sunday." That would be like using compose method pattern. You have stated your
      activities<br />
      at one level of abstraction. If your colleague is interested in more details about
      the movie or the 
      <br />
      park, he or she can drill down into the details further asking you how the movie was,
      and so on. 
   </p>
        <p>
      But, do not reply to that question that way. Instead say, "Over the weekend I got
      into my car, started it,<br />
      drove 5 miles West, took a right turn, then a left turn, then drove another 10 miles,
      ..." Go at it for 
      <br />
      several minutes until your colleague gets frustrated and interrupts you with "What's
      wrong with you."<br />
      Now simply reply, "oh, I though I'll tell you how my weekend way like you write your
      methods." 
   </p>
        <img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=8a745e85-2a34-4d9c-8c25-ca371530e281" />
      </body>
      <title>How to convince your fellow developer to write short methods?</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</link>
      <pubDate>Mon, 18 May 2009 19:50:57 GMT</pubDate>
      <description>&lt;p&gt;
   I'm sure you've seen your share of long methods—methods that run several hundred lines.&lt;br&gt;
   Some of us may have even written them, probably in those days before we gained our&lt;br&gt;
   wisdom to write better quality code. 
&lt;/p&gt;
&lt;p&gt;
   Long methods are evil on several grounds: 
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      They're hard to understand&lt;/li&gt;
   &lt;li&gt;
      They're hard to change&lt;/li&gt;
   &lt;li&gt;
      They're hard to reuse&lt;/li&gt;
   &lt;li&gt;
      They're hard to test&lt;/li&gt;
   &lt;li&gt;
      They have low cohesion&lt;/li&gt;
   &lt;li&gt;
      They may have high coupling&lt;/li&gt;
   &lt;li&gt;
      They ten to be overly complex&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
   Often programmers ask, how "long" is a long method? A method is too long if 
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      you have to scroll down to look at the complete method&lt;/li&gt;
   &lt;li&gt;
      it takes several minutes to understand&lt;/li&gt;
   &lt;li&gt;
      you can't easily write an automated test for it&lt;/li&gt;
   &lt;li&gt;
      you can't state the one prominent purpose for the method&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
   One easy way to address long methods is to use the so called &lt;a href="http://c2.com/ppr/wiki/WikiPagesAboutRefactoring/ComposedMethod.html" target="_blank"&gt;Compose
   Method Pattern.&lt;/a&gt;
   &lt;br&gt;
   Your methods then focuses on doing one thing and invokes other methods, all of which&lt;br&gt;
   are at the same level of abstraction. The result is shorter, easier to understand
   methods&lt;br&gt;
   in your application. 
&lt;/p&gt;
&lt;p&gt;
   You say, "OK, I get it, but what about my colleague who has a compulsive disorder
   to 
   &lt;br&gt;
   write very long methods, how do I convince that colleague?" 
&lt;/p&gt;
&lt;p&gt;
   So you have tried to state the benefits, showed examples, and your colleague still
   does not get it.&lt;br&gt;
   OK, I can suggest one final drastic measure. 
&lt;/p&gt;
&lt;p&gt;
   On a Monday morning, when you go to work, your colleague asks how your weekend was.&lt;br&gt;
   You could say, "It was good, I took the kids to the movie on Saturday and went to
   the park&lt;br&gt;
   on Sunday." That would be like using compose method pattern. You have stated your
   activities&lt;br&gt;
   at one level of abstraction. If your colleague is interested in more details about
   the movie or the 
   &lt;br&gt;
   park, he or she can drill down into the details further asking you how the movie was,
   and so on. 
&lt;/p&gt;
&lt;p&gt;
   But, do not reply to that question that way. Instead say, "Over the weekend I got
   into my car, started it,&lt;br&gt;
   drove 5 miles West, took a right turn, then a left turn, then drove another 10 miles,
   ..." Go at it for 
   &lt;br&gt;
   several minutes until your colleague gets frustrated and interrupts you with "What's
   wrong with you."&lt;br&gt;
   Now simply reply, "oh, I though I'll tell you how my weekend way like you write your
   methods." 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=8a745e85-2a34-4d9c-8c25-ca371530e281"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281</comments>
      <category>Applications</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <table>
          <tbody>
            <tr>
              <td>
               I'm delighted to announce the Beta Release of the <a href="http://pragprog.com/titles/vsscala" target="_blank">Programming
               Scala</a> book. 
               <br />
               The topics covered in the book are: 
               <ul><li>
                     Introduction</li><li>
                     Getting Started</li><li>
                     Getting up to speed in Scala <i>excerpt</i></li><li>
                     Classes in Scala</li><li>
                     Sensible Typing <i>excerpt</i></li><li>
                     Function Values and Closures</li><li>
                     Traits and Type Conversions <i>excerpt</i></li><li>
                     Using Collections</li><li>
                     Pattern Matching and Regular Expressions</li><li>
                     Concurrent Programming</li><li>
                     Intermixing with Java</li><li>
                     Unit Testing With Scala</li><li>
                     Exception Handling</li><li>
                     Using Scala</li><li>
                     Web Resources</li></ul>
               The Beta release includes the first seven chapters. To download the excerpts from
               the book or for more information, please visit the <a href="http://pragprog.com/titles/vsscala" target="_blank">book
               web page at The Pragmatic Programmers</a>. I want to thank each and everyone who contributed
               into the making of this book, <a href="http://dimsumthinking.com" target="_blank">Dan
               Steinberg</a>, in particular, for editing this book, and the <a href="http://www.pragprog.com" target="_blank">Pragmatic
               Programmers</a> for publishing it. 
            </td>
              <td>
                <a href="http://pragprog.com/titles/vsscala" target="_blank">
                  <img src="http://assets0.pragprog.com/images/covers/190x228/betas/vsscala.jpg?1236205317" />
                </a>
              </td>
            </tr>
          </tbody>
        </table>
        <img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=462d366e-209e-4c5b-a04a-e3b7749cf1f5" />
      </body>
      <title>Programming Scala Beta Release</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</link>
      <pubDate>Sat, 04 Apr 2009 18:01:14 GMT</pubDate>
      <description>&lt;table&gt;
   &lt;tbody&gt;
      &lt;tr&gt;
         &lt;td&gt;
            I'm delighted to announce the Beta Release of the &lt;a href="http://pragprog.com/titles/vsscala" target="_blank"&gt;Programming
            Scala&lt;/a&gt; book. 
            &lt;br&gt;
            The topics covered in the book are: 
            &lt;ul&gt;
               &lt;li&gt;
                  Introduction&lt;/li&gt;
               &lt;li&gt;
                  Getting Started&lt;/li&gt;
               &lt;li&gt;
                  Getting up to speed in Scala &lt;i&gt;excerpt&lt;/i&gt;
               &lt;/li&gt;
               &lt;li&gt;
                  Classes in Scala&lt;/li&gt;
               &lt;li&gt;
                  Sensible Typing &lt;i&gt;excerpt&lt;/i&gt;
               &lt;/li&gt;
               &lt;li&gt;
                  Function Values and Closures&lt;/li&gt;
               &lt;li&gt;
                  Traits and Type Conversions &lt;i&gt;excerpt&lt;/i&gt;
               &lt;/li&gt;
               &lt;li&gt;
                  Using Collections&lt;/li&gt;
               &lt;li&gt;
                  Pattern Matching and Regular Expressions&lt;/li&gt;
               &lt;li&gt;
                  Concurrent Programming&lt;/li&gt;
               &lt;li&gt;
                  Intermixing with Java&lt;/li&gt;
               &lt;li&gt;
                  Unit Testing With Scala&lt;/li&gt;
               &lt;li&gt;
                  Exception Handling&lt;/li&gt;
               &lt;li&gt;
                  Using Scala&lt;/li&gt;
               &lt;li&gt;
                  Web Resources&lt;/li&gt;
            &lt;/ul&gt;
            The Beta release includes the first seven chapters. To download the excerpts from
            the book or for more information, please visit the &lt;a href="http://pragprog.com/titles/vsscala" target="_blank"&gt;book
            web page at The Pragmatic Programmers&lt;/a&gt;. I want to thank each and everyone who contributed
            into the making of this book, &lt;a href="http://dimsumthinking.com" target="_blank"&gt;Dan
            Steinberg&lt;/a&gt;, in particular, for editing this book, and the &lt;a href="http://www.pragprog.com" target="_blank"&gt;Pragmatic
            Programmers&lt;/a&gt; for publishing it. 
         &lt;/td&gt;
         &lt;td&gt;
            &lt;a href="http://pragprog.com/titles/vsscala" target="_blank"&gt; &lt;img src="http://assets0.pragprog.com/images/covers/190x228/betas/vsscala.jpg?1236205317"&gt;&lt;/a&gt; 
         &lt;/td&gt;
      &lt;/tr&gt;
   &lt;/tbody&gt;
&lt;/table&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=462d366e-209e-4c5b-a04a-e3b7749cf1f5"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=462d366e-209e-4c5b-a04a-e3b7749cf1f5</comments>
      <category>Java</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I am delighted that the <a href="http://www.nofluffjuststuff.com" target="_blank">NFJS
   2009 Tour starts next week!</a><br /><br /><a href="http://www.nofluffjuststuff.com" target="_blank"><img src="http://www.agiledeveloper.com/blog/content/binary/NFJS_125x125_spkr.jpg" border="0" /></a><br /><br />
   I will be in Milwaukee next weekend and several other cities though the year.<br />
   I can't wait to interact with the smart developers, attendees and speakers, at the<br />
   shows this year.<br /><img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=b054717e-d8d2-4b4b-8f67-14d64f3e9f97" /></body>
      <title>NFJS 2009 Tour Starts Next Week!</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</link>
      <pubDate>Thu, 19 Feb 2009 21:35:49 GMT</pubDate>
      <description>I am delighted that the &lt;a href="http://www.nofluffjuststuff.com" target="_blank"&gt;NFJS
2009 Tour starts next week!&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.nofluffjuststuff.com" target=_blank&gt;&lt;img src="http://www.agiledeveloper.com/blog/content/binary/NFJS_125x125_spkr.jpg" border="0"&gt;&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
I will be in Milwaukee next weekend and several other cities though the year.&lt;br&gt;
I can't wait to interact with the smart developers, attendees and speakers, at the&lt;br&gt;
shows this year.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=b054717e-d8d2-4b4b-8f67-14d64f3e9f97"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=b054717e-d8d2-4b4b-8f67-14d64f3e9f97</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">My son's teacher, Mr. A, has a great idea.
   He invites parents to spend a day in school in their kid's classroom.<br /><br />
   Since I travel so much (last year I travelled 41 weeks) any opportunity to spend time
   with my children is great. My wife suggested that I be the parent to spend a day at
   school. Of course, I kindly accepted. When the day arrived, my wife was nervous. I
   told her I will be myself, and she said "Exactly why I'm worried. Please be quiet."<br />
    <br />
   I attended University and have been teaching at the University for over 16 years and
   so I know what a classroom looks like at a University. However, I've never stepped
   into a school in this country. So, I had no idea what to expect.<br />
           <br />
   "May be Mr. A was pulling a version of 'I am not smarter than a 5th grader' on me,"
   I thought. (He did not, but in the end, that was my  conclusion, even though
   this was one level below the 5th grade).<br /><br />
   The morning started out with students jumping into solving a set of problems for about
   10 minutes. I think this helps to get the students settle down and focus. Mr. M was
   teaching the class this particular day and Mr. A participated in some activities through
   out the day, while attending to some other events that are in the works.<br />
                     
    <br />
   The class plan is very agile. There are three sets of students in the class. Those
   who are at an advance level (they are at a grade or two higher in select areas like
   Math, reading, writing, etc.). Then there are students who at the right level (some
   students at advance level in one area may be at the grade level in other areas). And
   then there are students not quite at the level where they need to be.<br /><br />
   If all of these children were grouped together at all time, the advanced  students
   would feel frustrated and the students catching up would feel overwhelmed. So, a few
   times during the day, the advanced students go to targeted sessions for their area.
   The students who need extra help go to spend time with some volunteers who assist
   them with further coaching. There is still good part of the day when the class spends
   time together.<br /><br />
   The time in class is divided into individual activities and group activities. The
   group activity gives a nice focus. It reminded me of an agile project with collaborative
   development. The kids who are advanced help mentor the other kids. The distracted
   kids are redirected by kids who are focused (I saw kids go through cycles of staying
   focused and being distracted, but the group overall was much more focused most of
   the time).<br /><br />
   One other observation I had (which I think I should do more in my classes) was they
   spend a few minutes on concepts and a lot of time on exercises. The exercises again
   are done in group and then individually as well.<br /><br />
   One thing that I really liked (but needs a lot of effort on the part of the teacher)
   was the variable pace of classwork. The students were working on writing organization.
   Again students were in three groups, ahead, in pace, and slow. The students ahead
   were given an additional exercise to work while the rest of the class was catching
   up. This additional work was a bit more challenging but the kids working on it seem
   to really enjoy it. The kids who are slow are given extra help and time.<br />
               <br />
   Several times during the day I got to evidence the sheer amount of creativity these
   kids have. For almost every problem they solved, students suggested different approaches.
   Some of the approaches surprised me as they were not intuitive or straightforward,
   but they sure were quite good.<br /><br />
   Since they were learning about probability, Mr. M used a spinner to select randomly
   who will answer certain questions. This was giving equal chance for students to participate
   in various activities and answer questions. In the process, the theory of probability
   was being reemphasized.<br /><br />
   I have to say teaching at the school level is a Herculean task. It is fun to work
   with these creative students on one hand, but it is so hard to mange these kids. Their
   attention span is so short and they do silly things all day long. It takes an enormous
   amount of patience (hint: I should never try to apply to teach at an elementary school).<br /><br />
   It so happened that my son gave a 10 minutes presentation on "How the Universe for
   Formed" as an independent study project. I wish I had helped him more on this project,
   but I think he did pretty well without it. Given this was the first time he gave a
   talk in front of people, he did really well. He did make some of the common mistakes
   people make when presenting, but he's learning quick. He identified things he did
   wrong and how he can improve. I have to admit, his first talk was much better than
   my first talk (I apologize to the poor victims of my first talk. No apologies to the
   current victims of my talks, that will have to wait for another blog!).<br /><br />
   What impressed me the most was the questions and answers that followed his presentation.
   As soon as they were given an opportunity to ask questions, they fired with great
   speed and impressive quality. Their questions were quite thought provoking. I said
   to myself, "How old are you kids, again?" The Q &amp; A went almost 10 minutes.<br /><br />
   Overall, I think it was a great opportunity for me to spend the time with my son in
   the class. I learned quite a bit about what it is to be a kid and what it is to be
   their teacher. I am thankful for this opportunity. I hope I will have the privilege
   of visiting and spending a day in class sometime in the future.<img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=3ac56439-566d-4d5b-9b4a-cc9a845323f6" /></body>
      <title>Career Day in Reverse</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</link>
      <pubDate>Tue, 10 Feb 2009 18:45:58 GMT</pubDate>
      <description>My son's teacher, Mr. A, has a great idea. He invites parents to spend a day in school in their kid's classroom.&lt;br&gt;
&lt;br&gt;
Since I travel so much (last year I travelled 41 weeks) any opportunity to spend time
with my children is great. My wife suggested that I be the parent to spend a day at
school. Of course, I kindly accepted. When the day arrived, my wife was nervous. I
told her I will be myself, and she said "Exactly why I'm worried. Please be quiet."&lt;br&gt;
&amp;nbsp;&lt;br&gt;
I attended University and have been teaching at the University for over 16 years and
so I know what a classroom looks like at a University. However, I've never stepped
into a school in this country. So, I had no idea what to expect.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;
"May be Mr. A was pulling a version of 'I am not smarter than a 5th grader' on me,"
I thought. (He did not, but in the end, that was my&amp;nbsp; conclusion, even though
this was one level below the 5th grade).&lt;br&gt;
&lt;br&gt;
The morning started out with students jumping into solving a set of problems for about
10 minutes. I think this helps to get the students settle down and focus. Mr. M was
teaching the class this particular day and Mr. A participated in some activities through
out the day, while attending to some other events that are in the works.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&lt;br&gt;
The class plan is very agile. There are three sets of students in the class. Those
who are at an advance level (they are at a grade or two higher in select areas like
Math, reading, writing, etc.). Then there are students who at the right level (some
students at advance level in one area may be at the grade level in other areas). And
then there are students not quite at the level where they need to be.&lt;br&gt;
&lt;br&gt;
If all of these children were grouped together at all time, the advanced&amp;nbsp; students
would feel frustrated and the students catching up would feel overwhelmed. So, a few
times during the day, the advanced students go to targeted sessions for their area.
The students who need extra help go to spend time with some volunteers who assist
them with further coaching. There is still good part of the day when the class spends
time together.&lt;br&gt;
&lt;br&gt;
The time in class is divided into individual activities and group activities. The
group activity gives a nice focus. It reminded me of an agile project with collaborative
development. The kids who are advanced help mentor the other kids. The distracted
kids are redirected by kids who are focused (I saw kids go through cycles of staying
focused and being distracted, but the group overall was much more focused most of
the time).&lt;br&gt;
&lt;br&gt;
One other observation I had (which I think I should do more in my classes) was they
spend a few minutes on concepts and a lot of time on exercises. The exercises again
are done in group and then individually as well.&lt;br&gt;
&lt;br&gt;
One thing that I really liked (but needs a lot of effort on the part of the teacher)
was the variable pace of classwork. The students were working on writing organization.
Again students were in three groups, ahead, in pace, and slow. The students ahead
were given an additional exercise to work while the rest of the class was catching
up. This additional work was a bit more challenging but the kids working on it seem
to really enjoy it. The kids who are slow are given extra help and time.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;
Several times during the day I got to evidence the sheer amount of creativity these
kids have. For almost every problem they solved, students suggested different approaches.
Some of the approaches surprised me as they were not intuitive or straightforward,
but they sure were quite good.&lt;br&gt;
&lt;br&gt;
Since they were learning about probability, Mr. M used a spinner to select randomly
who will answer certain questions. This was giving equal chance for students to participate
in various activities and answer questions. In the process, the theory of probability
was being reemphasized.&lt;br&gt;
&lt;br&gt;
I have to say teaching at the school level is a Herculean task. It is fun to work
with these creative students on one hand, but it is so hard to mange these kids. Their
attention span is so short and they do silly things all day long. It takes an enormous
amount of patience (hint: I should never try to apply to teach at an elementary school).&lt;br&gt;
&lt;br&gt;
It so happened that my son gave a 10 minutes presentation on "How the Universe for
Formed" as an independent study project. I wish I had helped him more on this project,
but I think he did pretty well without it. Given this was the first time he gave a
talk in front of people, he did really well. He did make some of the common mistakes
people make when presenting, but he's learning quick. He identified things he did
wrong and how he can improve. I have to admit, his first talk was much better than
my first talk (I apologize to the poor victims of my first talk. No apologies to the
current victims of my talks, that will have to wait for another blog!).&lt;br&gt;
&lt;br&gt;
What impressed me the most was the questions and answers that followed his presentation.
As soon as they were given an opportunity to ask questions, they fired with great
speed and impressive quality. Their questions were quite thought provoking. I said
to myself, "How old are you kids, again?" The Q &amp;amp; A went almost 10 minutes.&lt;br&gt;
&lt;br&gt;
Overall, I think it was a great opportunity for me to spend the time with my son in
the class. I learned quite a bit about what it is to be a kid and what it is to be
their teacher. I am thankful for this opportunity. I hope I will have the privilege
of visiting and spending a day in class sometime in the future.&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=3ac56439-566d-4d5b-9b4a-cc9a845323f6"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=3ac56439-566d-4d5b-9b4a-cc9a845323f6</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.agiledeveloper.com/blog/Trackback.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</trackback:ping>
      <pingback:server>http://www.agiledeveloper.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</pingback:target>
      <wfw:comment>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</wfw:comment>
      <wfw:commentRss>http://www.agiledeveloper.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</wfw:commentRss>
      <slash:comments>0</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">The Houston TechFest was delayed due to
   Hurricane Ike back in September.<br />
   The rescheduled event is happening on January 24th. You can find details about<br />
   the event at <a href="http://www.houstontechfest.com" target="_blank">http://www.houstontechfest.com</a>.<br /><img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e" /></body>
      <title>Houston TechFest</title>
      <guid>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</guid>
      <link>http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</link>
      <pubDate>Sat, 10 Jan 2009 15:36:30 GMT</pubDate>
      <description>The Houston TechFest was delayed due to Hurricane Ike back in September.&lt;br&gt;
The rescheduled event is happening on January 24th. You can find details about&lt;br&gt;
the event at &lt;a href="http://www.houstontechfest.com" target="_blank"&gt;http://www.houstontechfest.com&lt;/a&gt;.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.agiledeveloper.com/blog/aggbug.ashx?id=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e"&gt;</description>
      <comments>http://www.agiledeveloper.com/blog/CommentView.aspx?guid=4b0f3cd1-cee6-467e-b6a1-be0e6c7b815e</comments>
      <category>Software Practices</category>
    </item>
  </channel>
</rss>