Tuesday, December 29, 2009

What am I doing here?

Have you ever been on a project where everything seems to be wrong? A project when even doing the right thing seems wrong? A project where nobody does one thing completely without problems? A project that is so complex and big that nobody is able to see how the pieces fit together? A project where as soon as there is a change in any piece everything else start failing? A project where nobody feels responsible for anything? A project where managers just want you to do something with one goal "make him look good in front of upper managers"? A project full of wishes but no requirements? A project you are not proud of being part of? A project everybody ask themselves... What am I doing here? Well, I have been in projects like this, and I would like to share my thoughts on it.

I would like to start with a story.

The Story

There was an ancient community living on a desert. They always saved a lot of water on the rainy season because they knew they had to survive with it when the dry season comes. They did that year after year for long time. They had to work really hard, and moderate their use of water to be able to survive.

A particular year, an elder of the community started to practice a ritual. A ritual dedicated to the god of rain. It consisted on stepping over a small rock, and pray to the god of rain very hard. If his prayer were good, then a big rain will start. The elder knew when there was about to be a rain, and he used that trick to convince people the god of rain existed. Therefore many people started to believe in the god of rain, and thinking he will be able to give them rain on the dry season.

That year, the community saved lot of water for the dry season, while the elder keep praying to the god of rain before each rain. Somehow that year they had rains over the dry season, so everybody was really happy and celebrated. They finally found a solution to their problem. They just have to pray over a small rock to the god of rain. The god of rain was going to give them rain whenever they need it.

The dry season didn't appear for many years. It was a great time for the community, because they finally got time to do other things, things they always wanted to do. After a couple of years, everybody forgot about the dry season or saving water.

A few years have passed, and they started to stop praying to the god of rain, because they had more important things to do. They were doing things like looking for the best outfit or coffee in town. Unfortunately, a dry season came back, and the whole community started to run out of water. They thought it was because they stop praying, so they started praying to the god of rain again. Another month passed, and they look at the elder for answers, what is happening? Why is not raining now? We are running out of water. The elder had the answer for them, "you are not praying hard enough, or you are praying over the wrong rock". Everybody run for find a rock to pray on it as hard as they could, but still they couldn't get any single drop of water from the sky.

A few months later, everybody was desperate for water. Everybody in the community blamed everybody else, because other don't pray as hard as they. The elder kept telling them, they were not praying right, so the god of rain got mad at them. Many people from the community left it in search for water somewhere else. The ones who stayed died before the next rainy season arrived.

What does the story has to do with my failing project?

You might be asking, "What does the story has to do with my failing project?"

Blame everybody else
The first thing that happens when project starts failing is everybody points their fingers to others. People blame others, because nobody followed the process as hard and good as they did. Nobody wants to be responsible for anything, because they know it will be used against them. Everybody always have a reasonably good excuse not to do things right. Nobody is able to backup what they did in the project. Bottom line, nobody and everybody at the same time is responsible for the project failure. As you go up in the hierarchy, more weight you have in the results of the project, so more responsible you should feel.

A process leading to nothing
Nobody ever asked themselves if there is actually a god of rain. They blamed how others followed a process dedicated to a god that does not exist. None was capable to realize there is no god of rain, and they had to start collecting water again to save them. Nobody wanted to challenge the elder just like nobody challenges managers. And if you do have the guts to do it, most of the time your manager will put you aside, because that is not the right attitude. They will also tell you it is because you are not praying hard enough. It will never be because they are asking you to go in the wrong direction, in a direction that only creates more problems. It seems like being wrong is the worst sin for a manager.

The Parasites
There will be plenty of villagers telling their peers, "I always knew this was going to happen". That was their excuse to do nothing, neither collecting water, nor praying over rocks. I'm sure you have this type of people in your failing project. They are parasites, they live from others effort, and they are no able to do anything on their own. Everything is always wrong, or others made it so complex, that they are not able to explode all their potential. They limit themselves to do the least possible, because they do not feel valued. They could also spend their time doing a side project for their aunts to organize weekend dressmaking workshops. The only way to get value from parasites is to push and control them all the time. You might need to evaluate how much time a manager has to waste to have a parasite doing something right.


The Followers
These are the guys who just follow orders. They do their work, and leave on time. They are committed to do what is asked, but they will not seek for any highness at work. They are there to do what they are paid for. With a good direction, followers will be enough to save your project. Still, as soon as the project gets into trouble, they quickly search for other places to work. Their commitment to the project increases as they get benefits from it. If they are not enough benefits for them to justify staying, they will leave.

The Lifesavers
If you are lucky, there will also be a few member unconditionally committed to the project. They will be overloaded, trying to get the water out of the sinking boat. The parasites will stick to these guys, because they know those can help them. Lifesavers will be able to fix whatever they can't. The lifesaver will assume the responsibility of the job because that's what they naturally do. It is easy to recognize a lifesaver, will be the one everybody asks questions, the one everyone runs for help. He might not be able to do things perfectly, but he is able to do things. Once the lifesaver passes his limits, he will leave searching for water somewhere else. If you are not able to create an environment to maintain them, you will only keep the parasites that are not even able to leave. Once you run out of lifesavers, the project will just sink faster.

Process Managers
There is an elder telling them which process to follow and they weren't doing it right. Same thing you get from your manager when the project is failing. They define or inherit a process to follow for the project, and they think by just following the process they will lead to results. They only focus on the process adherence, instead of looking to add value to the project.

They spent their time updating reports, and asking for time logs, status updates, and looking at to-do lists. They do not care what the lists are about, or why you had to spend twice as time as you should. They never review what has to be done, just review if the process was followed. They do not attempt to create a process to add value and reduce waste. They just aim to copy something they learn from internet or on a two day course. If there is no value in the project coming from managers, then for sure the project will fail.

The only way they know to save a project from failing is to push the team harder. Sometimes this works, because parasites need to be pushed to get them doing something. Most of the time, they only get something from the lifesavers, putting those on the verge to leave.

