Sunday, March 28, 2010

Code Etiquette

Valuable lessons learned this week in the wonderful world of test coding.

Here are some of my hopefully old habits!

1.  Write code
2.  Re-factor and compress repeat code into useful methods
3.  Comment out old code to validate new methods

Sounds reasonable, right?

Then I do the following:

1.  Fail to check in the code
2.  Get in a hurry to check in the code
3.  Leave commented out code when checking the code in
4.  Fail to execute the tests as a unit prior to checking in code
5.  Fail to do an update to the code base prior to developing new code

A couple of major flaws in my actions or non-actions are that I check in new code that is already outdated because I failed to do an update.  I check in ugly crusty code full of meaningless commented out lines.  My team has absolutely no clue as to where I left off or what demons I was battling.

So I need to start a new set of developer habits as a test developer.

1.  Start each effort updating the target project
2.  Execute a "Diff" on all files that have differences
3.  Closely examine the differences and make smart choices on which file is more current or when to merge
4.  Continue to write code, re-factor and comment out old lines of code, BUT clean all of this up prior to checking in the code
5.  If I have demons I am battling during development (examples - Java Script timing issues, or page builders) I plan to clearly annotate these areas with comments and TO DO lists so team members can at least have a sense as to where I left off
6.  Seek help if I am stuck for to long a small area of code
7.  Test the code, Test the code, Test the code -  What this means is test it locally in isolation, test the suite of code locally, and test the code on our production system
8.  Checking in any code at the end of each day regardless if I am complete or not.  The code should include clear concise documentation if there are non-functional areas and not crusty commented out lines of code that server absolutely no purpose.

I definitely have to find a way to have better developer habits.  The last thing we need to do is cause unnecessary tension within a great team.  I am not a developer by nature so I really have to work at it.  But I do promise to always strive for continuous improvement.

If anyone has other suggestions for skills improvement please leave a comment!

Happy coding!

Saturday, March 20, 2010

Time to Refactor

It is a rainy day in Austin Texas and I decided it was high time to re-factored my blog.  My  test automation adventure started off learning OTC tools Silk Performer, Silk Test, Webload, and QTP.  Eventually I recognized the advantages of open-source testing tools and the communities that support them.  My first adventure was using WATIR.  I loved using WATIR and the community. Unfortunately when I changed companies the ramp time was quick and WATIR at the time did not have all of the weapons we needed to accomplish our test automation task.

I have the absolute pleasure of working with a very sharp developer, Scott Sims.  In part I owe the knew title for my blog to him.  One day he had described a scene to me where his daughter "went all Kung Fu panda" on his wife.  I also get a kick out of when he hits some keys on his keyboard and "Hiyaaa" a zillion application windows open for battle.  In my blog archives I also had a previous post regarding Kung Fu testing when I worked with Cari Spruiell on a project.  We had to be nimble and fast on our feet to get the high quality project out the door.

All in all I think it is an appropriate title for today's testing world.  If you do not have an arsenal of tools and tricks you will not keep pace with the rapid development.

Over the past six months I have collaborated with Scott and we have ended up with a framework that I will describe like this "powered by Ruby, RSpec, Selenium GRID and supercharged with testing by brand, finely formatted results stored in Rally, page driven test execution via Team City.  I will add posts describing our choices and the adventure as we advance this framework.

Over the past few months we had the challenge of preparing our site for the traffic generated by a Superbowl ad.  We succeeded, but would not have done it with out the help of JMeter and Browser Mob.  Along the way I will add posts on performance testing.  I hope you will stop by this blog occasionally and share your thoughts.

Stay tuned!  Lets see if I can actually post weekly.