Test Driven Development

Test driven development is made famous by UP or Agile development model. Wherein the Developer first writes the unit test case and then writes the class. Often this unit test cases are included in the build process. Ant has task for including the unit test case as part of the build process.
For ex..

	
	
		
			
				
					
					
				
			


			

			
		
	

You can configure the ant in such a way that if any of the unit test fails,break the build.

Some of the advantages of test first approach is
Provable Verification: Sometimes after you write class and methods you wonder whether it really works in test environment with real values or is it just your gut feeling(it should work!!). In such cases if the project is very big and have lots of dependencies it becomes really tough to build, besides there is lot of hardship building test beds, get the hardware ready etc.But unit test cases such as Junit provides instant gratification of knowing whether class works as written or not.

Easy to change things around: Its easy to change code without worrying too much about whether this will break the dependencies or whether change is right or not. One of the drawbacks with unit testing is that sometimes developer forgets to update the unit test case when new feature or new fix is checked into the code base. This may result in false security of build is okay since unit test cases passes also it may lead to some unit test failing inadvertently, causing lot of frustration among developers who may not have done this change.

Advocates of agile development methodology prescribe that whenever new issue or enhancement comes for existing code base, first unit test case needs to be added and make sure the unit test case fails, now the change is made in the corresponding, class method,or interface in such a way that unit test case passes during the build. Once Build is successful, the updated fix can be delivered to QA for further sanity, later delivered to customer. This kind of test first or write unit test first approach eliminates much of issues arising out of regression.

This is how the flow chart goes for a customer issue.
testfirst


Virtual box seamless mode


I have been playing with virtual box for quite a while now, it gives me the freedom to do the mundane official task such as checking emails, writing design document, updating the xls, status reports etc where I can not get away using MS, at the same to be connected to the linux world through ubuntu. I used to switch between virtual box and window using alt + tab and then host key + F to get into full screen mode, even though I kind of got used to it, switching back and forth took lot of time and I felt I was doing remote desktop instead of running virtual box, which is hosted right at my desktop. Today morning I accidentally pressed on the seamless without realizing what I was doing, the next thing I experienced is pure nirvana... now I don't need to switch between windows and linux ...instead linux taskbar comes and sits on top of my windows desktop background and linux terminal is opened right as if I have opened a text pad. Now I can copy code back and forth from text file to terminal mode ( I agree I could do this before as well) without going through number of key presses... To one caveat is to enable seamless mode you need to have the guest additions software installed on your Guest OS


Project Sikuli is great tool for Unit testing

Today I came across Project Sikuli from MIT labs. It is a visual technology to search and automate graphical user interface(GUI) using images or screenshots. It is a reasearch project developed by MIT computer science and Artificial Intelligence Laboratory(CSAIL).
Its kind of pretty neat. You download the tool and automate any menial task you have, like probably clearing out the /tmp folder or deleting the temporary internet files or FTPing or tweeting (you can do that too).
You can do lot of unit testing as well. Sikuli supports unit testing of GUI by integrating with junit. But you don;t need to write whole lot of code here with skiuli IDE, a python class inherited from junit.framework.TestCase? is automatically generated to wrap the unit testing script.Developers only need to write standard setUp(), tearDown and their test methods.

Following is the example

def setUp(self):

openApp("AnyRandom.app")
# wait until the app appears
wait(SCREENSHOT_OF_THE_APP) 

def tearDown(self):
closeApp("AnyRandom.app")
# wait until the app disappears
untilNotExit(SCREENSHOT_OF_THE_APP)
def testA(self):
....

def testB(self):
....


Real world example is here


Pictures from Nat Geo Contest

National Geographic's International Photography Contest attracts thousands of entries from photographers of all skill levels around the world every year. While this year's entry deadline has passed, there is still time to view and vote for your favorites in the Viewer's Choice competition.

For more visit : http://www.boston.com/bigpicture/2009/11/national_geographics_internati.html


In few years its google everywhere

It's interesting how google is trying to establish its presence in our daily lives. Check out some of the latest ideas presented by google.
Looking Back at Google in 2009
Excerpts from the blog
It is harder and harder for me to spot an IT sector in which Google does not offer products and services Mathias Schindler pondered in the forum,  Can you think of any IT sector where there is no Google product (yet)? Competition has a tough time, unless they happen to get bought up by Google, not only because of Google’s cross-integration power, but also because it would take mindblowing budget to reproduce Google’s cloud server farm. Google after all arguably owns the world’s biggest super computer, one with an AI that becomes better and better with more data. But the giant is growing taller by the second, and I’m curious if there will be a couple of instances where we’ll see him stumble over his own feet in 2010.
I couldn't agree more on this.


Hadoop World

Jeff Hammerbacher from Cloudera on Vimeo.



  • Tweets

    Follow kiranputtur on Twitter
  • Posts

    July 2010
    M T W T F S S
    « Mar    
     1234
    567891011
    12131415161718
    19202122232425
    262728293031  
  • Facebook Friends


  • About

    Here I blog about all kind of stuff from Advaita philosopy monoism to software programming, Design Oriented Approach, reviews about latest hardware storage equipments as well as my rantings about open source projects. more..

  • Following Projects