Value comes from people, not from the process. The process will only help to increase or decrease the value from people. If your team cannot create value, then the process is useless and might just waste the little value the team has to give. If you cannot get value from the team, then you need to stop, reconsider and start again.

Is leaving the only option?

First think what a project is. A project is created with an objective to generate value, with a time frame and limited resources. Projects are used in companies just to give work a frame or boundaries, to make it measurable and manageable.

Can a team provide products or services without doing it in a project? Yes, they can, and they are probably better without projects, because they can really focus on what is needed when it's needed.  They will be completely based on value driven work.


Some companies are project driven, some are value driven, some are wish driven and some are not driven at all. If a project does not have an objective to create value, a time frame, and resources well defined, then you should reconsider your project, and call it a wish.

Wishes are the main cause of failure, because a wish is hard to express and understand. A wish is not measurable or manageable. They are hidden as projects and the lack of measure gives management the sense of everybody is not working hard enough. Management sets an impossible end date to make the lazy team work hard. That generates the sense of failing to all the team. This causes every body to run and trash things to get to that impossible date making things worst.

Your management expects everything to be done by the end of the time frame without committing to the project at all stages. Your management only focuses on process adherence and not on how to get more value from the team. Your are working on a wish without realistic planning and measurable goals. Your company does not create an environment to keep the guys who can make a difference. You should start asking yourself  what am I doing there?

Monday, November 16, 2009

Offshore Development - Dream or nightmare?

I've been working doing offshore development for 5 years already. Through those years, I learned some really valuable lessons. In this post I will try to go over the benefits and problems it arises.
I will start with the first question you should ask yourself before considering offshoring.

Why do you want to do offshore development?
There could be many answers to this question. You could answer you are an NGO doing charity, giving people across the glove a good salary and a good life, because they are from a country with few opportunities. You could be an open source application and find a great committer in a remote location. You could say it's because you cannot find enough skilled people to do the work you need in your own country. But most of the cases it's just to cut costs. You want the same you get from a developer in your own country, but pay him a lot less. Even if it’s because you need to scale up and down as you need, offshoring is about cutting costs. People waiting until you want to scale up costs money too, same as scaling down when you don’t need them anymore. Yes, this does not sound idealist. It is not to make the world a better place. It's just to save money for wealthy rich people. Ok, I think I made the cost cutting idea clear. I'm not against cutting costs; actually I would love to be able to do the same with taxes. Now, this takes us to the second question you should ask yourself.

Do the savings justify all the hassle you get into by offshoring?
I would say it does. That's why many companies are offshoring right now, and more and more after the global crisis are trying to do it. Salaries of offshore developers range from 1/2 to 1/5 compared to developers in Europe or United States; this is depending on which country you offshore to. By just looking at initial numbers, it seems like it's the best deal of the world. Why wouldn't you save a lot of money on your overpaid IT salaries?  So far things had never been a dream with your local developers. That takes you to your third question.


What do I have to lose by offshoring?
The worst thing that could happen, it is to waste all the money you invest in the project. Normally, you will not get what you wanted. A very few times, you will get a decent application that meets your needs. You could also risk losing all your local people who knows about the application, the business and the project if you do no make them part of the bigger picture.  There is one thing for sure; many things will be more complex to do. If you are not able to overcome the increased complexity, you are more likely going to get something really different than what you ask for. Development will also take a lot more time than you initially thought it would.

Which things are more complex by offshoring?

The most complex thing is communication. Communication is not only about being able to talk over the phone in this case. It is being able to send a message, and that message being understood on the other side of the world. It’s not only about speaking the same language; it’s about being able to share the same language. If the team does not have a common language, everything else will be harder to share. By doing offshore development, you are already starting in disadvantage. The offshore team usually not only speaks a different language, they also haven't met personally the onsite members. If the team members are not able to leverage themselves by sharing their knowledge, then the distance between local and offshore will increase.

The time zone difference is also a factor that could complicate things. If you share most of your working hours with the offshore, you can consider them nearshore. If you shre little or none working hours with your offshore team, then you think about farshroe. Nearshore is simpler, and easier to manage compared when you do farshore.

If you want to do software development, you need to reduce as much as you can the differences between local and offshore teams. Reducing the differences will allow you to create a common language faster. First, think about one team, and not “them” and “us”. If you start it like this, you are already making differences. If you cannot trust your offshore team to do design, why would you trust them to implement your design? The more differences you are not reducing, the harder the communication gets. If you like lean software development, think about differences between local and remote teams as waste.

Culture is also a big difference to overcome. If you say “are you crazy?” some people could think they are doing everything wrong, when you actually wanted to tell them it is great. Some cultures also make people shy, because they are not able to freely express their feelings.  They reflect that on their work too, so you need to be twice the time more open to suggestions that you would normally do with people from your own country to get the desired effect. Again, building a common language is critical.

Which are the consequences of not having a common language?
The offshore team will go much slower and also going in wrong directions. Going in the wrong direction in software development makes the team work twice to get it back on track. This could mean your local team has to do this work because the offshore team will keep going in the wrong direction, or investing more time having your offshore doing it better. This could be the main cause offshoring your project could be more expensive than doing it right locally.

A lot of time will be wasted in communication to assure the offshore team understands what they need to do. This could mean endless meetings between local and offshore members discussing and trying to understand what is needed. If the team shares the same language communication time is reduced greatly and is more effective. Also endless meetings over the phone drive local and offshore teams crazy too. Nobody likes to be in a meeting over the phone for 6 hours, especially when it is in a different language. People get lost in the middle of the meeting. Details get more important than important things. Then you end up with your offshore team working on pointless details instead of things which add value to your business.

