Posts Tagged ‘Agile’

Refactoring: Do it all the time!

Monday, December 20th, 2010

Refactoring is a very well known technique that has been used for years in the software development field. Here are some popular definitions:

“Code refactoring is the process of changing a computer program’s source code without modifying its external functional behavior in order to improve some of the nonfunctional attributes of the software. Advantages include improved code readability and reduced complexity to improve the maintainability of the source code, as well as a more expressive internal architecture or object model to improve extensibility.”
Wikipedia

Or, being more concise:

“A change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior.”
Martin Fowler

My concern with Refactoring is that most people don’t realize that they will have much more benefits if they do it all the time.

As the definition above explains, the purpose of Refactoring is to make code easier to change over time. It doesn’t make sense to keep adding features to your code for, say, 10 months and then stop-the-world for a couple of weeks to refactor it. If you’re doing that, you’re totally missing the point. In this hypothetical situation, not only (1) it would become more complex to make changes in the software over time – and you’d be in trouble for several months – but also (2) at some point of time the team would have to stop and re-engineer everything – because the software would become very difficult to change.

If a team waits for 10 months, or 2 months, or 2 weeks to refactor something, they are doing it wrong. Each time new features are added the code becomes more complex, and it’s necessary to review it as soon as possible to make the necessary improvements. If the team doesn’t do that often, they will become slower and slower each day, they will be less productive and deliver much less features (or value).

The “re-engineer” thing even worse. First, teams that stop to make huge refactorings are delivering nothing to their customers while doing that because they’re too busy fixing their own mess. It’s definitely bad to pay a software team to deliver nothing. Second (and more important), huge refactorings are often risky, because they change a great amount of code and software components, usually introducing bugs and unexpected behaviors.

To avoid all these bad things, you must do refactoring every day, all the time!

(1) Red, (2) Green, (3) RefactorEvery time you make a change, you must look for an opportunity to make an improvement. If you keep doing that, your code will always be clean, maintainable and easy to modify. Remember the TDD cycle: Red-Green-Refactor? Don’t miss the refactor part, do it all the time!

In my experience it takes no more than a few minutes to refactor if you are doing it in small chunks all the time, and more importantly, this will keep you from stopping to make huge and risky software re-writes.

The whole company “Agile”?

Monday, January 4th, 2010

Last month while I was discussing with my friend Siraj we started to ask ourselves why the Agile “philosophy” doesn’t get popular in the whole company. What I mean is that nowadays it’s kind of easy to find the software/product development department of companies using Agile methodologies, but what else is missing or needed to the Human Resources, Marketing, Finance, Administration, Sales and every other departments join this movement?

When you start with Agile development, not only the software development process changes but many other things related to how your company works. For instance, it’s very difficult to think about an Agile team that will succeed with “command-and-control” management. The teams are self-managed, which implies a different style of management. Instead of bosses that keep asking for things done, we have servant leaders which provide all possible resources so that their teams can work and make decisions. The base of the pyramid begins to make decisions and not the top anymore, because they have the best work knowledge and therefore are the most suitable to do it. In some extreme cases in modern companies like Semco, the very employees are the ones who hire their managers.

That is, when we talk about agile methods, even though we are referring to the Agile software development methods, there are a lot of other concepts and philosophies that we are implicitly talking about (because they are very closely related).

I have an example to better explain where I want to go with this. I once worked for a company of reasonable size that, like many others of this size, had a traditional Human Resources department. One day I had a problem and needed urgent assistance from the HR staff. When I talked to them, two bad things happened. First, they treated me badly and like if they were doing a favor to me. Second, they said that my request would be met only in a few days because they had many important things to do first. What was happening was that my daughter was very sick, I had a problem with my health insurance and they were not willing to approve my daughter’s appointment with a doctor. A HR team with the “agile culture” would know in first place that since I am their main “user”, I deserve attention, respect and my problems are their problems. The emergencies of their users should be more important than any paperwork they have to do. And second, even though their backlog was abnormally large, a case with such severity should certainty jump the queue.

So when I say that other departments of companies could be “agile”, I am not suggesting that they work with Agile software development – which would make no sense – but that they use the same concepts of leadership, self-organizing teams working in a participatory environment, based on trust and cooperation, making a better effort to understand who are their “users” and what are their needs, create visions for their products and departments (that would help them make better decisions) and so on.

Getting this HR department above to speak up as an example, wouldn’t it be perfectly acceptable for them to do a personas exercise to discover what is the profile and the characteristics of their users? Wouldn’t it be great if they did chartering sessions, discussed their values, made retrospectives to discover how to improve their process and so on? Imagine how transparent and organized would be if the HR team had a big Kanban board in their room showing the activities, progress and their bottlenecks?

I think that this may not happen because much of the material and examples available on these subjects nowadays are formatted for people related to software development. Yes, there are books such as those of Ricardo Semler who are categorized in bookstores as “Business”, but I don’t see much business people really interested in these subjects. Why is that?

It’s time to finish with this “fork” between companies’ agile communities and the other departments. In Agile adoptions we frequently see after some time two totally different companies working within one. We must bring people from other areas and other hierarchical levels to the conferences and our world and show them these ideas. I will love the day that it will be possible to go to an Agile Conference and talk not only to software people but also HR managers, VPs of Marketing and other guys who are not in the development department; or else when we can find in user group meetings not only the “agilists” but also managers, human resources analysts, accountants and so on.

And now, where do we start?

Dev in Rio 2009, a great software development conference in Rio de Janeiro!

Friday, December 4th, 2009

