Archive for the 'Agile' Category

Impara il TDD con il team Orione di Sourcesense

Wednesday, November 25th, 2009

Summary: my company, Sourcesense, offers a one-day course on TDD

Se ti interessa imparare il Test-Driven Development con sviluppatori che lo usano tutti i giorni, in un corso di una giornata, mani-sulla-tastiera, iscriviti al nostro corso. E’ il primo corso pubblico che facciamo; prima d’ora abbiamo sempre fatto corsi in casa dai nostri clienti. Speriamo di fare un pienone!

Quando: 27 gennaio 2010

Dove: a Sesto San Giovanni, via Venezia 23

Quanto costa: € 300,00 più iva; ma puoi spendere solo € 200,00 più iva se completi il pagamento entro il 27 dicembre.

Chi lo insegna: io (Matteo Vaccari) più un altro sviluppatore del team Orione di Sourcesense.

Tutte le informazioni, e il link per l’iscrizione, sul sito di Sourcesense:

http://www.sourcesense.com/it/agile/training/

Back from iad09

Saturday, November 21st, 2009

So this was the sixth Italian Agile Day!

It’s been great to meet old friends, and make new acquaintances too.

Appreciations:

  • Peter Stevens, for sharing insightful tips and tricks on how to succeed with fixed price projects.
  • Alberto Provaglio, for the interesting insights on system dynamics.
  • Jacopo Romei, for the courage of sharing his not-so-successful experiences.
  • Gabriele Lana and Simone Genini, for helping me with the coaching workshop.
  • Simone Casciaroli, for convincing me to do a workshop instead of my old boring presentation, and working hard at preparing it. We’ll do another one some other time!
  • All the people that attended the workshop. It’s been overwhelming. Thanks for coming and contributing!
  • Alberto Brandolini, for teaching me that there’s a lot more to DDD than I thought.
  • Indrit Selimi, for taking the picture at the workshop.
  • Marco Gulino, for the self-sacrifice of giving up coming to the IAD, getting up at 4 in the morning *and* having to deal with a confrontational situation.
  • My Sourcesense collegues, for contributing many sessions again in 2009.
  • Marco Abis and the Bologna XP User Group, for all the work *and* for being great people to hang around with.

Thank you all! Let’s do even better next year!

How I setup confluence on Debian

Friday, November 13th, 2009

Pardon the dreariness of this post. I did this twice in a couple of days. I thought I might as well write down what I did, to save me time next time. Let me state first that this is an opinionated install :-) I don’t like bloated Tomcat installations with many applications on them. I prefer to have each application in its own place with its own server. So I will use the Confluence standalone package, which is integrated with Tomcat. When I will install Jira on the same box, I will download another standalone package.

Preparations

Connect to your server. Execute

  apt-get install apache2 ca-certificates
  apt-get install mysql-server

Create file /etc/mysql/conf.d/confluence.cnf with the following contents

  [mysqld]
  default-storage-engine=innodb
  lower_case_table_names=1

Then restart mysql with

  /etc/init.d/mysql restart

Edit /etc/apt/sources.list, appending the string ” non-free” to every line.
Then execute

  apt-get install sun-java6-jdk

Install Confluence

Download the Confluence standalone package for gnu/linux (not the one for
evaluation)

  wget http://www.atlassian.com/software/confluence/downloads/binary/confluence-3.0.2-std.tar.gz

Create the directory /opt/confluence. In that directory, expand the confluence
archive. Then create a symlink from /opt/confluence/confluence-app to the
actual directory that contains the confluence application

  ln -s /opt/confluence/confluence-3.0.2-std /opt/confluence/confluence-app

Then create directory /opt/confluence/confluence-data.

Edit the file confluence/WEB-INF/classes/confluence-init.properties within the
confluence distribution, and add the line

  confluence.home=/opt/confluence/confluence-data

Edit the file conf/server.xml and change the following:

  • Change 8080 and 8000 to something other than these, which are the default
    Tomcat ports and might be useful some other day. I use 8180 and 8100.
  • In the first Connector element, add the attribute address=”127.0.0.1″. This
    will make Tomcat bind to localhost only. I don’t want to make Tomcat
    directly accessible from the outside.
  • In the first Context element, change path=”” to path=”/confluence”.
    Otherwise I can’t get the reverse proxy from Apache to work.

Create a file /opt/confluence/startup-confluence.sh with the following contents:

  export JAVA_HOME=/usr/lib/jvm/java-6-sun
  su -m www-data -c /opt/confluence/confluence-app/bin/startup.sh

Change ownership of the whole /opt/confluence thing to www-data

  chown -R www-data.www-data /opt/confluence
  chmod +x /opt/confluence/startup-confluence.sh

