Archive for the 'Tech' Category

Oct 16 2007

Project risk management and Agile

Published by xiaoming under Tech

Project risk management

In terms of project management theory, risk management in a project can be defined into three main activities:

  • Risk assessment and analysis
  • Risk reduction and monitoring
  • Risk management process and methodology

It might be difficult to understand the boring theory. Let me give a real example to talk through how these activities happen in a project.

Imagine, you and your partner plan to have dinner in a fancy restaurant on the Fifth Revenue for your three years anniversary. Basically, you guys need go through the following steps in order to make your wife/husband happy.

  1. Find the number of the restaurant
  2. Call the number and book the table
  3. travel to the restaurant
  4. Order
  5. Eat, drink, sweet talk, eye contact, and etc…. wait, drink more
  6. Pay

In the above steps, if everything is going well, brilliant! However, as you know anything could go wrong in real life, you would not know beforehand. Such as “the number is wrong”, “No table available”, “No texi, or huge traffic prevent u getting there”, “the restaurant forgets booking your table”, “Your wife/husband is not happy with the dishes”, “They do not accept credit card or your credit card does not work” and etc. There are many of them. On contrast, they might not happen if you are lucky. You might discover more risks than I list out. So generally, a brainstorming is absolutely necessary on this stage. Just remember, the brainstorming starts earlier than your anniversary and go through the whole process.

Yes, first thing we need do is to assess and analyse these potential risks and their threats so that you can decide which one you need pay more attention and which not. Let’s make a matrix for these risks.

Risk description Status Impact*likelihood Date
the number is wrong Undefined unknown 15Oct2007
No table available defined Small 15Oct2007
the restaurant forget booking your table identified medium 15Oct2007
Your wife/husband is not happy with the dishes identified critical 15Oct2007

You can easily figure out why “Your wife/husband is not happy with the dishes” is critical for this “project”. Because it might cause a big fight and ruin your “perfect plan”. The impact*likelihood of “No table available” is small because it is not some special occasion or holidays. Generally it is not that difficult to figure out based on brainstorming, assessment and analysis.

During the analysis, you can prioritize the risks by “Impact*likelihood” to determine which risk should be pay more attention and focused on.

So, when we know these risks and their threats, impact and likelihood, how do you manage them in order to reduce the impact to the lowest level? There are four ways to manage risks. They are

  • Mitigation
  • Transference
  • Acceptance
  • Avoidance

In most of the circumstance, we acceptance those risks with small “impact*likelihood” and try to avoid or transfer some risks which can be. For the rest, you might not find a way to get rid of them, so mitigation is the only thing that you can do.

For the risks specified in the matrix above, we can add columns “Strategy”, “action” and “Owner”. The duration of the action would be nice to have.

Risk description Date Status Impact
*likelihood
Strategy —-Action—- Owner Others
the number is wrong 15Oct2007 Transferred small Transfer Find the number on a popular online restaurant service Me N/A
No table available 15Oct2007 Transferred Small Transfer Go to the nice drink place besides the restaurant, and wait for the table to be ready Me N/A
the restaurant forget booking your table 15Oct2007 Migrated small Migrate Call the restaurant twice to ensure that the table is booked Me N/A
Your wife/husband is not happy with the dishes 15Oct2007 Migrated critical Migrate Ask around or search online to select those nice food Me It really depend on my wife’s mood

Next thing that you need do is monitoring the risks and guarantee that all the known risks are under control.

Agile project risk management

Even in agile projects, risk could be much less against waterfall model. There are still going to be risks for a project management team do deal with. So how and when to do it? Who should responsible for the risk management in an agile project?

  • During the inception phase, much brainstorming will be done, so why not identify, assess and analyse some potential risks?
  • During daily stand up, why not the team give a brief update of risk matrix and new risks that you can think of?
  • Any time during the day, when an idea pop up your mind, why not have a discussion with the team members? If it is a risk, record it into the matrix.
  • PMT, as everyone in the team is responsible for risk management
  • PM, as project manager is responsible for maintain the matrix and facilitate weekly risk update meeting.

There are more that we can do for agile project risk management.

