<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tech Titbits</title>
	<atom:link href="http://tabibtechblog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tabibtechblog.wordpress.com</link>
	<description>My few cents on technology...</description>
	<lastBuildDate>Fri, 22 Aug 2008 20:35:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tabibtechblog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tech Titbits</title>
		<link>http://tabibtechblog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tabibtechblog.wordpress.com/osd.xml" title="Tech Titbits" />
	<atom:link rel='hub' href='http://tabibtechblog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Working with Database..</title>
		<link>http://tabibtechblog.wordpress.com/2008/08/22/working-with-database/</link>
		<comments>http://tabibtechblog.wordpress.com/2008/08/22/working-with-database/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 20:33:16 +0000</pubDate>
		<dc:creator>Mahesh Tabib</dc:creator>
				<category><![CDATA[Do's and Dont's]]></category>

		<guid isPermaLink="false">http://tabibtechblog.wordpress.com/?p=13</guid>
		<description><![CDATA[Working with Database is something I am yet to explore. It’s always good to learn basics before you get into details. Here are few best practices/do’s and don’ts while creating database: · Chose the most appropriate data type while creating the table. · Create appropriate constraints wherever applicable while creating the table. · Use SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=13&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Working with Database is something I am yet to explore. It’s always good to learn basics before you get into details. Here are few best practices/do’s and don’ts while creating database:</p>
<p>· Chose the most appropriate data type while creating the table.<br />
· Create appropriate constraints wherever applicable while creating the table.<br />
· Use SQL loader to import data from some other data source wherever possible.<br />
· Always use anchored declaration while creating stored procedures and functions.<br />
· Carefully select the control structures.<br />
· Wherever applicable use bind variables.<br />
· Create appropriate triggers to implement business logic.<br />
· Always store the scripts in the text files.<br />
· Declare appropriate mode for variables in stored procedures and functions.<br />
· The input and output parameters datatype should be SQL compatible while creating stored functions.<br />
· Always handle errors using exception handling construct wherever applicable.</p>
<p>Though I haven’t got time to dig into details of creating a database, I think this stuff will be somewhat useful.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tabibtechblog.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tabibtechblog.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tabibtechblog.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tabibtechblog.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tabibtechblog.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=13&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tabibtechblog.wordpress.com/2008/08/22/working-with-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a956deb49ceefd3cf7196794a202b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tabbi</media:title>
		</media:content>
	</item>
		<item>
		<title>Code Reusablity&#8230;</title>
		<link>http://tabibtechblog.wordpress.com/2008/08/22/code-reusablity/</link>
		<comments>http://tabibtechblog.wordpress.com/2008/08/22/code-reusablity/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 20:13:17 +0000</pubDate>
		<dc:creator>Mahesh Tabib</dc:creator>
				<category><![CDATA[Code Reusability]]></category>

		<guid isPermaLink="false">http://tabibtechblog.wordpress.com/?p=11</guid>
		<description><![CDATA[Rusability has always been an interesting topic. When determining how best to tackle the large amounts of variations in the application, several factors have to be considered.  These factors include code maintainability, code reuse, development effort, etc.  Reusable code requires an effective combination of two points… 1.    Properly defined interface definitions 2.    Efficiently defined class [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=11&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Rusability has always been an interesting topic. When determining how best to tackle the large amounts of variations in the application, several factors have to be considered.  These factors include code maintainability, code reuse, development effort, etc.  Reusable code requires an effective combination of two points…<br />
1.    Properly defined interface definitions<br />
2.    Efficiently defined class structures and inheritance<br />
One benefit of establishing interface definitions is that every class that implements an interface must adhere to that interface’s functional requirements.  The fact that multiple sets of variations can share a given class implementation demonstrates how implementation logic can be reused in the system.<br />
The interfaces must be defined in such a way as to maximize its ability to be reused.  Large interface definitions (too many functions) can render an implementation class virtually impossible to reuse.  Whereas a single function interface can lead to a class proliferation problem (too many classes).  The balance must be struck somewhere in between with medium sized interfaces (fewer functions).<br />
In addition, more code sharing occurs within each implementation class.  Based on the class structure established at development time the implementation classes can be organized according to their interface group type and can allow inheritance to access common logic.  By extending implementation classes from a categorized base class a developer can “promote” common logic to the parent class thus reducing the amount of redundant code.  When promotion of common code to a parent class starts to become impossible it might be time to re-evaluate the size of the underlying interface.<br />
The combination of inheritance along with composition reduces the amount of duplicate code present in the system. Interface modifications may be required in the ongoing effort to balance the amount of logic that can be promoted to base classes as the number of implementation classes increases. Make a code reusable and avoid redundant code, isn’t this great.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tabibtechblog.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tabibtechblog.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tabibtechblog.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tabibtechblog.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tabibtechblog.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=11&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tabibtechblog.wordpress.com/2008/08/22/code-reusablity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a956deb49ceefd3cf7196794a202b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tabbi</media:title>
		</media:content>
	</item>
		<item>
		<title>JUnits&#8230; Do&#8217;s and Dont&#8217;s</title>
		<link>http://tabibtechblog.wordpress.com/2008/08/22/junits-dos-and-donts/</link>
		<comments>http://tabibtechblog.wordpress.com/2008/08/22/junits-dos-and-donts/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 13:07:45 +0000</pubDate>
		<dc:creator>Mahesh Tabib</dc:creator>
				<category><![CDATA[Do's and Dont's]]></category>
		<category><![CDATA[JUnits]]></category>

		<guid isPermaLink="false">http://tabibtechblog.wordpress.com/?p=3</guid>
		<description><![CDATA[After the Junit cleanup last whole month, here are my few cents and good practices to be followed while writing a JUnit: · Write tests for methods that have the fewest dependencies first. If you start by testing a high-level method, your test may fail because a subordinate method may return an incorrect value to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=3&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;font-family:&quot;">After the Junit cleanup last whole month, here are my few cents and good practices to be followed while writing a JUnit:</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Write tests for methods that have the fewest dependencies first. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">If you start by testing a high-level method, your test may fail because a subordinate method may return an incorrect value to the method under test. This increases the time spent finding the source of the problem, and you will still have to test the subordinate method anyway to be sure it does not contain other bugs.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Tests should be logically simple as possible, preferably with no decisions at all. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">Every decision added to a test method increases the number of possible ways that a test method can be executed. Testing is meant to be a controlled environment; the only thing you want to change is the input to the method under test, not the test method itself.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Wherever possible, use constant as expected values in your assertions instead of computed values. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">Consider these two assertions:</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">returnVal = getDiscountCode(input);</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">assertEquals(returnVal, computeDiscountCode(input));</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">assertEquals(returnVal, “<strong>023</strong>”);</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">In order for computeDiscountCode() to return the proper result it probably has to implement the same logic as the getDiscountCode(), which is what you are trying to test for in the first place. Further, suppose you fixed a defect in the getDiscountCode (). Now you have to change computeDiscountCode () in the same manner. The second assertion is easier to understand and maintain.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Each unit test should be independent of all other tests. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">A unit test should execute one specific behavior for a single method. Validating behavior of multiple methods is problematic as such coupling can increase refactoring time and effort. Consider the following example:</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">void testAdd()</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:10pt;font-family:&quot;">int return1 = myClass.add(1,2);</span></p>
<p style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:10pt;font-family:&quot;">int return2 = myclass.add(-1,-2);</span></p>
<p style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:10pt;font-family:&quot;">assertTrue (return1 &#8211; return2 == 0);</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">If the assertions fails in this case, it will be difficult to determine which invocation of add() caused the problem.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Each unit test should be clearly named and documented. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">The name of the test method should clearly indicate which method is being tested because improperly named tests increase maintenance and refactoring efforts. Comments should also be used to describe the test or any special conditions.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">All methods, regardless of visibility, should have appropriate unit tests. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">Public, private and protected methods that contain data and decisions should be unit tested in isolation.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">One assertion per test case. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">Avoid using multiple assertions in one test case. For example, if a test case with five assertions fails on the first assertion, then the remaining four are not executed. Only when the first assertion is corrected will the other assertions execute. If assertion two fails, then that also must be corrected before the remaining three assertions are verified. Although the unit test file may be large, it will be easier to find and fix defects.</span></p>
<p><span style="font-size:10pt;font-family:Symbol;">·</span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">Create unit tests that target exceptions. </span></strong></p>
<p style="margin-left:0.5in;"><span style="font-size:10pt;font-family:&quot;">Exceptions are thrown when a method finds itself in a state it cannot handle. These cases should be tested just like a method’s normal state of operations. If a method is declared to throw one or more exceptions, then unit tests must be create that simulate the circumstances under which those exceptions could be thrown. The unit tests should assert that the exceptions are thrown as expected.</span></p>
<p><strong><span style="font-size:10pt;font-family:&quot;">Happy coding Junits…!!</span></strong></p>
<p class="MsoNormal">
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tabibtechblog.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tabibtechblog.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tabibtechblog.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tabibtechblog.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tabibtechblog.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tabibtechblog.wordpress.com&amp;blog=4583939&amp;post=3&amp;subd=tabibtechblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tabibtechblog.wordpress.com/2008/08/22/junits-dos-and-donts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a956deb49ceefd3cf7196794a202b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Tabbi</media:title>
		</media:content>
	</item>
	</channel>
</rss>