Download the mysql driver

  wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.10.tar.gz/from/http://mirror.switch.ch/ftp/mirror/mysql/

Extract the archive, and copy the jar it contains to
/opt/confluence/confluence-app/lib

Create the database and the user for confluence

  # mysql -uroot -p
  mysql> create database confluence;
  mysql> grant all on confluence.* to confluence@127.0.0.1 identified by 'secret';

Now if you didn’t do this when first connecting, exit from ssh and reconnect to create a tunnel, to be able to browse Confluence from localhost on the server.

  ssh -L1234:localhost:8180 root@myserver

Execute /opt/confluence/startup-confluence.sh, then point the browser to

  http://localhost:1234/confluence

You should see the confluence configuration screen. Now just follow the wizard. Remember to choose “Custom installation”, “External database”, and “Mysql”.

When Confluence is up and running, we still have some things to do. Let’s configure Apache to serve Confluence in http://myserver/confluence . Edit /etc/apache2/site-available/default and add the following lines:

  <Location /confluence>
  	Order allow,deny
    Allow from all
  
  ProxyPass /confluence http://127.0.0.1:8180/confluence
  ProxyPassReverse /confluence http://127.0.0.1:8180/confluence

Then execute

  a2enmod proxy proxy_http
  /etc/init.d/apache2 reload

You should now be able to see Confluence at http://myserver/confluence

Now we must make sure that Confluence will start at system boot. Just call
/opt/confluence/startup-confluence.sh in /etc/rc.local. It’s simple, and it
works.

You may stop here unless you want to serve Confluence via ssl. In that case… let’s carry on. Execute

  a2ensite default-ssl
  a2enmod ssl
  /etc/init.d/apache2 reload

You should be able to access https://myserver/ now. Now move the proxypass configuration from sites-available/default to sites-available/default-ssl.

My impressions of the Emergent Design Workshop

Thursday, October 29th, 2009

OK, so I did participate to the Emergent Design Workshop by Francesco Cirillo. This is the second time I attend a workshop with Francesco. The other one was about coaching and agile process management. This one is about the technicalities of making the Agile thing work for real in the code. It’s never easy to work with Francesco; if you do attend this workshop, be prepared to challenge everything you know.

In my particular case, I knew I didn’t know object-oriented design well. OK, I did read about the design patterns, and I did read some of Robert Martin’s writings, but never got really into this stuff. Yet somehow, I thought I could get away with not knowing this stuff deeply. This workshop changed this; now I realize more fully the amount of stuff I didn’t know, and why it’s very important for me to learn this.

And,… even more importantly… I learned to see why a certain kind of semi-procedural code disguised as object-oriented is not satisfactory; and it’s not fun. I gained a new set of eyes and a higher level of criticism for code. What I learned resonates with what I wrote earlier about “code that speaks.” It turns out I was on the right track there; the goal is to have code like Lego bricks; objects that you can combine together to obtain the desired results. Code that can withstand changes in specification, without becoming more complex. Above all, the thing I’m grateful to Francesco for is, to get back to the fun of working with software like objects.

Throwing the baby with the bathwater

Wednesday, October 14th, 2009

I was talking with a customer recently, who complimented us because the software we are producing is stable. He also said that one important goal of this project is to write something that is easy to mantain and extend.

At the same time, he was adamant that we should stop doing things like pair programming, and estimating user stories with the whole team, because these things “slow us down”.

Ahem. If you want good quality code, you better apply these practices, for they are meant for producing quality code. :-) Of course we will continue doing all these practices, for we think it’s best for the project.

“How to grow a team” at Jax Italia 2009

Friday, September 25th, 2009

On November 12 to 14 the Jax conference will finally come to Italy. On the first day there will be my presentation on How to grow a team, where I tell a bit about my adventures in growing a team in Sourcesense. It will be part of the “Agile Methods & Tools Day”.

I’m very excited to be part of this conference; look at the (other) speakers! I hope I will see you there.

Workshop su design emergente

Thursday, September 17th, 2009

Summary: I will attend this workshop by Francesco Cirillo

Ebbene sì. Mi sono iscritto al Workshop di Design Emergente di Francesco Cirillo. Sarebbe stato da pazzi lasciarmelo scappare proprio ora che Francesco “sbarca” a Milano. E poi sono anni che non vado a seguire un corso; l’ultimo è stato l’ottimo corso di Project Management XP di due anni fa, sempre di Francesco. Penso di avere proprio bisogno di continuare la mia formazione :-) Come dice il mio amico e collega Tommaso, o si progredisce o si regredisce; non è possibile restare fermi.