Even though it was conceived, planned and executed in a little bit more than 20 days, Dev in Rio 2009 was awesome, a huge success! We had around 400 people at the SulAmerica Conventions Center in my home town Rio de Janeiro talking about software development, programming at the Coding Dojo and having a lot of fun in a whole day of presentations that ended in the biggest #Horaextra ever. “Hora extra” (which means “Overtime”) is the name of our weekly meeting where the nerds hang out together to drink and have a nice chat about geek stuff.

Dev Rio in 2009 started at the scheduled time when me and my friend Henrique Bastos (the creators of the conference) opened the event with a quick presentation and thanking our sponsors, supporters, communities and friends who helped us a lot more than you can imagine.

Dev in Rio 2009 - Abertura
* Henrique Bastos and me at the Dev in Rio opening.

To begin the day, we started the two tracks of Dev in Rio 2009. At the main auditorium we had the scheduled lectures while in the foyer we had the Coding Dojo.

Coding Dojo is a programming arena that was organized by the Dojo Rio folks in partnership with Dojo@SP. The idea is to work on simple and novelty problems, using programming techniques like Test-Driven Development and SOLID principles. This was definitely the best surprise we had in the day – the Dojo went much better than we could ever imagine (except that the Java Dojo wasn’t much popular, I have to admit).

Dev in Rio 2009 - Coding Dojo
* Coding Dojo at Dev in Rio: 3 meters of code on the wall!

Dev in Rio 2009 - Coding Dojo
* People participating at Dev in Rio’s Coding Dojo.

The first talk of the day was given by Ryan Ozymek, that entered the stage with his famous penguin to talk about his experience with open source software and the Joomla! community. He detailed how a big software development community works and gave his entrepreneur vision about how to use open source software to leverage businesses.

After that, Guilherme Silveira and Nico Steppat talked about a very controversial theme: Is Java dead? They addressed the fact that there are many things beyond the language in the Java universe and that despite the language is “expiring” the JVM can still be very useful.

After lunch, Fabio Akita gave no respite for anyone who was sleepy and did an excellent presentation on the Ruby on Rails ecosystem, with excellent videos, screen casts and quite information beyond the code. He doesn’t know but he took away the breath of the simultaneous translation girls!

Continuing, the (almost carioca) Jacob Kaplan-Moss made his presentation on Django, that he calls “the web framework for perfectionists with deadlines”, developed in Python. He spoke about the concepts and values that guided the development of the project and showed a bit of code to give the audience an idea of how to use the basics of Django.

The last presentation of the day was given by Jeff Patton, that talked about product development with Agile methods. Using as a narrative the story of a project carried out in conjunction with Obie Fernandez, several common problems in software development (and their solutions) have been addressed.

In the end, our great friend Vinicius Manhães Teles led an interesting conversation between speakers, communities and the audience. We had the impression that if we didn’t control the time, the conversation would have taken hours and hours because there were a lot of interesting subjects and questions. The audience took a great deal and we had interesting topics like entrepreneurship and controversial as the stupid regulation law of the systems analyst profession proposed by the Brazilian government (in Portuguese only).

Dev in Rio 2009 - Discussion
* Discussion led by Vinicius Teles. And before anybody asks, no, that one on the picture is not Adam Savage from MythBusters, it’s Jeff Patton.

While all these things were happening, me, Henrique, Gustavo Guanabara and Flavia Freire (Arteccom‘s journalist) spent the day recording a huge podcast of the event, interviewing staff and filming the scenes. We have talked with the speakers, sponsors and attendees about all the subjects addressed on the talks! Watch the “making of” of some Podcasts with Ryan Ozimek, with Guilherme and Paulo Silveira and with Fabio Akita and Marcos Tapajós.

Dev in Rio 2009 - Podcast recording
* Guanabara recording the Podcast with Fabio Akita and Marcos Tapajós (and a neat detail: Guilherme Silveira and Paulo Silveira doing Pair Programming just behind them).

Since the event was realized on a monday, we ended the conference inviting everybody (with the “Estamos todos bêbados” song from Matanza in the background and choreography by Sylvestre Mergulhão and Henrique Andrade) for an epic edition of #Horaextra (that means “Overtime”, our weekly social meeting) at Lapa 40º. The entrance was free to everybody that had the Dev in Rio 2009 badge and that was how we realized the biggest and best #Horaextra ever:


* Watch more Dev in Rio 2009 videos.

I’m sure that this simple blog post cannot tell even 0,001% of what Dev in Rio 2009 was and how happy I am for being able to make it. I’d like to thank again the fundamental support from the folks of Globo.com that was the main responsible for making it happen, our sponsors Caelum, Locaweb and D-Click and everybody else that have supported us some way: Associação PythonBrasil, Fábrica Livre, Myfreecomm, OpenSourceMatters, Arteccom, DojoRio, Dojo@SP, #Horaextra, PythOnRio, RioJUG, RubyInside Brasil, Guanabara.info and everybody that attended to Dev in Rio 2009. Without your support nothing would’ve been possible!

Dev in Rio 2009 - Everybody in the end
* Participants of Dev in Rio’s round table.

If you didn’t go to Dev in Rio, I have two things to tell you: (1) you did lose one of the best conferences in Rio ever but (2) we’re going to make the presentation videos available very soon to alleviate your pain. :)

See you in 2010!

A story of failure with Scrum

Monday, May 25th, 2009

Mental note: I promisse to post more often on this blog. :)

While I don’t do it, see what happens when you use Scrum but you’re not really Agile:

Then see what happens when you don’t write unit tests and don’t do Test-Driven Development: