hasan's blog (বল্গ)

work for fun!!!

Scrum: How to understand stand up and burn down is effective ?

with 4 comments

Scrum burn down chart and daily stand up meeting are the most important part of the scrum process to keep the team on focus. Scrum is good on bring transparency in development process. With utilizing better engineering practice like test driven development, continuous integration we could keep our productivity and fun on the same line.

If you are one of those  people who are wondering

What is called “stand up”?

I have a brief for you.

scrum standup picture

scrum stand up meeting

On the picture you could see, there are few people who are standing up and discussing about the following 3 topics -

  1. What i have done yesterday!
  2. What i will do today!
  3. Where i have been stucking!

This is a required daily meeting where 10 minutes are spent together with all team members, this meeting is used to adjust the tasks among the team members also to monitor the current status.

Later this meeting is followed by a burn down chart which is attach on the wall or send through email to everyone or upload on some place which is visible to everyone.

scrum burn down chart

scrum burn down chart

What is burn down chart ?

Burn down chart is a graph which is used to visualize how much hours work is left in an iteration (sprint). on the illustration you’d see a white line which is visualizing average burning hours per day. If we have planned for 180 hours tasks for whole iteration. Average burning hours should be minimum 180 / 8 days (if you have 8 days span sprint) = 22.5 hours to keep us on target.

The green line is visualizing the real team progress, you see this is not always up to the base line. It is moving up and down thus we are determining how the team is performing. If this green line is too upwards from the base line it means we are behind the schedule if that goes far below from the base line that reflects bad planning.

How to understand your team is understanding them?

I found the following symptoms to understand that our team members are understanding the importance -

  • Everyone attending daily stand up on time.
  • Everyone feeling responsible and notifying before they get late in office.
  • Everyone eagerly reporting their status and taking commitment for today
  • Team members are feeling guilty if some of them didn’t complete the commitment
  • Everyone eagerly waiting to see the change in burn down chart
  • If burn down shows some upward progress everyone get concerns and work hard
  • Everyone feeling proud of the progress which shows in burn down.
  • Everyone working every day not waiting for last moments push.
  • Everyone keeping their daily commitments
  • When burn down curve is  not moving too upward or not falling too downwards.

Most important change in scrum is your team doesn’t need to work over night or over weekend to keep progress around the base line. (i will later discuss about how iterative and incremental planning can help). Fortunately we have discovered these changes on our current team.

The most important thing is feeling the “team way” which we are missing in most of our teams, I guess utilizing the tools and process like scrum that can be improved a lot.

best wishes,

Written by nhm tanveer hossain khan

May 22, 2009 at 8:56 am

Posted in agile, scrum, tekSymmetry.net

Tagged with , , ,

How do you manage your url in php application ? (for CodeIgnitor guys)

leave a comment »

Recently i had a post in phpexperts group where i wanted to emphasis on managed url. hard coding url is not a good practice besides it ended up with lot of changes on tested code.

Hi,
It has been long while since i last post here in phpexperts group, well i was
away from php for pretty long, being more java and ruby on rails guy when i got
chance to help few php projects, i borrowed few more neat and nifty design
concept from rails to php.

well let me tell you about the story of stories, i ain’t treat myself as php
expert anymore since being detached or keeping my ass out of it. i’d prefer to
call myself as the expert of “work for fun”.

before digging into the details let me explain what was wrong and what could be
wrong with your current way of using URL through out the php application (web
site)

-> Karim, he is given a task to develop a beautiful WOW WOW application in php,

-> He is very WOW WOW developer, develops everything on the fly, produces
(TR/Z/B)*illion of bugs on the fly as well.

-> Very promonient developer, he knows how to write php along html, after
hearing several good advices he started giving CodeIgnitor a shot.

-> So he used to write the following kinda code in everywhere -

<a href=”<?= site_url(”user/profile/10″) ?>”>My profile</a>

Now if you get a chance to look into his view or controller codes, you might see
in everywhere he hard coded the url pattern.

what the hell is the URL Pattern?

well, you see “site_url(”user/profile/10″)” this code is expanded to
http://abc.com/user/profile/10” while you execute your code in php. this
“user/profile/:number” is called url pattern.

everywhere in his code base he kept such hard coded url pattern.
let’s imagine his client or boss or team lead ask him to change the url pattern
“user/profile/:number” to something similar “profile/:number/”.

now tell me what would YOU DO? if you were placed in such situation?