Ci sono ancora un paio di giorni per sfruttare lo sconto del 30% sul workshop di Cirillo. Credo che sia un’occasione da non perdere.

A semi-forgotten design principle

Friday, September 11th, 2009

The common wisdom is that Ruby is slow and Java is fast. In general, it’s true. But is it always? Look at this simple test.

$ cat hello.rb 
puts "Hello world!"
$ ruby hello.rb 
Hello world!
$ time ruby hello.rb 
Hello world!

real	0m0.008s
user	0m0.004s
sys	0m0.003s
$


So it looks like it takes 8ms to run a simple “hello, world” in Ruby. How does Java compare to this?

$ cat Hello.java 
public class Hello {
    public static void main(String ... args) {
        System.out.println("Hello, world!");
    }
}
$ 
$ javac Hello.java 
$ java Hello
Hello, world!
$ time java Hello
Hello, world!

real	0m0.122s
user	0m0.061s
sys	0m0.028s
$


Even if we ignore the time it takes to compile the Java program, it looks like running the “Hello, world” in Java takes 15 times longer than Ruby. This is due to the long startup time of the Java Virtual Machine. The times you see here are taken on my MacBook Pro; they will be different on other operating systems, but not much different.

So what, you will say? “The startup time is not important! As soon as the JVM is up and running, Java can run circles around Ruby.”

I don’t agree that startup times are not important. The startup time for Java becomes much worse when you run complex applications. A vanilla Tomcat with no web applications installed takes about one minute to start up. Compare with Webrick, the Ruby web server, that is up and running with my web application in 3 seconds. The difference in startup times makes all the difference in the world when you’re developing software. It takes at least one minute, often much longer, to start up a Java application so that I can try it. There are times when you’re developing an application when you need to test it after each tiny change. It’s very difficult to do that in Java. The problem is made much worse by the fact that in general Java “containers” can’t reload changed classes without a restart. (Webrick can do that.)

What, you will say? “Matteo gave up TDD! He tests applications manually by clicking around like a monkey!” No, really, it’s not like this. I always write production code with TDD. That does not mean that you *never* test your stuff manually on the live application. Quite the opposite: there is a danger, with new converts to unit testing, that we trust our tests too much. I’ve seen people declare a story “finished” when all the unit tests are green, without ever checking if it really works! And of course, if you never test it manually, it will not work. There is a need for manual testing (some call it exploratory testing), even if you’re Kent Beck or Misko Every.

So I hope you’ll agree with me that short startup times are important for developers. But there are other implications. The fact that it takes a lot of time to startup a Java application means that Java developers are trained to write applications in a single JVM process. For instance, we often see dozens of web applications running in a single Tomcat. If you need concurrent operations, the solution is always to run more threads within the same process. And there is a big problem with this.

The operating system’s concept of a “process” is a very useful one. A “process” is a bundle of threads and resources: memory, open files, network connections, and the like. A process in Unix or Windows is a watertight compartment. When a process terminates, *all* of its resources are released. A process cannot easily corrupt the state of another process. A process can be given limits on how much memory or CPU it can take. It’s very useful to organize a concurrent application as a set of cooperating operating system processes. That’s the way the Apache Http server works, and that is a remarkably reliable software. It’s also one of the smart ideas in the Chrome browser, to run each tab in a separate process.

It’s a good design principle to have many small modules communicating with well-defined interfaces, rather than a single monolith where all the threads can interact in unforeseen ways. It’s also the way of Unix to design applications as collections of small communicating processes. Which makes me wonder how could Sun ever get us to believe that it’s a good idea to put all of our eggs in a single, huge process. Should not Sun be the champion of the Unix way? But I digress.

In conclusion, I claim that designing applications with small cooperating operating system processes is a good principle. Java current practice runs against this, but it need not be.

Chi viene a sentire James e Diana?

Wednesday, September 9th, 2009

Ho visto sul calendario di metodiagili.it (l’azienda di Francesco Cirillo che fa corsi) che ci saranno corsi con James Shore (The Art of Agile Development) e Diana Larsen (Agile Retrospectives). Sono un fan di entrambi i libri. E’ un’occasione da non perdere! Io mi sono iscritto. Penso che investire in sé stessi sia sempre un buon investimento.

Ci sono anche due corsi di Rebecca Wirfs-Brock. Non ho ancora letto niente di suo, ma c’è ancora un po’ di tempo prima che scadano i termini della early registration.

Birthday Greetings at XP Day Benelux 2009!

Wednesday, September 9th, 2009

I and Gabriele will present the Birthday Greetings Kata at the 7th XP Days Benelux in November. See you there if you can: it’s a very useful conference to attend.