Based on our experience, where could risk come from and how it look like could be forecast and pre-prepared. However do not pre-prepare too much. Because every project is different, it might have all different risks across different projects.

There is no short cut to do risk management, just keep an eye on and make sure everything is followed up by someone.

Interestingly, by using lean project management, it could help to identify the risk priority but it does not mean that we could ignore the risk management by focusing on the bottle neck.

No responses yet

Oct 02 2007

Between TDD and Java code comments

Published by xiaoming under Tech

The last day before China National holiday, I got the chance to learn TDD from Hu Kai who is a main contributor to CruiseControl and CruiseControlEnterprise.

Basically, we made up an example for practicing. A good example for TDD exercises is “develop a calculator”.

  • First thing, we did was write a JUnit test for calculator project, based on requirement

    As a user, I want the calculator to have absolute value function, so that I can carry complex calculations.

    with one of the three acceptance criteria.

  • Then run the test. When we saw the test failed, we know that it was time to develop some functions to make the test successfully.
  • After we accomplish the the code part, then re-run the test. This time test passed :-)
  • It is not done yet. Add one more test case, run test. Failed, then improve the code.
  • When we added the last two test cases, test would not fail so it meant that our function was achieved based on the requirement.
  • Next step refactoring code. Done. The code looked neat and pretty

But it looked something missing…… Ah! Comments! Yes, I remembered that the first thing my teacher taught me in Java programming was “Don’t forget writing down your comments, otherwise people would not understand them.”

Hu kai, why did not write some comments in your code?— Xiaoming

You don’t have to because all the tests and code are self-explaining and highly comprehensive.— Hu Kai

Then people in the room had a discussion when should we have comments in Java code with Agile practice. My idea was that for those legacy system, if there were no comments or documents, how could people understood them? Different opinion was to write as high-level self-explaining code as possible. For example, make the names of classes, functions human-readable. I would buy their ideas except in some cases, comments are necessary

  • Interfaces, libraries. Yes these abstract information need comments to help programmers to understand how to use them. We might call it “User guide” rather than comments.
  • Complex algorithm. It would be very difficult for programmer to understand without spending much time on it. So it’d better to have comments for the brief explanation of this section of code.

Meanwhile, functions should be as simple as possible so you don’t have to write comments for complicated ones. Basically breaking down complex functions into simple ones would be a good idea.

All in all, when we initiative to learn something, it always came to the end with more knowledge and experience in your pockets. What a brilliant enthusiasm of learning!

Unfortunately, in most of the university classes and labs, students have not got chances to do useful exercises like this. I highly recommend doing more in our universities classes or labs.

~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

According to Lingling’s question, let me give a real example. Firstly list the three acceptance criteria.

Given a positive integer A ,When I calculate it with abs function, then I get the same number A.

Given a negative integer “-B” ,When I calculate it with abs function, then I get a positive number “B”.

Given number “zero” ,When I calculate it with abs function, then I get zero.

Let’s write the first test case: My idea is to show the logic so it would not be the real code

Public boolean testAPositiveNumberShouldReturnPositiveNumberWithSameValue(4){
if(object.abs(4)=4){
return true;}
else{
return false;
}
}

When we have this test case for acceptance criteria one, and run the test. Obviously, the test failed because we do not have the function abs yet. So let’s try to write some code to make the test pass

Public int abs(a){
if(a>0){
return a;
}
}

Build the code, once you run the calculator tests, it will pass because the method provide the function of test “testAPositiveNumberShouldReturnPositiveNumberWithSameValue”

Then we add another test case based on Acceptance Criteria two

Public boolean testANegativeNumberShouldReturnPositiveNumberWithSameValue(-4){
if(object.abs(-4)=4){
return true;}
else{
return false;}
}

When you run the test, you can imagine that the test failed.

It is time for you to write some code to fix the fail test. Can you do it? OK let me do it for you:-)

Public int abs(a){
if(a>0){
return a;
}
else{
return -a;
}
}

Build, run test, Yeh!!!! Test passed!!! Even when u try the third test case, it passed either. It means that you don’t have to write more code about it. This is the beauty of TDD