The offshore team will not be able to add value to the application. The offshore team only does improvements when they come from the local team as the direction to go. They do not know enough to improve things on their own, and communicate them effectively. Over time, any improvement attempt will stop, and they will only work on the requirements as they come. You need to get to the point where the offshore team is able to suggest and implement changes and fixes. If you are not at this point, you need to keep working on building a common language.

How do I build a common language?
The best way to build a common language, is to have your team interact. This does not mean talk over the phone, it means getting them to know each other. The best way to share things is by face to face contact. So the best thing is to get the team in the same place for some time and have them working together. This should be as mixed as possible, and aim to have everybody interacting with everybody as much as possible. Sometimes having the whole team traveling and staying onsite could be expensive. If you cannot afford it, then try to get onsite the offshore key players. They would be able to solve team differences faster when they are back at home. This also should not be once in a lifetime; bounds need to be reinforced periodically. This gives the offshore team a sense of belonging which is really important. If you don’t think you are part of something, you will hardly commit to it at a point where you make a difference.

Video conference is also very important, because it gives faces to the voices. It’s easier for a person to relate to another face than just to a voice on the phone or a signature on an email. It will help also to share the body language, which is sometimes as important as the words coming out from a mouth.

People on IT are known to be hard to deal with. They are not very eloquent, they do not have great acting skills; they are not best speakers. Why would you think it will be different in your case? If you do not invest on building a common language, the communication problem will be really hard to overcome. Initiatives will lose momentum right after they start making things harder to change the course of the project.

Is Offshore development a dream or a nightmare?
It will certainly not be a dream. It will allow you to reduce costs, making some projects possible. It will allow you to access really good development teams at an affordable price. If you are able to build a common language for the whole team, you will be able to reduce your costs considerably, and also be able to reduce the time things take to be developed. Building a common language is the most important thing when doing offshore, if you get to do it, you will get great results. If you omit this step in your offshore development, things will more likely turn into a nightmare.

As I said in the beginning, offshore is all about cutting costs but if you cut them too much, you will get the undesired effect. Frequent travels, reducing differences between local and offshore teams, video conferencing do make a difference when you build a common language. Not having a common language makes things take a lot longer, be more expensive and less likely to be what you expected.

Is it possible to do distributed Scrum or Agile software development?
I would not ask if it is possible, I think it is a must. As I said before, building a common language is all about the people interacting. Scrum and Agile, are in their roots about the same. Having daily short focused meetings allow people to build a common language. Visibility of project status and progress is clear, because you measure it with working software. Many practices from agile methodologies are of great help, such us continuous integration, testing, pair programming. These practices also help to build a common language, and reduce time spent trying to see which change broke everything since the last time the code was tested all together.


Waterfall is about interacting through documents. Documents are the worst way to build a common language. Documents hide differences, and they are often seen at the end, when you are already late to mitigate them. Maintaining documents is a tedious task and costs money too. You will also spend a lot of time on long meetings trying to explain what the document is about, instead of discussing what it's needed. Visibility of progress and project state becomes very fuzzy, I could send a document saying everything is about to be done, when it’s not close to it.

Conclusions
Doing offshore development is not only about the salary of your IT people. If you just look at that, you will only get the false perception of cost reduction. If you do not invest on building a common language, there are other things you will have to consider. Development will take longer than you initially thought. You will get a different product than you expected. Offshore development is not a dream or a nightmare. It is just like anything else, if you do it right, it will resemble a dream, if you do it wrong, it will be closer to a nightmare.

Monday, November 9, 2009

Agile, Chaos and Evolution

Let's get started with my simplified version of evolution. I'm not an expert on this, but Internet can turn any mortal with some time into anything.


Evolution in nature
Imagine you have a bunch of cells forming an organism. Each cell has a copy of the organism's DNA. The fitness measure how successful is an organism in its life, . The better the organism does during its life in the environment it is, the higher the fitness. A mutation is defined as cells having different DNA than the parent cells, due to a wrong copy of the DNA.

While the organism is in a stable environment, it will reach an equilibrium fitness value. When the organism is close to its equilibrium with the environment, the cells that mutate fast are suppressed, favoring the ones that mutate slowly.

A chaotic environment is defined as an environment that changes randomly and you can't predict it's future with certainty. It's also been seen that in a chaotic environment the organisms will favor the cells that mutate fast. Those will be picked by the organism in its effort to adapt to the environment. Once the organism starts adapting to the environment, fitness will stabilize, and the organism will go back to favor the less mutating cells.

Having too many mutations does not always mean the mutated cells will increase the organism fitness, it might take it to death too. Some mutations are good, and those should be the ones the organism needs to keep in order to survive to the chaotic environment. There is a cellular mechanism, which attempts to fix bad mutated DNA in order to prevent diseases and increase overall organism fitness.

Actually this is natural selection, the organisms who can adapt will survive more time, being able to reproduce more. While the ones with a lower fitness have lesser chances and time to reproduce, disappearing over time.

Some organism might found a perfect fitness for the current environment, conquering the world very fast. Later on there could be another environment change that could cause that particular organism, to quickly die, or other organism could mutate and feed from the previous organism. Perfect is enemy of good in this case. Perfect means everything is in order, everything works as it's supposed. If something is not in order or does not work, everything falls apart. While good searches for redundancy allowing the organism to survive if something does not work. It's better to be good at many things, than great at only one.




Evolution in software development
Now imagine your development team is the organism. The people in the team are the cells forming the organism. The organism DNA, which has been copied to each cell, is your development process. Each person has a specific copy of the DNA encoding. Management is the cellular mechanism in charge to control the cells do not mutate with the wrong copy of the DNA.


Predefined DNA
Some methodologies allow you to define the development process. This is similar to create a DNA for your organism. They let you know how the DNA should look like. You can make some changes, adapt it to your environment and use it to your organism. The person or team creating the DNA will attempt to create it perfectly. The DNA is in the organism before the cells that make it. If those cells cannot create an exact copy of the DNA, you need a strong cellular mechanism, to enforce the exact copy, or remove the bad cell of your organism, like a cancer.

Once you get into a chaotic environment, the cells will mutate at a faster rate, thus management will have more work to enforce the perfect copy of the DNA. This is because changing the DNA is expensive. It's expensive because it's complex and it was defined by a 3rd party. It takes more effort to change it than enforce it. The energy of the organism will be wasted on preventing mutations of all kind, reducing the ability of the organism to adapt to the changes in the environment.

Fitness is measured by achieving milestones in the schedule. In a chaotic environment those milestones have to change. You have to rework your project plan, your schedule, etc. to keep you milestones up to date. If you are not able to keep up, this causes wrong measurements of the fitness. Often the resulting fitness will only be seen at the end of the project, when it's probably too late to fix it.


Evolutionary DNA
Looking at Agile approaches I can see the DNA is not injected or defined by 3rd parties. It's grown from the cells in the organism. Each cell gives a piece of their DNA, to generate the organism DNA. The way to measure the fitness of the organism, is working production code at the end of the iteration. Once the iteration is done, the cells are able to improve the DNA causing mutations, exploring better alternatives to their particular environment. Once they get to their next iteration, they will be able to check if the mutation improved or reduced their overall fitness. The cellular mechanism should focus on preventing bad mutations, the ones that reduce overall fitness.

Agile methodologies only define a basic ceremony, which initially you need to follow, unless you are very confident of what you are doing. Once your team starts getting close to the equilibrium fitness, means everybody knows what they have to do, without have to introduce more changes in the DNA. This is the point where you will start favoring less mutating cells. This is the point where you want to get to, have a self organized team, which can react to the development needs.

Why Agile rules are so basic and simple? It is because they aim to set the most basic healthy DNA, from which you can evolve. Why it's so hard to implement them? This is because evolution is not easy. At first, all your cells will fight to make it to the organism DNA. You should start from the most basic healthy organism, and evolve to overcome the problems. Do not start from an advanced DNA, because it is complex to change, and you will end up with a powerful cellular mechanism to enforce it instead of focusing on evolving healthy.

Mutating the DNA and enforce it, is no longer a management task. Management can focus on avoiding bad mutations, which could cause diseases in the organism. This is not always easy, because there are a lot of cells in the universe which have a really twisted DNA. Starting from a wrong DNA, could turn your project into failure because you will need lots of iterations to get to a point where things start happening. If you do not have good cells in your team with healthy DNA, you need to invest precious time and money on training, and aim to maintain your good ones.


Healthy evolution
When you start from the basic organism, to evolve in the right path you need to focus on the basic agile principles:

-Focus on improving your fitness with continuous delivery of valuable working software for the customer.

-Focus on decoupled code to prepare your application for changes. Do not create your own internal framework to solve common problems because it increases the complexity when they are not common anymore.

-Focus on testing, to prevent new changes from breaking your application, reducing your fitness in the future.

-Focus on refactoring, change your code base to be simpler, better and avoid duplication. Learn and architect your application through this.

-Focus on having motivated and healthy cells, because that's what makes better the organism as a whole.

-Focus on interactions and knowledge share. If the cells do not know what to do, they will easily mutate in wrong DNA. This will also give you redundancy, allowing your organism to survive when it lost the head.

How Agile helps to evolution?
There are very important pieces in scrum that will allow and even force you to evolve. One of those is time-boxing. This is why you have time-boxed iterations. This is why all your meetings should be time-boxed. This is why you need to set a limit in the time you spend discussing issues. This is another factor that creates a needed amount chaos for the team to speed up evolution. If you couldn't get any production code at the end of your iteration, you need to evolve. If you couldn't get enough information from the users in the meeting to continue, you need to evolve. If you couldn't prioritize all the tasks you needed for the next iteration, you need to evolve. If all your team is locked waiting on the only person being able to do a task, you need to evolve.

You need to remove obstacles as fast as possible. This creates a better environment for the organism to evolve healthy. If your problems are not quickly overtaken, you team will mutate with wrong DNA in an attempt to continue with evolution, causing bad long term effect and diseases.

Have a small and well prioritized list of tasks to do next. Continuous big shifts in the direction of the project will accelerate mutations. This will create constant chaos, too many mutations and bad fitness measurements to ensure things are in the right path. You will end up with a bad DNA, and no compass to guide you in your evolution.

The team is what makes everything. If your cells are not healthy, they will make your organism sick. Fitness will be reduced, not because of wrong DNA, because the organism is sick. Aim to keep them happy. If you want your puppy to do all the tricks you want, you either need a big stick or bacon in your pocket. The big stick never works in IT, people leave their companies just because they don't like a framework the company is using, imagine if you scream at them. A good piece of bacon is what works. It does not mean overpay your employees, there are many ways to find out what would motivate them, spend time in this, it's important.

Why Agile does not solve my problems?
As I said before, Agile focused on the most basic healthy organism which you can start from and principles you have to follow to evolve healthy. It cannot impose a solution to all your problems, because it will not be able so solve others problems. If Agile would present a complex DNA for you to solve everything, you will not be able to change it and you would need again strong management to enforce it.

It's not paradise; you will get into many problems too. Where to go? What do I have to change to be better? You cannot keep changing everything in your DNA after each iteration. In the end, you will get nothing, even less than if you enforced any other more complex DNA.

If you solve problems you don't have, you are wasting energy from the organism in things that do not increase your fitness. Aim to solve the problems that reduce or prevent your fitness to be higher.

I said you need to evolve to overcome your problems. Sometimes the hardest thing is to realize what your problems are. If you don't know which your problems are, you need to spend more time reviewing the roots of those. If you are not able to deliver working code at the end of the iteration, aim to do the smallest thing possible, and grow from there. If testing of current code is impossible, aim to create code that can be tested, and decouple pieces as you can. Doing the simplest thing exposes your problems clearly. Doing complex things will easily hide them.

