Tuesday, December 15, 2009

Agile Development - Code Review and Continuous Builds

Hi, I'd like to share my point of view about some specific methodologies or "best practices" in agile development. We can read in almost everywhere some basic points:

Convention over configuration
Optimize Later
Test Driven Development
Refactoring
So on...

This time I am going to talk about refactoring code, and I will start asking: why do we need to do "refactoring"? In my personal opinion this will only be performed in Optimize Later, because, in development stage you have to guess the bottlenecks and real data is needed to improve optimization. If the team has solid vision about software development and the product, then, why would we submit "ugly" code that later will have to be refactored in a nicest way?, why would we loose precious time after deliveries refactoring, testing and releasing?


I'm convinced that collaborative development is the way to go, so, if your team implements solid code submitting work flow, then you will became more profitable and will deliver better products, this is, a good code review process will lead your team to submit code that has been reviewed and approved, and anything else, no ugly code, no breaking code, etc. I know that code review is one of the most boring task for engineers, but if you could convince your Seniors that they wont spent their time in nothing all the team will learn a lot!

And, how do we encourage our Seniors to review code? Easy, assign them code to review that has passed unit testing, code that is not breaking anything else and that is well written. Ok that sounds great, but How!

Git + Gerrit + Hudson = Truly Agile !

Imagine this: Developer does his Job, write code and its unit testing, pass his code throw a "Lint Program" and detects possible ugly code ( lines with more than 100 chars, wrong indentation, spaces between params, so on), once the code is ready, then submit your code to review (Gerrit), Gerrit sends a notification to Hudson to fetch the change, build it and run all the unit tests, if it passes everything, then use Gerrit command tools to approve the change, did you notice that at this point the code is ready to get reviewed by a Senior Engineer?, why? Just because the code is not ugly (Lint Script) and it's not breaking anything else (Continuous Build), So your Senior Engineer will be pleasured to review that code and he will be sure he wont spent time reviewing something that may break something else.

If you can reach this workflow, your team will be really Agile! and you will be avoiding precious time after development that normally would have to be spent refactoring code, why is this true? It's simple, because you wont have ugly code in your Git Server!!!!! whohoooooo.


Git: Best free source versionning system (For me)
Gerrit: Code reviewer System, web based and developed by Google to review Android Code
Hudson: Nice Flexible Continuous build server.

Wednesday, April 16, 2008

MySQL Workbench

I'm pround to announce that finally after some years of development MySQL Workbench has reached a GA stability, I'm member of the Beta Tester Program and I can't believe how the MySQL GUI Development team works, they rock!! Contratulations to Mike Zinner and his team... All the bugs that I reported they were able to fix them in less than two weeks!! you can download the Community Edition from http://downloads.mysql.com/ but if you want to get a profesional set of tools designed to MySQL WorkBench do not hesitate to buy the Commercial Edition (less than 100 USD).

Friday, January 11, 2008

MySQL Magazine issue 4 Released!

Hey! you must have a look on the new MySQL Magazine, it has a really nice articles, one of the MySQL geeks wrote on this issue (Jeremy Cole). You can donwload it from www.paragon-cs.com/mag/

Thursday, November 8, 2007

Comparing Stored Procedures SQL Server 2000

Have you been frustrated by a bad release ?? trying to figure out where the problem is?? well I've been, and I had to verify that my release team did the job correctly, principally with the stored procedures, it is too dificult to mantain up to date and find differences, this is my first draft(even it's working) about a stored procedure comparer, my initial idea is to eliminate all the special characters and compare row by row and find differences, in my second review (if i had time) I'll try to add the line or the source code that is different:


select distinct B.name Local,
A.name Remote,
case when replace(replace(replace(replace(A.text,' ',''),char(13),''),char(10),''),char(9),'') =
replace(replace(replace(replace(C.text,' ',''),char(13),''),char(10),''),char(9),'') then
'Equal'
else
'Not Equal'
end Equal
from OPENROWSET('MSDASQL',
'DRIVER={SQL Server};SERVER=serverName;UID=userName;PWD=secretpwd;DATABASE=myDB',
'select A.name, B.text, B.colid
from outbound..sysobjects A
inner join outbound..syscomments B on A.id = B.id
where A.name like ''pr_Prefix_%'' and A.type=''P'' ') A
left join outbound..sysobjects B on A.name = B.name
left join outbound..syscomments C on B.id = C.id
and C.colid = A.colid


All that you have to do is replace the serverName, userName, secretpwd and myDB, also if you want to find differences between a group of stored procedures that the name has a prefix, then replace pr_Prefix_ with your naming convention, and that's it!!

Let me know your comments or improvements ;)

Wednesday, November 7, 2007

Tr8's life

This is my first post on this, thanks to Larin (http://chischaschos.blogspot.com) well it's not my first post on globspot, I mean on this account :p. This is my profile:

Bachelor Degree on Computer science (But I'm not a geek)
Beer drinker
Fishing man
Married with two devils
Working in a transnational software company as Software and Analyst Engineer
Travian player (yes I know that this is a bad habit)

well, my brain is not working propertly I'm trying to finish a report, a very large report
. cya!