Next step code refactoring. You may use Math.abs() to replace that piece of code

So, let’s answer your question one by one:

  • Is each test case designed to test one of the three acceptance criteria?
  • The answer is “Yes” You can write the three test cases all together. However I highly recommend to write each by each.

  • How do you define the test is “failed”? e.g. If the result data is not “exactly match” the expected data? or the test doesn’t run properly?
  • I might not need answer this question. If you do not have the function to satisfy the JUnit test, the test would definitely fail. If you are familiar with Eclipse you might easily understand what I am talking about.

  • Why did you “pass” this test with only one test case for each requirement?
  • The beauty of Agile is to do every little bit each time then increase little by little. As soon as you find out that no more code is needed, the job is done!!

2 responses so far

Sep 28 2007

Is Agile a good idea for product development?

Published by xiaoming under Tech

Talking about Agile practice, people might say that it is a better way to develop a project or product because with this practice, the team increasingly add value to the users or customers. The difference between software development of a product and project is that a project has explicit user and customer targets but product. Clearly Agile has advantage in facing unspecific requirements, and eliciting requirements. In Agile, we can not tolerate indistinct business/requirement analysis based on assumption. We want to know what user/customer really want, what their basic requirement are, what they prefer to have or nice to have. So during the software development life cycle customers can see the value in very beginning period and users can help the team to improve the project in a very positive way.

Compared with project, product development have two major difference. First, for a product, there are target customers while potential customers as well. Even ideally we can interview all the target customers (in practice, it is really not that possible) we still can not have all the requirement explicitly there. So assumption is inevitable. Basically assumption bases on product manager and business analysis’ experience, maybe domain experts could contribute too. The other reason is that a product must be very creative from marketing perspective. You can imagine that a product without a few new idea would never be bought by consumers except you have great price advantage. For example, iPod would not be able to interview every single customer in order to achieve his satisfaction. Microsoft would not lead the marketing if they was trying to collect the requirement from millions of real users. Obviously, they did interview people, had lots of research before they decided to approach this new functionalities.

So, is Agile the right way in software product development? The answer is YES. However, you can not follow all the rules in Agile. And eXtreme Programming, pair programming, scrum, TDD also work here as good practice because they do not depend on requirement analysis results. All the advantage of Agile can be taken in the team such as flexible and fast changing direction.

Bear in mind, the core spirit of a product is creative and different. Sometimes we have to abandon the rules, policies with the price of high risks. In this case, risk management should be highly concerned.

4 responses so far

Sep 26 2007

Who manages a project, project manager or PMT?

Published by xiaoming under Tech

From project management theory there might be no argument that a project
manager is the one who manages a project via the full project life
cycle. In IT projects, especially software development project it is even
more typical, project manager is in charge the whole thing.

However in those multi-million dollar projects, such as energy, chemical or hydrocarbon, there was a Project Management Team (PMT) who manages the project rather than a single person (project manager). The advantage of doing it in this way is that people who have different expertise should be responsible for their own areas and have the power to make decision across the whole project. Of course project manager is the one who coordinate these experts and make them work as a team. For instance, project controller, cost manager, procurement manager, HSE manager, and etc should play a totally different role and have the power to rule the project from his perspective. In the project that I used to work on, it worked very well by this model. It was a hydrocarbon project called LNG (Liquid Natural Gas) project with more than 1 billion budget and about 5 years duration. The project manager has huge trust on each discipline who is expert in his own area with years of experience. So it turned out to be project manager plays an coordinator’s role and focused on managing risks, changes and resources.

The same model can be applied to Agile project management too. Fortunately, there are some practices already, such as letting dev drive the estimation of stories, QA being in charge of the test strategies and plans. Furthermore, there are other issues that could be considered to be managed by PMT rather than project manager. Actually there is nothing that should only be managed by PM and for each discipline, the decision should be made by the expert with expertise.

So it would be the responsibilities of all the team members of managing a project. Everyone plays a role in managing a project and makes decision. Meanwhile all the decision should be made by certain discussion and communication with the whole team. For example, let developers drive and own all the development tasks, let QA own all the testing and deployment tasks and let IM/BA own all the customers requirement tasks, iteration planning. Every team should play a role in the risk management, change management and project controlling.