You know your problems, but they seem hard or impossible to solve. This case is simpler, try to waste as little as possible to overcome them. For this type of problems, seek help in Lean Software development principles.

Conclusion
Start from the most basic DNA and evolve to overcome problems. Do not start from complex solutions, or you will need strong management to enforce it, wasting energy. Aim to reduce waste from your organism. Aim to be healthy and do anything to increase your fitness; this is in the end, what will allow you to last longer.

sources:
http://www.obitko.com/tutorials/genetic-algorithms/index.php
http://www.talkorigins.org/faqs/evolution-definition.html
http://www.jstor.org/pss/3067634
http://evolution.berkeley.edu/evolibrary/home.php

Friday, October 23, 2009

Software Development is like buying a car, You never get what you wanted

I like the analogy between software development and buying a car. There is a car you would like to have, there is a car you can have, and there is the car you get. Unless you are rich, the "car you like" is never the car you "can pay". And most of the time the "car you get" is not the "car you can have". Why does it happens the same in software development? There is an application the users would like to get, there is an application you could potentially build, and there is an application you end with.


Imagine when you ask anybody, which type of car they like, without any budget restriction. They will be describing the car they would like to have, because they do not know the cost of it, they don't have to think about anything else other than the features they want, "red, wicked fast, leather seats, chick magnet, starts with an F and ends with errari".




You realize that is impossible, so you make some suggestions on what is feasible with the resources you have. Then you show them what they could have, "it's blue, not so fast, does not scare chicks, starts with a T and ends with oyota".


Then you start looking deeper about the car and what you can get, things that are not needed anymore, the other things are needed like a big cargo area, it should also be very light, doors are not critical, the budget gets smaller and smaller as you spend money and time going over the bigger cargo area and low weight constraints, so you end up with a Citroën Méhari.


Once you appear with the car at the front door, they will complain about it, it's not as fast as they expected, it doesn't heat the seats, it doesn't have air conditioner, etc. And even when you actually do not like the car, because it's not what you expected either, you have to start explaining them why. "Well the budget was low and we had to get the car very fast, and we spend a lot of time and money going over the changes you wanted, like the cargo area and the weight constraints, so this is what we could come up with."


Not only you have to deal with that, you also have to deal with the mechanics behind the car. Your good mechanic will complain, because it's not fuel injection, which is the last trend in cars, and the guru mechanic who created the initial piece of the warp core is gone for a better paycheck to a company building "The Enterprise". Your internship mechanic was not be able to understand the warp core and broke it, so he replaced it with a 2 cylinder engine.

Have you seen this happening in your projects?
The business team just expects results, without committing to the project because they are too busy making money. They don't even care how you do things as long as they are done, and complain to the CIO when anything is not what they expected.
Managers get lost with endless list of development tasks, and spent most of their time updating project plans after every meeting with the business. They also create tasks for everything the business team ask for and put them with the highest priority.
The development team is creating the warp core because it's a technological challenge but not working on the reports because those are just SQL queries with a nice format. The code is crappy because the development team had to stop in the middle of the warp core and mix it with some solar panels because somebody said solar power is the way to go, and then changed to a 2 cylinder engine to make it at least work.


The craziness I just described is day to day job for many people. This craziness creates the perfect alibi for everybody not committed to the project remain in the company, just doing the least they can like parasites. This craziness prevents the good people to be able to change things for better, because it takes them 4 times the effort of what it should be, lose hope and eventually leave. This also makes management not to trust employees, because the parasites are silent all the time without any idea, and the ones committed and with ideas have to work extra time to try to make them real, and sometimes it just turn impossible. A general sensation of failure is created making things harder to change.

Many companies would like to have a Ferrari at the price of a Méhari. Those do not like to pay the price of maintaining a Ferrari either. It's not the same insurance fee, not the same mechanics, and it's not the same oil consumption. Some other companies are rich, and can afford the price of a Ferrari, even when they spend 5 times the actual price of it.

