Tuesday 26 March 2013

TDD ? why ?

I have met some developpers that are still relectant to work within a TDD approach. So my guess is that they don't see exactly what are the clear benefits from using this approach. So here are the most powerful to my mind:
When using a TDD approach (by the way TDD means Test First and refactoring)

1.You have a clear and formal specification of what you have designed and implemented. Not only a piece of comments, that by the way will pe deprecated after a while. This is really useful for maintenance (bug fixes, regression, evolution)
2.You have a MAXIMUM code coverage and NO DEAD CODE
3. You have methods in your test that express your test intentions and not a test method per method in the class under test.

The process:
    0. Create a todo list from a specification
    1. Create a test case automatically with the IDE
    2. Add 1 new test from the todo list
    3. This test shouldn't compile. Add the minimum code to compile.
    4. execute and get the red bar (Junit Eclipse plugin)
    5. Add minimal code to pass the test (the green bar)
    6. Refactor
    7. goto2

Some resources on how TDD helps in reducing the software development costs:
- http://codebetter.com/darrellnorton/2003/12/03/what-is-the-zero-defects-mindset/

Sunday 24 March 2013

Scala Collection framework

I'm really impressed by the elegance of the collection operations of Scala. For example the following code

       val l = List(1,2,3)
        val (l1, l2) = l partition (_>1)
        println("l1 = " + l1)
        println("l2 = " + l2)

will produce:
l1 = List(2, 3)
l2 = List(1)

We can also do that with one line of code:
val (l1, l2)  = List(1,2,3) partition (_>1)

Beautyfull !

Friday 22 March 2013

Gestion des variables d'environement

Sous windows la gestion des variables d’environnement se fait comme suit :

Variables système

Pour modifier une variable d'environnement, vous devez être administrateur. Les variables d'environnement sont définies par Windows et s'appliquent à tous les utilisateurs. Les modifications apportées à l'environnement système sont écrites dans le registre, et nécessitent le redémarrage de l'ordinateur pour prendre effet.

Variables utilisateur pour nom_utilisateur

Tout utilisateur peut ajouter, modifier ou supprimer une variable d'environnement utilisateur. Ces variables sont définies par le programme d'installation de Windows XP, par certains programmes et par les utilisateurs. Les modifications sont écrites dans le registre et, en général, prennent effet immédiatement. Cependant, une fois qu'une modification est apportée aux variables d'environnement utilisateur, tous les logiciels en cours d'utilisation doivent être redémarrés pour les forcer à lire les nouvelles valeurs du registre. La principale raison à l'ajout de variables est de fournir des données nécessaires à des variables que vous voulez utiliser dans des scripts. 

 Source: http://support.microsoft.com/kb/310519/fr

Wednesday 20 March 2013

Domain Driven Design: a new book

I've discovered the new book on DDD, and the interview of its author:
http://www.informit.com/articles/article.aspx?p=2023702

It seems more easy to read an implement than Eric Evans....

Ruby on Rails vs Java

A funny comparison of RoR to JEE:
http://www.youtube.com/watch?v=PQbuyKUaKFo

So if you want to prototype use RoR, then if it catch on (some thousands of users) go Java.

Developpers Productivity Report

Some interesting statistics on Java technology tools:
http://zeroturnaround.com/java-ee-productivity-report-2011/

Tuesday 12 March 2013

No rush, clean code !

I read this post and personally it's what I have experienced during the first versions of IFx-Workbench ().
We were implementing an infrastructure API .... but with this rushy approach we end up with a spagetti API that is hardly usable by clients that aren't experts. In short all the developpers that are not in our team !
http://programmer.97things.oreilly.com/wiki/index.php/Speed_Kills

Friday 8 March 2013

Lean IT

A great CIGREF publication on the Lean and Agile:
http://images.cigref.fr/Publication/2012-Quel-SI-pour-la-firme-lean-CIGREF.pdf

Business models

A post on Springsource business model:
https://www.varnish-software.com/blog/profit-models-part-4-spring-source

more later...

Tuesday 5 March 2013

Lean Startup, a new process ?

Hummm .... it seems that there's new way to build startups:
http://en.wikipedia.org/wiki/Lean_Startup

It is based on a learning style called validated learning:
The process steps are (from Wikipedia) :
  1. Specify my goal
  2. Specify a metric that represents this goal
  3. Act to achieve it
  4. Analyze the metric - did you get closer to the goal?
  5. Improve and try again
It seems to me that is the Plan-Do-Check-Adjust management method, isn't it ?
For a summary in french, pls check this post:
http://javamind-fr.blogspot.fr/2013/03/le-mouvement-lean-startup.html


Scala Coding Dojo at Toulouse

I have been at a Scala coding dojo, organised by Ekito at Toulouse. It was really a lot fun and, we also learnt a lot in only 2 hours of coding withonly one computer for 9 developpers and a Test First approach !
After a small presentation done by a guy from Ekito, we start coding a Kata in Scala. The kata was a string calculator. More on Code Katas can be found here: http://katas.softwarecraftsmanship.org/post/34191185266/katacast-stringcalculator-in-scala
The idea is to start by specifying a test with Specs 2 (http://etorreborre.github.com/specs2/) and then try to implement the corresponding code in Scala.
Here's a photo from the Ekito blog entry: http://dojo-toulouse.github.com/blog/2013/03/04/coding-dojo-scala-number-2/
Thank you Ekito !



Sunday 3 March 2013

Thoughts on Hiring

The most important to have in mind when hiring is to:

"Hire to become the organization you want to be." since "Every hire adjusts the future of your organization. So hire well."

From the excellent introduction to this social/tehnical process :
http://www.artima.com/samples/AgileHiringCh1.pdf



 

Learning Scala

If you want to learn Scala, and you're a Java developper my advice is to follow this path:
- Start by David Pollak's excellent book: Beginning Scala.
- Move to the 800p !! book by Martin Odersky (Scala is his baby :)) et al.: Programming in Scala
- Practicing with a Scala IDE during your book journey
- Comment the snippets you'll produce from reading those books. This is valuable for code reuse.

Introduction à Git

Tuesday 29 January 2013

Subclipse problems

Si vous avez l'erreur suivante à la création d'un nouveau repository SVN ou à l'import :   

La requête de la couche RA a échoué
svn: OPTIONS de 'https://subversion.assembla.com/svn/irit_workspace': Impossible de se connecter au serveur (https://subversion.assembla.com)


Alors aller dans Window > preferences > SVN et changer le client dans "SVN interface", le problème devrait être résolu.



Tuesday 22 January 2013

Wednesday 16 January 2013

ArrayList initialization

A concise way to initialize ArrayList in Java using anonymous classe:    

 List<Class> array = new ArrayList<Class>(){{          
            add(CreateEvent.class);
            add(SendEvent.class);
        }};

Monday 14 January 2013

How to manage your Eclipse/RCP plugin versions

The short answer:

When to change the major segment: major segment number must be increased when a plug-in makes breaking changes to its API. You have then to reset the other segements.

When to change the minor segment: minor segment number must be incremented when a plug-in changes in an "externally visible" way (no API breaking and no bug fixes)

When to change the service segment: service segment number must be incremented whenever there have been changes to a plug-in between releases that are not visible in its API (e.g. bug fixes)


More details : http://wiki.eclipse.org/index.php/Version_Numbering