well you know if that guy was me, i’d run a string replace command through out
the whole project. so wherever i wrote “user/profile/:number” url pattern that
would be converted to “profile/:number”

something like this – /site_url\(”user\/profile\/(\d+)”\)/ replace to
site_url(”profile/$1″)

well i guess many of you already have such problem with similar solution ;)
frankly speaking we had similar problem thus we came up with some solution where
we can change URL pattern without modifying existing view or controller code.

here is the evidence -
<a href=”<?= $this->url->profile(array(”username” => $user_profile->username))
?>”>
<img src=”<?= $this->url->avatar(array(”username” => $user_profile->username))
?>” />
</a>

you see, we ain’t hard coding any url anymore, rather we are calling a function
which are automatically generating from the following kinda configuration -
$urls["profile"] = “http://:username.:host/community“;
$urls["avatar"] = “http://avatar.somewherein.net/avatar/:username/for/aawaj“;
$urls["logout"] = “logout”;

i am pretty sure you guys are smart enough to figure out how we did that, let me
know if you need any help about how we did that.

well first you try yourself and tell me how we did :)

read the rest of the thread here
you can find out solution here

best wishes,

work for fun!

Written by nhm tanveer hossain khan

May 22, 2009 at 6:33 am

i always got that attitude

with 7 comments

I have very bad attitude, i always love to add idea on whatever i touch. so when i have found this excellent wordpress template, i thought i should make it through my way. today i gave it a new look, i wish this won’t be bad on your eyes. thanks to rashid bhai for my face design and hasin bhai for hosting.

picture-14

best wishes,

Written by nhm tanveer hossain khan

April 17, 2009 at 7:22 pm

Posted in theme, wordpress

yes!!! i have moved on wordpress still my domain is valid.

leave a comment »

thanks goes to hasin bhai and his this post also with his hosting space.

previously my blog was hosted on my official server, so when i moved on, i had to move it elsewhere.
i thought wordpress’d have better facilities. since it’s a hosted solution, so i don’t have to maintain it at all.
later i discovered i had to pay 10$ per year to activate my domain based hosting setup on wordpress.
without making further delay i asked hasin bhai to give me an account on his server, without second thought or delay he set it up for me.

later i followed hasin bhia’s procedure to use my hasan.we4tech.com on top of we4tech.wordpress.com.
now it’s working without any problem.

best wishes,

Written by nhm tanveer hossain khan

April 3, 2009 at 5:12 pm

i haven’t maintained my blog for a long while, lets say i just kicked it back.

with 5 comments

i was so lazy that stopped me from what i was supposed to put on my blog. haven’t touched or written anything for a long while. since i joined in new company where i am officially bounds to write something on our official blog. so i guess this is better if i’d tried few blogs first on my site first.

many changes are happening in 2009, i just prepared a list i can think of right now -

  • moved my job to tekSymmetry
  • my beliefs are very strong because of the secret
  • working for bringing the change to our local people
  • more preciously started giving time on the stuffs i really feel from my hurt
  • having so much fun with friends and well wishers
  • always discussing with people about “how to bring the changes?”
  • loving travel alone
  • moved my blog on wordpress
  • need to fix hasan.we4tech.com
  • i can drive better than before

you know these stuffs sounds noise or kinda confusing, i guess thats what i can add so far.

best wishes,

Written by nhm tanveer hossain khan

April 1, 2009 at 7:12 pm

Posted in personal

cox’s bazar trip feb 2009

leave a comment »

i was watching the sunset, suddenly i discovered some unusual stuffs, well guys nothing to be wondered it was a collection of mosquitoes. all of them were protecting me from some unknown fear.

they guided me throughout my hotel. my camera didn’t miss this moment to keep for future reminder.
my other pictures could be found here
best wishes,

Written by nhm tanveer hossain khan

February 11, 2009 at 12:56 pm

Posted in cox\'s bazar, tour

why unit test (a developer perspective) ? (contd. after coffee with sqabd session)

leave a comment »

hi,
just jotting down all my thoughts what we partially discussed today at coffee with sqabd session.

why unit test (a developer perspective) ?

when we (developer) code we need to spit out some information to verify certain point of function/logic to ensure they are returning or working as the way they suppose to behave.

for example –
def convert_to_taka(p_dollar)
  return p_dollar * get_current_taka_conversion_rate()
end

def get_current_taka_conversion_rate
  # let’s say, this function retrieve this value from remote web service call
