<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6885314809671061811</id><updated>2011-04-21T10:59:32.902-07:00</updated><category term='EasyMock'/><category term='Intro'/><category term='jMock'/><category term='Spring'/><category term='JUnit'/><category term='Test Driven Development'/><category term='Guice'/><category term='Dependency Injection'/><category term='Eclipse'/><title type='text'>Java, Frameworks and Software Engineering</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jfase.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jfase.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Regen</name><uri>http://www.blogger.com/profile/05547120015765103218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6885314809671061811.post-1585659318030459925</id><published>2008-06-11T07:05:00.000-07:00</published><updated>2008-06-11T14:33:48.020-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test Driven Development'/><category scheme='http://www.blogger.com/atom/ns#' term='JUnit'/><title type='text'>Test Driven Development</title><content type='html'>Test Driven Development is normally when you write tests, and then write code to make those test pass.&lt;br /&gt;&lt;br /&gt;I find that a good way to start out with test driven development is to modify it slightly. Instead of writing the test first, write the method. Then immediately write the test. Often people new to TDD take a while to learn how to write tests and having the method under test helps with the process of learning to write tests.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Tools&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;The first tool that you need to learn is &lt;a href="http://www.junit.org/"&gt;JUnit&lt;/a&gt;. JUnit allows you to quickly write tests to exercise your code, espically JUnit 4 introduced annotation based tests, which makes writing tests very easy.&lt;br /&gt;&lt;br /&gt;The next tool you should look at is a mock object package. I personally use &lt;a href="http://jmock.codehaus.org/"&gt;jMock&lt;/a&gt;, but other people swear by &lt;a href="http://www.easymock.org/"&gt;easyMock&lt;/a&gt;. Mock objects let you isolate an object under test. The key to being able to use mock objects is to decouple your dependencies.&lt;br /&gt;&lt;br /&gt;I personally prefer using dependency injection to decouple your dependenices. Martin Fowler has a good &lt;a href="http://martinfowler.com/articles/injection.html"&gt;overview &lt;/a&gt;of the subject on his website.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Time&lt;/span&gt;&lt;br /&gt;How much of your development time should be spent writting unit tests? In general, I find that a good rule of thumb is that about 50% of your development time should be on unit tests and 50% on production code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Advantages&lt;/span&gt;&lt;br /&gt;TDD tends to produce better production code. In order to make the production code testable, you wind up writing code with a lower &lt;a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"&gt;cyclomatic complexity&lt;/a&gt;, thus tending to have fewer bugs in your code to begin with.&lt;br /&gt;TDD gives you good unit test coverage. You should have test for each method, most likely you'll have more than one test for each method, ideally you should have at least the cyclomatic complexity number of tests.&lt;br /&gt;Due to the good test coverage, you can &lt;a href="http://www.refactoring.com/"&gt;refactor &lt;/a&gt;with confidence that you will detect very quickly if you do break code.&lt;br /&gt;&lt;br /&gt;Give it a try, it may take a while to get used to, but once you do, you'll be happy you did.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885314809671061811-1585659318030459925?l=jfase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jfase.blogspot.com/feeds/1585659318030459925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6885314809671061811&amp;postID=1585659318030459925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/1585659318030459925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/1585659318030459925'/><link rel='alternate' type='text/html' href='http://jfase.blogspot.com/2008/06/test-driven-development.html' title='Test Driven Development'/><author><name>Regen</name><uri>http://www.blogger.com/profile/05547120015765103218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885314809671061811.post-7965018846158768677</id><published>2008-06-09T11:22:00.000-07:00</published><updated>2008-06-09T11:24:02.256-07:00</updated><title type='text'>Self Plug</title><content type='html'>Check out my other blogs &lt;a href="http://primatenewsnetwork.blogspot.com/"&gt;Monkey News Network&lt;/a&gt; and &lt;a href="http://aconstitutionalwalk.blogspot.com/"&gt;Constitutional&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885314809671061811-7965018846158768677?l=jfase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jfase.blogspot.com/feeds/7965018846158768677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6885314809671061811&amp;postID=7965018846158768677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/7965018846158768677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/7965018846158768677'/><link rel='alternate' type='text/html' href='http://jfase.blogspot.com/2008/06/self-plug.html' title='Self Plug'/><author><name>Regen</name><uri>http://www.blogger.com/profile/05547120015765103218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885314809671061811.post-5478987695343783133</id><published>2007-12-16T05:38:00.000-08:00</published><updated>2008-06-11T14:35:11.698-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test Driven Development'/><category scheme='http://www.blogger.com/atom/ns#' term='EasyMock'/><category scheme='http://www.blogger.com/atom/ns#' term='Dependency Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='JUnit'/><category scheme='http://www.blogger.com/atom/ns#' term='jMock'/><title type='text'>Agile Development</title><content type='html'>I've been using Agile techniques for years and trying to get others to use them as well. I've read books on Agile techniques, &lt;a href="http://damonpoole.blogspot.com/"&gt;read blogs&lt;/a&gt;, and written code. For people interested in exploring these techiques, I would suggest the following techniques to try out:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;TDD - Test Driven Development&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Write unit tests before or as soon as you write a new class or add methods&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Design for easy testing, limit and break dependencies&lt;/li&gt;&lt;li&gt;Make sure all your test past before moving on to develop more code&lt;/li&gt;&lt;li&gt;Use a testing framework like &lt;a href="http://www.junit.org/"&gt;JUnit.&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Use mock objects. A mock object framework like &lt;a href="http://www.jmock.org/"&gt;jMock &lt;/a&gt;or &lt;a href="http://www.easymock.org/"&gt;EasyMock &lt;/a&gt;will help.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Refactoring&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Use an IDE which supports refactoring, such as &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Read Martin Fowler's book and &lt;a href="http://martinfowler.com/"&gt;blog&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Refactor frequently, don't be afraid of refactoring. If you have good set of unit tests they will quickly pickup any mistakes that might be introduced by refactoring.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Break Dependencies&lt;/li&gt;&lt;ul&gt;&lt;li&gt;By breaking dependencies using a technique like &lt;a href="http://martinfowler.com/articles/injection.html"&gt;dependency injection&lt;/a&gt;, you can make writing Unit tests easier and make refactoring safer.&lt;/li&gt;&lt;li&gt;During testing, inject by hand, during production use a framework such as &lt;a href="http://www.springframework.org/"&gt;Spring &lt;/a&gt;or &lt;a href="http://code.google.com/p/google-guice/"&gt;Guice&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;This should get you started, I'll add more techniques and go into depth on each technique during future posts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885314809671061811-5478987695343783133?l=jfase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jfase.blogspot.com/feeds/5478987695343783133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6885314809671061811&amp;postID=5478987695343783133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/5478987695343783133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/5478987695343783133'/><link rel='alternate' type='text/html' href='http://jfase.blogspot.com/2007/12/agile-development.html' title='Agile Development'/><author><name>Regen</name><uri>http://www.blogger.com/profile/05547120015765103218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885314809671061811.post-1392431373793637112</id><published>2007-12-16T05:34:00.000-08:00</published><updated>2007-12-16T05:37:12.177-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intro'/><title type='text'>What is this blog about</title><content type='html'>In my role as an internal Java Framework developer for a corporation developing web applications, I realized that many developers don't understand how to use the modern tools and techniques available to them. This blog is about presenting those tools and technique so that others can benefit from this experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885314809671061811-1392431373793637112?l=jfase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jfase.blogspot.com/feeds/1392431373793637112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6885314809671061811&amp;postID=1392431373793637112' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/1392431373793637112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885314809671061811/posts/default/1392431373793637112'/><link rel='alternate' type='text/html' href='http://jfase.blogspot.com/2007/12/what-is-this-blog-about.html' title='What is this blog about'/><author><name>Regen</name><uri>http://www.blogger.com/profile/05547120015765103218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