In this case how important is a project manager in a team and what should a project manager responsible for and focus on. Basically a project manager is responsible for coordinating a team of talents, supervising cost controlling, people management, team build and etc. Certainly a project manager is crucial in a project however with absence of a project manager the project is still can be carried by project team with self-management. The idea of doing it is to ensure that there is not absolute key person for a project.

Someone one might argue how could make it happen in real life and real projects? The answer is that you have to bring the right people to the project and let them do the right thing.

A project manager or lead might be the most goofy guy in a team but he is the one to organize and coordinate a group of talents people to work together. This is his expertise!

No responses yet

Sep 26 2007

CTR and Project management

Published by xiaoming under Tech

Eight weeks ago, I joined ThoughtWorks as a Business Analysis. Now, I am writing this post to talk about some ideas of Agile project management what the best practice of Agile project management could be in my opinion.

The most interesting topic of Agile software development practice is project controlling. It is fairly difficult to see how the controlling works compared with traditional software project management. Talking about project control, which includes schedule, cost control change and risk management. In most of the cases, a cost controller(or PM) is responsible for make the cost control strategy align with the schedule control methodology. So, how to do cost control in Agile project?

Let’s talk about the schedule in Agile project first. It relies on the control of iteration schedule, velocity, time box for spike and etc. The duration of an iteration that matches estimation will be considered as how long an iteration was supposed to be done. Plus time box strategy. But we do not see how resource, time and cost related to each other. So how could a project is managed without considering of these three key factors and the relationship of these three key factors?

Actually, there is a methodology called CTR which can solve out the problem in practice. It is fairly easy to understand the theory but really need much practice to make it work well during the whole project life circle . In other word, it requires many “Go-Bys” to improve the system. How does CTR work in Agile project? Let’s have a look how CTR works in traditional project management.

CTR stands for Cost-Time-Resource. One item of CTR comes from the experience of many projects and practice of the industry. The definition of a standard CTR is that to complete one standard workload-man-hour how much cost-time-resource it requires. The system collect average CTR across projects then get an average value of it. Also CTR need to be maintain up-to-date.

Let’s have a close look at why we need CTR and how CTR works on an Agile project.

When we estimate the duration of an iteration, instead, we can estimate the CTR of an iteration, even of a release. For example, a standard CTR means one standard cost+ one standard time+ one standard resource. An iteration might need 20 CTR in order to complete it. So for Tom and Jerry pair, they are supposed to complete 10 CTR and Joey and Ross are supposed to complete the other 10. Tom and Jerry can contribute 2 standard resource+1 standard time+ 1 standard cost. 2*1/1=2. It is 2 CTR for Tom and Jerry to work one pair hour. Ross and Joey pair can contribute 4 standard resource + 1 standard time + 2 standard cost. 3*1/2=1.5. So it is 1.5 CTR for Joey and Ross to work one pair hour. The reason is that Ross is a senior and can contribute more, at the same time, he costs more. So there are options here, we need use more high value/cost resource if it is not against resource development.

OK, as I said the standard CTR comes from previous project experiences and industry practice. So it really require lots of project experience in order to have a more valuable CTR. Fortunately, some companies have been working in this business for more than 10 years. The standard CTR can be calculated into a reasonable value. So the workload of each iteration can be trade off as amount of CTR, we can call it IterationCTR. What a project manager/iteration manager or project controller need do is to make sure the amount of CTR that they spend does not beyond IterationCTR, so that the budget is under control. It means that project manager need put right resource on the right job, especially those senior people.

 

Certainly, a project manage not only control the CTR, there are lots of other mission need him and the team to complete. About project schedule and cost control, there are still two things that we can do to guarantee the project is in good shape.One is change management and the other is risk management.

How to do change and risk management, I will talk later. Meanwhile, some other topic about Agile project management will come out sooner or later. They are

  • Project manager and Project manage team.
  • Remote project management
  • How to manage customer
  • How can BA play a more important role in Agile project

No responses yet

« Prev

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.