end
as you can see “convert_to_taka” function is not all in all, it has dependency to another method where it delegates it responsibility to get the current currency rate for taka.

so as a developer my responsibility is not only to ensure convert_to_taka method also my responsibilities include to verify whether get_current_taka_conversion_rate is behaving properly.

so before i was introduced with test first approach. i used to write my code in the following manner -
def convert_to_taka(p_dollar)
  logger.debug(”converting dollar #{p_dollar} to taka”)
  conversion_rate = get_current_taka_conversion_rate()
  logger.debug(”conversion rate for taka – #{conversion_rate}”)
  return p_dollar * conversion_rate
end
so during my development process i had to watch these logging outputs with my eagle eyes so that nothing could get out my concern.

why test first development ?

as you can understand from the “test first development approach”, it reflects something has to be upfront.
without developing we can’t test what is going to be developed, but using test first approach it means you are preparing your expectation upfront to get your code working with your expectation. so here what i would have written if i knew test first approach before.

def setup
  # mock currency retrieval web service or whatever requires to set 70
  # as the returnable value from get_current_taka_conversion_rate()
end

def test_should_successfully_convert_currency_with_valid_input
  assert_equal(7000, convert_to_taka(100))
  assert_equal(525, convert_to_taka(7.5))
end

similarly you could have the following test cases
def test_should_fail_to_convert_currency_when_webservice_returns_error; end
def test_should_fail_to_convert_currency_with_negative_value; end

so if you compare this with the above statement where i mentioned “logger.debug” related stuffs.
you can see the difference where this one is more understandable for us to re imagine what our task means to us.
this approach would give us chance to rethink about the task we have chosen (if agile team).

why it has nothing to do with tester test ?

test driven development is for developer to do his/her job properly to ensure better code (less bug) according to his task definition
eg. user stories
as a developer
i want to see my function is working while currency web service is not returning anything

or perhaps


as a
developer
i want to see my function is taking last known currency exchange rate from cache data while currency web service is failing.

or perhaps

as a visitor
i want to convert my currency by clicking on “convert currency” button

or


as a
visitor
i want to convert my currency without refreshing the whole page….

this has nothing to do with 1px design issue, or notification message doesn’t appear immediately or problem from user kinda tester point of view. still we need them badly to bet on burger per bug ;)

so i think i could make sense why it won’t worth anything if tester prepare the test case for developer :p

TDD is to verify our own code
(because client changed his mind, or because we need to support another scenario)

when requirement changes or adds new scope, we have to review our own code to enhance the scope.
here comes compatibility issue, as you can understand old test cases would become the more kissable asset to verify our recently modified code against the old requirements and new requirements. (perhaps some function requires old way to do the job)

TDD is enabling us to run continuous integration and build process

as you can recall what sajjad bhai was mentioning about continuous integration and warning for those (developer) who break the code.
using these developer created test cases we can do this job.
or perhaps we can employ our testers (hardly a few) those who LOVE (or forced to love) to write integration test case.

anyway, thanks for nice afternoon with mouth watering pizza and coffee, wish to see more pizza slices ;)
best wishes,

Written by nhm tanveer hossain khan

January 17, 2009 at 11:09 pm

Posted in agile, test approach

what killed my time to run my first test using “cucumber”

leave a comment »

stucked with “No such file or directory – cucumber.yml” error?
then you must doing the same mistake as i was doing for last 1 hour.

i had the following code in Rakefile

require ‘cucumber/rake/task’

Cucumber::Rake::Task.new do |t|
profile = ENV['PROFILE'] || ‘default’
t.cucumber_opts = “–profile #{profile}”
end

the fix is just keep the following code only -

require ‘cucumber/rake/task’

Cucumber::Rake::Task.new do |t|
end

so are you still facing problem while you are executing “rake features” but it doesn’t come up with any output?
here is the check list – (this list may grow gradually) -
1. do you have features directory
2. do you have features/steps directory
3. lets say you have “features/transfer.feature” file do you know that you must have “features/steps/transfer_steps.rb” file?
4. do you know “feature name” must be prefixed for steps file?
hope this might help you.

Written by nhm tanveer hossain khan

October 19, 2008 at 6:12 pm

Posted in BDD, Ruby, tools

BDD(behavior driven development) with easyb

with one comment

hi,
just wondering is there anyone who started using easyb?
which is behavior driven development framework. if you are not familiar with BDD here is my explanation.

as you heard and practicing TDD (test driven development), (if you follow test first approach) you keep your specification up front through test case.
for example -