So, what do you need to get the application you want?

  • Good people in your company trying to do the right thing. 
  • Commitment to higher quality. 
  • Good management pointing the right direction as a company with common goals for business and IT. 
  • Good communication between and within teams.
    If you lack any of them, you will never get the car you want, or the application you want. You will only get some pieces of it and most of the time a lot less than you expected. You will always get a Méhari.

    Monday, October 19, 2009

    Is Agile only for fearless companies?

    Why is it so hard to implement an Agile methodology in some places when it looks so simple?. I think this has to do with fear, and how fear affects people. Let me show what happens many times with this dialog. It's between an Experienced Project Manager (PM), and a Agile Mentor (AM) in a big company:

    - PM: When will we be done? I told them we would have things done by last friday, and they want to kill me already!
    - AM: This is the first question managers ask when they turn to agile. There are many ways to know that, you can use your old method if it ever worked out for you, but it doesn't seem to work this time. The best thing to do, is to be real about it.
    - PM: What do you mean with "be real"?
    - AM: it means, you cannot break the sound barrier in a chariot, no matter how many horses you want to use or have a baby in 1 month with 9 women.
    - PM: That is far from my reality, so... what do you actually mean?
    - AM: That means, you can only guess, and the less you know the worst the guess will be.
    - PM: If I only guess, then Agile is not being of much help! Give me back my money!
    - AM: Sorry, no refunds... but the answer you are looking for is, this is an empirical process, meaning, you learn from observing.
    - PM: I can observe that you are doing nothing for me so far, so tell me when I will be done?
    - AM: Easy answer, if your team velocity is 10, and you have your users stories in your backlog estimated by the team for a total of 200 story points, it will take you about 20 weeks.
    - PM: my stories are not estimated by the team yet, so that doesn't work for me.
    - AM: see, agile is already paying for itself, that means you need to at least estimate your user stories to know when you will be done.
    - PM: Ok, imagine I get the user stories right, and the team estimates them in the story time meetings, and it works as you said, that means we will be done in 20 weeks, not a day more!
    - AM: No... you still don't get the essence of it, it will be highly impossible to have it by that exact date, since that was a guess when you knew little.
    - PM: WHAT! Then... you owe me money boy!, this is not what the business want to hear! They want results!
    - AM: You just say it, results, not lies!
    - PM: Ok, you got me on that one, then, What do I do?
    - AM: Ok, after each iteration, you will show them the progress of the team, we will make this very clear. Also you will know the updated team velocity, allowing you to recalculate the remaining work, and give them an updated competition time. Which will be more accurate than last time.
    - PM: But... hmmm...then... using an agile methodology means things will take longer than expected, we are not able to do more with less as it promises.
    - AM: Well, there is truth in those words, but... that is because you expected way too much, so... using an agile methodology, makes that very clear for you right after the first iteration, and will allow you to adjust the curse of the project to avoid bigger problems.
    - PM: I'm starting to get the picture I think... but...then in a week or two, I will have to go to the business and tell them we will not be able to make it on time.
    - AM: Well, I think that's great, it's better to fail earlier than later.
    - PM: Nobody likes to fail!, why do you say that??
    - AM: Because now it's a small failure, but will allow you to discuss with the business, show them the problem, and adjust what is needed to prevent a bigger failure later when there is no turning back.Now we have a methodology which will help you and them to make better choices, because you know things will go wrong, way before they get worst, so you only lost a little.
    - PM: I'm starting to like that, but... still, I'm scared to tell them we will not make it on time, we need to change things. What should I do?
    - AM: You need to tell them, they should know right away. The faster they know, the better the solution will be.
    - PM: But, they will tell me we will not make more with less being agile, what should I answer to that?
    - AM: Only with good management you get better results, because better ideas are the ones that lead to do more with the same or less. You now count with a great tool to know your problems faster, to make things better, avoid failure and lead the change the company needs to shine over the rest. You are not better because you are good hiding problems, you are better when you solve them with better ideas.

    Fears
    People doing software development know they need to progress. Many times, their way to show it is just committing to an impossible date. They will start pushing everybody to get to it, and many times sacrificing things that are important for the business. So using an agile methodology, they will realize they cannot do what they promised right after the first iteration, and they think they are failing. The first reaction is the same in many cases, hide the problem and try to do anything to show things are working by the end date, even if it's missing critical parts for everything to work or making the development team work tons of extra hours. This is fear, the fear to fail cause people to do crazy things instead of using their heads.

    Other times, dates are set by the business, and instead of creating a realistic plan and focus on what is really needed, and leave nice to have for later, people just push to get everything done. Everybody lose focus of what are the important things, lot of time is spent on things which could be never used. You might end with a really nice splash screen, but it doesn't process any data because you couldn't finish the process part. It's very hard to say no we cannot do everything you want by the end date. You need to talk to the users and find out what will give them the most out of the application, and focus on those. This requires the development team to work closely to come up with a good idea on what has to be built or changed to solve the problem. Without good communication allowing the team to know what is needed and have them committed, it will be very hard to solve the problem. Fear of saying "no we can't", gets you in muddy place which will be hard to come out, and harder as more time goes by and you remain silent.Event if you are doing an agile methodology, if you don't speak up, nothing changes, you are in the same place as before.


    Fear to Testing and Test Driven Development. Many people claim to be test infected once they started doing it. Unfortunately not everybody has been in touch with Testing and TDD to get infected. So telling a guy who has been doing development for years and years you have to do TDD and write Unit Tests for all the new code, will cause as much fear as telling a guy who does TDD not to write any test for his code. Specially if your are always on the run on your projects dealing with a long list of issues and tight deadlines.

    Also, when you are on your introspective meeting, many people is afraid to talk about problems they see. e.g: Rob never run his tests before committing his code to the repository breaking CI build. Or the specs and details we get from the initial discussions with Peter have nothing to do with all things we had to do during the iteration making it take more time just because he didn't think of this before. We are not getting enough training.  There are always things to improve and fear giving feedback, won't let you get better. You should encourage people to give feedback to their peers, and at the same time not making it personal.

    So changing the way people is used to do things causes many fears, it takes courage and training to overcome them. Why it takes courage and training? you might ask. I think it takes courage to put your self in a path to the unknown, and it takes training, to make things known.

    Many big companies lack of both, they don't give any training and they do not have people with the courage to deal with many others frighten to change. I think those places could be really hard to implement an Agile methodology. I think if your are in those cases, you should aim to build a special team, probably with people from outside with experience in Agile projects, and start adding the people that has already been in the company, specially the referents in different projects. Once you took fear out of them and they are comfortable with agile methodology, TDD, testing, CI, etc., you can start building more teams.

    I've seen the slow and gradual change of existing teams and processes is too hard and almost impossible if team members are not convinced of the change. They always end in a crazy intermediate approach. They claim they are doing "agile" but they just ignore many agile principles. Those intermediate approaches should be based on the agile principles to consider agile. Also, if there is no powerful sponsor, the team will be trying things and taking the risk of failing on their own. Fear will beat them as soon as they start running into issues as they get into too many unknowns, and they will just fall back to the same way of working as before.

    I would ask, why are people afraid to change would use an agile methodology? I think if you are not changing for better, you are changing for worst, and specially on IT, where everything else changes so fast.

    Monday, October 5, 2009

    Myth: Agile ensures Project Success

    I've been working on IT for a long time, and used many methodologies during that time, a little bit of everything. Many times the projects went fine, many others they were a failure, and others they just became an endless list of bugs to solve.

    So I always wondered, what went good? What went bad? And what caused so many problems? I realized that most of the problems, were not due to the methodology, it was due to people not doing they were supposed to do, or doing it poorly.
    When I say people, it's not just the development team, it's everybody needed to make things work, and so this includes everybody in the company, and in some projects, people outside the company too. 
    When I say people not doing what they were supposed, I don't mean they are lazy or just not skilled enough (even this could be for some of those), it's just that they didn't know enough at the time they had to do their jobs to assure everything will go fine when somebody else pick it from where it was left.

    I started to think on many of the agile concepts, and why they will help you to be better at your projects. At a glance, this is what I see most people think of Agile.
    1. I can just stop doing what I don't like to do, because I think it does not add any value.
    2. I can just start coding, because it doesn't say I have to do analysis or design, like it will magically work out.
    3. Only highly skilled people can do agile, because not skilled team members will not know how to do something that works and it's ready for production in 1, 2 or 3 weeks depending on your iteration.
    4. I need these last minute issues solved in the iteration finishing tomorrow, and if we need to, we can increase the iteration length to fit this change because the business says it's very important. And repeat this over and over again.

    I think all those thoughts can cause many things to fail, and they just show a lack understanding on how things should be performed to produce an application that will solve people's needs. Knowing how to build applications, doesn't mean technically be able to do it. Most of the time, agile projects fail, because the people involved do not see how everything must work together to make things right, and just skip many important things when they do software development.

    What do I get when I look at the basic agile concepts? There is always more than meet the eyes, as most of those are written by people who actually do good systems, and they know how to do it, so they often take for granted many things normal people trying to implement agile should do already. Here is how I see some of these concepts are linked together and why they are important. I will not exhaustive cover all the aspects of Agile, but the ones I currently find more important. I will start with Production ready software.

    Production ready software

    For example, one of the key concepts is to "produce production ready working software at the end on the iteration". On many companies, working software just means move the code to production to start making it work and pay for itself.
    Now... this does not mean just code something and move it to production without any thinking. You need to review the problems you would have if that code fails, or has bugs, or makes the company pay more or lose a lot of money.


    Now, can you live with bugs in your application? I think you can, as I haven't seen any application without a bug in it. But there are bugs, and BUGS!!!!, a mistake in a calculation causing the company to lose a lot of money is a BUG!!!, and then you might have an input for a number in your screen, which does not display a proper error message when you enter a letter, and that is considered a bug which you can actually ignore many times without impacting the business.

    This doesn't mean you can ignore everything, if your app, is used by millions of people, and that wrong error message cause a million calls to your call center every day, it will not be a bug any more, it can become a BUG!, so it's just a matter on how important things are for the business you are working for. This is not an excuse to do things wrong, the better things are done in the beginning, the better the app will be to maintain, fix, and generate trust.

    Testing
    Having said that you can live with bugs in your app, but you cannot live with BUGS!!! In your app, what will allow you to be sure you will not have BUGS!?
    The answer for that is testing. You need to test your code, and test the things that are important for the business as much as you can.

    Now, this does not mean I need to test everything in my app, even when it is good because you will have less bugs. Still you might invest too much money and time testing things which are not important for the business, and that might cause your system to fail too, as you never deliver new functionality, just more tests.

    In everything there is a trade off, and you need to constantly revise that trade off. Lean software development guidelines will tell you to test enough. How much is enough? This is an answer that comes from the business you are in. You need to be sure no BUGS are in your system.

    Testing is good, but not just because you will be more certain your code will work in production, many times you hear the expression that testing is your safety net. This means your will be more certain your changes will not break anything important in your application, so it will allow you to make changes without thinking of your application as a whole, with all the interactions it might have with other pieces of your code, you can focus on solving the problem you need to solve, and have more time to think on better ways to solve it.

    Test Driven Development
    Regarding testing, many times you hear developers saying that testing will take them too much time, or, whenever they have to change some lines of code, they need to change all the tests for those lines too, causing them to work twice.

    I think this is what happens most of the time when you have tests in your app, but... why?
    This is because you are writing test for your code, and not test for your requirements. Many would say... that code comes from requirements, so if I test the code they will test the requirements, but this is false unfortunately. This is pure logic... requirements => Code <=testing, so you are testing your code and not your requirement, and this is because the way you produce your code.

    When you start coding, you have a lot of technical baggage in your head, with code you already written, and many times you trend to apply the same solutions you applied to similar problems before, or if you are lucky, some more experienced guy will tell you a better solution. With this, you might be writing tests to factories, or you need to build a hash table with many things in it to pass it to your code to be able to execute it. So, you end up coupling your test to the actual implementation of the requirement, and not the test to the requirement itself, so even when a requirement doesn't change, you might end up changing many test just because your implementation has to change.

    But... how do I write tests against the requirement and not to the code itself then? To write test to your requirements, I say you should use Test Driven Development (TDD) practice, because you will write your tests before you think of your code and how to implement it, decoupling your tests from dirty implementation code. This has many other benefits too, which you can include, you need to understand your requirements before creating a test for it, you can discuss the test with the users to see if they are valid, and you are deferring your commitment to think how to write your code, and also you think how you want to use your code.

    This has many implications, because, the code itself is no longer important, because you already defined the 2 most important things of it. First, what it should do? And second, how do you use it? Writing the code is now just a problem on looking for the best way to solve that, and even somebody with little skill should be able to write the code to satisfy the 2 things that defines it, even poor quality code will be ok, if it meets the other 2, so, the code itself is just code, and you should be able to change it as you please to improve it.

    TDD will also allow you to break a solution into smaller steps, and as Kent Beck said, it will allow you to manage fear, fear of getting lost in the middle thinking of one piece of code that solves everything. You come up with a lot of code to solve problems which might not actually be there, making things more complex. It allows you to solve things step by step, and incrementally change your code to solve your problems. Also the good thing is that you can define how big your steps are.

    Refactoring
    Changing the code as I'm pleased is a really powerful tool, because I can put anything in there, and be sure it's still doing what it was meant to. So, what does refactoring means, other than reviewing your code and make it more understandable, to make it perform better in some cases?
    It means a lot more in most of the cases. I haven't seen many people doing everything right the first time they do it, especially when you have less skilled team members, it forces them to think on doing things better, and not on the only way they know.

    This is the time the developers need to take to improve their code and also their skills, because they are already sure they already solved the problem, so now they only can peacefully focus on improve what they have done, without the rush to get it done.

    This is not an optional step in the process, the code is not done, until its meets your quality standards and duplicate code is removed. If you are not refactoring, you are leaving more and more work for the future, and this step is the one that adds quality to your project. Just like in anything, you cannot add quality at the end of your project; it needs to be part of your process.

    Imagine living on a building, where all the things are in place, but as soon as you open your door, everything starts to fall apart, then your only way out would be start over.

    I think many will agree with me on the following. If you have been in a company for a long time, you always keep hearing, we need to rewrite this system. Because it's full of problems and the ones who did it are gone, and understanding it is impossible. That's where all your projects will end up if you are not improving your code as you build it.

    The same problem will be repeated so many times and fixing it will take you a long time. But if you have been improving your code as you create it, you can find better ways of doing things, specially avoiding the same errors over and over again.

    Continuous Integration
    Ok, my code is tested, and it meets quality standards, how I am able to ensure the code will be production ready when I finish an iteration? It's not a matter of running the entire tests the last day, and if they pass, then deploy your app. You will be less likely to finish on time if you think that way. If you integrate all your code your last day, you will see many problems to solve and it will be too late already.

    Many agile methodologies encourage continuous integration. What does this mean? This means you need to ensure your application of bad code or bugs to prevent you from finding surprises when it's too late.

    Ensure everything might be too much, but again, this depends on your business, to which level of integration you need to get. If you look at lean software development, try to ensure enough to feel comfortable. Whenever you experience a problem, and the problem starts repeating itself, the best thing to do, is to put something in your continuous build, so the issues is no longer repeated, instead of manually fix it every time.

    How Agile does ensures Project Success then?


    Continuous integration is like testing and refactoring, you invest time now, to avoid problems in the future. Do I care about those problems? It depends on what you do, and who you are, but... there is something you should never do... is to ignore the consequences of your acts.

    If you say you are doing Agile, and you are not doing testing, refactoring and continuous integration to a level that allows you to reduce the risks of failing, then you are not doing agile. You are just ignoring your problems and kicking the ball ahead all the time, and the ball gets bigger and bigger, and it will get harder and harder to kick the ball ahead again. All this untill the only way out is to start over.

    What agile promotes is do whatever your business need to continue, defer the commitment to fix it, and then FIX it when you get a chance and the business lets you. Sometimes you will find this very hard, as you are always behind of schedule, things change at the last minute, and you are always on the run to get things working. Sometimes that's the way it has to be, but you need to be very clear on how you raise this as a problem in your company, and those changes will cause in the future, and pray for them to understand.

    Also it states that you have to focus on the most important thing for the business. Does it include building a whole Web Framework to solve their problems as the first thing? I don't think so, at least not for most of the project. Always focus on solving business problems, and not the technical problems. They are not IT guys for the most part, so they count on you to tell them what they need.

    I stated that most of the problems were due to people not knowing enough of what they had to do at the time they had to do it. Why is agile different of other ways of development software? Well, it aims to reduce this problem in many different ways, but mainly following a basic ceremony with specific meetings

    1. Iteration Planning
    2. Daily Meetings
    3. Review/ Feedback meeting
    4. Introspective or process related meeting

    Iteration Planning meeting.

    In this meeting you will commit to a set of issues to solve, based on what you know at that time.

    Daily meetings
    You need to report progress or the lack of it, and what is in your way to finish. This meeting is to avoid getting to your last day of your iteration without doing anything because X didn't give you the right paper or any good excuse you can come up with.

    Review/Feedback meeting
    At the end of the iteration, you will display what has been done, how it's working, or not, but in both cases gives you feedback, well or bad. Did you finish everything you said you would? Is everything working as they expected? How many problems did you find? Take note of all the feedback you get.

    Introspective or process related meeting
    Look at all the notes you got from the review meeting, and see how you must change your process to solve the bad things, and leverage the good things. This meeting will tell you if you have to test more, add more validations in your continuous integration piece, and add more people to finish on time or anything you need to solve those problems.

    Always the problem is the process and not people. If there is a developer causing more problems than solutions, you need to find out what the problem is. Then think how you can put something in place in the process to prevent those problems to be found the last day.

    Training could be the problem, better specs, or specs in a different language... probably nobody realized that guy only speaks Guarani, or he never got a paycheck for the last 6 months. So... everything needs to be considered here, and you have to change your process for the things you can within the project scope of action, and raise the problems like salary to the appropriate channels in your company.

    The faster the feedback, the faster people knows what they are doing wrong, and what needs to be changed in order to improve. This is also guided by the golden rule, fail earlier, fail often. This doesn't mean you have to fail on purpose, this is related to go, do it, and see what went wrong and fix it; instead of plan what you think you have to do for a long time to then start doing it.

    I've seen a company that spent 1 year in a project to create an ERD diagram for their DB, to then use it in another project. By the time I did a demo of a product, they showed me 600 pages ERD impossible to understand unless I spend another year going over it. I'm sure that by the time they actually start with the project, that ERD will be outdated for the most part, and they just spent too much money on it to get nothing or very little from it.

    Conclusion
    Being agile or adopting agile practices will not ensure success of your project.

    It will allow you to make things clearer since your first iteration.
    It will allow you to identify problems earlier, and put something in place to solve them. If you just ignore them, they will just keep growing and growing.

    It will allow you to adapt to changes faster, as you identify the changes as they appear.

    If you just maintain status quo, you will fail as in any other methodology. You must have one constant in your software development. Continuous Improvement. Don't waste time in things not important. I heard many times, if you are not going forward, you are going backwards. I just hope when you are going backwards is because you are about to run forward faster :-)