public void testShouldCreateAnUserWhenItHasValidData() {…}

as you can see, you are actually writing test case for behavior(specification) for your expected code.
and based on that test case you are implemented your logic in code. this how TDD works. for more explanation google IT :)

in BDD, this process is more simplified, for example if you look at my previous example -
public void testShouldCreateAnUserWhenItHasValidData() {…}

you can find, i have written one scenario when user object has valid data.
same test can be in different scenarios such as, when user object has no valid data. or the caller is not authorized and so on.

so to make such thing clear in java code, it requires code like the following. ie.
public void testShouldCreateAnUserWhenItHasNoValidData();
public void testShouldCreateAnUserWhenItHasValidDataButCallerIsNotPermitted();
public void testShouldCreateAnUserWhenItHasValidDataButCallerIsPermitted();

here how BDD is proposing a new approach of making this thing more fluent through a simplified test framework.
like JUnit, easyb is also another test framework, where you are writing your test context, and behavior in groovy code.

actullay the beauty is test scenario are written following the user story convention
which is similar with the ideal convention
as an Author
i want to write book
so that user can understand me”.
you can also generate user story from the groovy code which you can’t do with JUnit.
so you don’t need to maintain separate document for maintaing user stories.

so when you are preparing user story and you can use easyb and groovy to format your user story rather than using ms word, excel or notepad text file ;)
ie.

import com.somewherein.bdd.UserService
import com.somewherein.bdd.UserServiceImpl
import com.somewherein.bdd.Userscenario “create a new user with valid data”, {

given “an user with the valid data”, {
user = new User()
userService = new UserServiceImpl()
state = false
}

when “creating a new user”, {
state = userService.createUser(user)
}

then “returned state should be true”, {
state.shouldBe true
}

and “newly created user should be found”, {
userService.exists(user)
}
}

when i run this test it says -

Running user service story (UserServiceStory.groovy)
Scenarios run: 1, Failures: 0, Pending: 0, Time Elapsed: 0.649 sec1 behavior run with no failures

so if i ask for generating the user story – it generate the following text

1 scenario executed successfullyStory: user service

scenario create a new user with valid data
given an user with the valid data
when creating a new user
then returned state should be true
then newly created user should be found

this type of practice is very common in ruby on rails based development.
in ruby we have several options, but RSpec is the early comer who showed how cool it could be.

anyway, this is something you should work try EiD vacation, happy test first development.

easyb makes it easy, man

here is an article from javalobby
Is easyb Easy? | Javalobby

you can use it with spring framework, here is the example -
best wishes,

Written by nhm tanveer hossain khan

October 1, 2008 at 5:07 pm

debugging rails internal query execution

leave a comment »

while we were working with somewhere in… ads project we came up with some debugging and performance mesuring tool, here in my post i will describe how you can use it for yourself.

query debugging –
picture-16
query debugging tool logs every executed query from active record and keep them in memory and using assisting template code it display all executed query from the active page.

also it executes query with mysql “explain” keyword. so on the same window you can see mysql query execution plan.
it helped us to track down queries which were not hitting the right index.
this is very simple trick – go through the code below -

module DebugUtil
class QueryDebug
@@QUERIES = {}
def self.add(p_query, p_report)
@@QUERIES[p_query] = p_report
end

def self.queries
q = @@QUERIES
clean
return q
end

def self.clean
@@QUERIES = {}
end
end
end

QueryDebug class keeps all executed query and their explained resultset in to the static array. so later in template QueryDebug::queries is invoked to get all executed query for the current page.

here is how we trap the query execution from active record -

if defined?(QUERY_DEBUG_ENABLED) && QUERY_DEBUG_ENABLED
ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do
alias __existing_execute_method execute

def execute(sql, name = nil)
if sql.match(/^SELECT/i)
report = []
@connection.query(”explain #{sql}”).each do |row|
report < < row
end
DebugUtil::QueryDebug.add(sql, report)
end
__existing_execute_method(sql, name)
end
end

Object.class_eval do
def raise_during_query_debug
raise DebugUtil::QueryDebug::queries.inspect
end
end
end

you can see we have used “QUERY_DEBUG_ENABLED” constant to ensure whether this is enabled by intention.
now see how we are rendering on our template.

query debug

  1. checked
    < %= row.join(” “) % >

we put this code in common layout. so it renders on every page. thats all :)

Written by nhm tanveer hossain khan

September 15, 2008 at 6:03 am