juillet 2010Monthly :

Les contextes pouvant influencer la qualité

Les Agilistes de ce monde sont au fait de l’importance des tests automatisés pour assurer la pérennité d’un projet informatique. En fait, tout développeur qui a tenté la pratique du TDD et qui a réussi à inclure cette pratique dans son travail au quotidien découvre rapidement le sentiment de puissance qui en résulte. Ce sentiment de puissance prend sa source dans le fait que le développeur a beaucoup plus d’assurance et de confiance dans le logiciel qu’il développe. Le fait d’avoir plus d’assurance et de confiance laisse une meilleure impression au client et inévitablement résulte en une équipe plus heureuse. Cependant, afin de toujours s’assurer de livrer le maximum de valeur au client, il est parfois nécessaire d’ajuster le niveau de couverture des tests selon le contexte du projet.

Dans le cadre du développement d’une ‘preuve de concept’ (prototype), par exemple, il y a de fortes chances que le développement du prototype ne se poursuive pas pendant des mois. Le système ayant une taille réduite, l’équipe peut limiter la couverture des tests unitaires à certaines parties critiques du code car il est moins probable que le système régresse en qualité sans que l’équipe découvre rapidement une anomalie. Ainsi, s’appuyer simplement sur quelques tests manuels peut être un choix judicieux lorsque l’équipe a peu de temps pour développer les fonctionnalités requises afin de répondre aux objectifs d’affaires du prototype, à condition bien sûr de ne pas reprendre le développement du système à partir du prototype (ce qui se produit malheureusement dans la plupart des cas). Dans un projet Web MVC, par exemple, une équipe pourrait décider de tester uniquement le cœur du domaine d’affaires sans tester les contrôleurs ni les vues.

Le fait de couper sur les tests sous prétexte qu’on veut livrer plus de fonctionnalités d’un système dont le développement se déroule sur plusieurs mois à l’aide d’une approche Agile de développement logiciel est un choix qu’on pourrait qualifier de risqué. Un tel choix peut ralentir sérieusement l’avancement du projet car le risque d’endommager les bouts de logiciel déjà livrés sans test augmentera de façon quasi exponentielle sprint après sprint. En plus de provoquer l’inverse de l’effet escompté, ce genre de choix augmentera significativement le coût de développement du système. De plus, cette diminution de qualité créera nécessairement des tensions entre le client et l’équipe, ce qui nuira significativement au plaisir de développer du logiciel.

On constate ainsi que la définition de « Just Good Enough » pour les tests varie significativement d’un contexte de développement à l’autre, d’où l’importance de l’établissement d’une définition de ‘Terminé’ bien adaptée à la situation.

Keyboard Powered Web Search

For the past two weeks I’ve used DuckDuckGo as my search engine. It’s a search engine built on open-source software. What made me switch is the capacity to navigate through search results with the keyboard using vi-like keys (hjkl).

I didn’t know at the time but Google also allows you do something similar. You just need to go to http://www.google.ca/experimental/ (also works for google.com and I guess most other domains). There you can opt-in to be part of the Keyboard shortcuts experiment. That’s it! J/K are used to navigate through search results, O (or enter) to open them.

Hopefully this is going to be useful for the other keyboard junkies out there.

Installing the Visual Studio Scrum 1.0 Process Template

For those of you planning to start a new project with the Visual Studio Scrum 1.0 Process Template, Mickey Gousset just write a good paper in the Visual Studio Magazine. He introduces the new Microsoft Scrum 1.0 Process Template for Visual Studio Team Foundation Server and steps through the installation process.

http://visualstudiomagazine.com/Articles/2010/07/27/Installing-Scrum-Process-Template.aspx

Urban Turtle 3.2 fully supports the new Visual Studio Scrum 1.0 Process Template. Using the index card metaphor with drag-and-drop functionality, it is the perfect replacement for Excel-based planning workbooks.

Pourquoi ASP.NET MVC est un choix Agile?

ASP.NET MVC est une plateforme qui a été introduite par Microsoft essentiellement pour augmenter la testabilité des applications Web.

En ASP.NET traditionnel, il est relativement complexe de tester unitairement la logique à l’intérieur des contrôles.

  1. Toute la logique est séparée individuellement dans chacun des contrôles (fichiers .ascx et .aspx).
  2. Cette logique est contenue dans des méthodes appelées à l’intérieur du cycle de chargement des pages (page lifecycle) prédéfini par la technologie ASP.NET WebForms qui est difficile à simuler en dehors d’un contexte Web.

Le cycle évènementiel étant difficile à simuler, il devient nécessaire d’utiliser des ‘fakes’ ou ‘stubs’ des classes partielles des contrôles individuels, ce qui génère beaucoup de code pour de simples tests unitaires. De plus, la nécessité de ces ‘stubs’ complexifie passablement la pratique du développement piloté par les tests (TDD).

En ASP.NET MVC, c’est la séparation en trois responsabilités distinctes (modèle, vue et contrôleur) qui augmente significativement la testabilité des systèmes développés en MVC comparativement à la plateforme populaire ASP.NET WebForms. Ainsi, toute la logique nécessaire à l’exécution des actions appelées par un groupe de vues se trouve à l’intérieur d’un seul contrôleur. Il devient donc relativement simple de tester unitairement, directement (sans ‘stub’ de contrôle) et avec un minimum de code la logique métier des actions exécutables pour un contrôleur donné. On peut ainsi plus facilement piloter le développement du comportement de nos actions en le réfléchissant à l’intérieur d’un test avant même d’en écrire le code! On peut même aller jusqu’à tester les messages d’erreur qui peuvent être retournés aux vues selon les différentes actions. Bien sûr, il est toujours nécessaire de créer des ‘fakes’ pour les objets du domaine dont la logique interne est testée dans d’autres tests unitaires.

En plus d’être un moyen d’assurer la qualité du logiciel, les tests unitaires sont aussi une excellente source de documentation du code. Il est donc intéressant d’utiliser une syntaxe permettant à n’importe quel utilisateur ou programmeur qui ne connaît pas encore le système de comprendre le comportement du système.

Voici une proposition pour nommer les tests et les classes de tests afin d’augmenter leur lisibilité :

  • Le nom de la classe de test contient l’action : When <the controller action>,
  • La méthode de test explique le comportement souhaité : <object/user> <should be> <an action>…

Un exemple de code avec MS Test :

[TestClass]
public class WhenClosingTheBlog
{
	[TestMethod]
	public void UserShouldSeeAWarningMessageIfHeHasNotSavedHisBlog()
	{
		var blogController = BlogControllerFactory.Generate();

		var actionResult = blogController.Save(new Blog()) as
RedirectToRouteResult;

		Assert.AreEqual(BlogController.PENDING_CHANGE_HAS_NOT_BEEN_SAVED
, blogController.TempData["WarningMessage"] as string);

		Assert.AreEqual("Warning", actionResult.RouteValues["action"]);
		Assert.AreEqual("Blog", actionResult.RouteValues["controller"]);
	}
}
public class BlogController : Controller
{
	private public const string PENDING_CHANGE_HAS_NOT_BEEN_SAVED =
"Vous avez actuellement des changements non sauvegardé. Êtes vous sur de vouloir quitter la page ?";

	//...
	[HttpPost]
	public ActionResult Save(Blog currentBlog)
	{
		var path = userProfile.Path;

		if (currentBlog.HasPendingChange)
		{
			TempData["WarningMessage"] =
PENDING_CHANGE_HAS_NOT_BEEN_SAVED;

			return View("Warning");
		}
		return RedirectToAction("Home");
	}
	//...
}

Cette testabilité est un aspect important qui peut justifier l’utilisation d’ASP.NET MVC dans un contexte de développement d’un projet Web nécessitant l’utilisation de pratiques d’ingénierie Agiles.

Secret Revealed! Guaranteed Success for your Agile Transition

Picture by charchenSo you have initiated an Agile transition and have faced some resistance to change! Or maybe, you assessed your current level of Agile Maturity and are hoping to achieve the next level. Better yet, you and your team are planning to launch an Agile transition that is not driven by the wrong reasons.

That’s great!

If you haven’t already done so, you may want to read: Getting Started – Reference Material for Managers Who Wish to Understand Agile and Scrum and What consultants don’t tell you before you begin an agile transition.

Let’s cut the chase and get to the point. Are you ready? Here it is. The secret to a successful Agile Transition -> Make people look good!

Yes. That’s it. Surprised?

I’m not talking about psychological manipulation. I’m talking about finding what drives the people you are working with and the managers around them and then capitalize on their drivers in order to get them to get on board with the transition – and better yet become evangelist for your transition. Here are some examples:

  • Suzy is hoping to get promoted to Vice-president within her organization. She heads a business line from which you need support and a dedicated Product Owner. Why don’t you explain to Suzy how innovative her group would appear to others if she agreed to embark on the Agile initiative?
  • Peter is struggling to increase the performance of his group. So far, he hasn’t shown much interest in the transition but you found out that he has been under high pressure from his manager to increase the performance of his team. Why wouldn’t you show Peter how using an Agile approach could help get his manager off his back?
  • Monica is a project manager who has lost several key people in previous months. She is usually by-the-book (i.e. PMBoK) but during a recent lunch, she admitted that she would be willing to try something different if only it would help her retain the contributors she needs to make her project successful. Why don’t you take this opportunity to get the project manager on board with Agile by offering to help her?

Don’t get me wrong. I am not asking you to lie, to cheat or to fake the objectives and expected outcome. I’m telling you to get others on board and working WITH you by telling them the whole story and helping them understand that there is something in it for THEM too.

Agile relies heavily on communications and interactions. Why don’t you start with all the people directly and indirectly impacted by the transition? Sure, it will require more time in the short term to influence people into supporting you but in the long run, you will be glad you did it.

Go ahead. Try to figure out what drives people around you or what issues they are facing. Find a solution that can help them and you’ll end-up with a win-win scenario and a successful transition.

Share/Bookmark

You might be interested in these related posts:

  1. Agile Transition – What about the teams outside the transition?
  2. Between a rock and a hard place – The managers in an agile transition
  3. Book review: Outliers: The Story of Success

Touch-Typing Training – Results

As I wrote a week ago, I trained touch-typing this week. My objective was to attain 85 wpm. Here’s a recap of my week:

Monday : I decided to use Typeracer as my baseline. It’s an online game that allows you to race others. The fastest typist wins. I had not played in 6 months or so – and it showed. My score for the last ten races dropped a bit. This was not a good start. Result after the day : 74 wpm

Tuestday : I did some drills on goodtyping.com to get back to speed. It must have helped because I raised my speed to 78 wpm.

Wednesday : mostly played Typeracer. I managed to cut down on typing errors and I’m up to 81 wpm.

Thursday : I tried to practice at night instead of during lunch time. Without much success – 80 wpm. My fingers were not obeying me. I did a few drills on goodtyping.com to increase accuracy.

Friday : Success! I managed to consistently type over 80 wpm today by concentrating on typing slower but with less mistakes. I managed an average of 87 wpm on my last 10 races.

The week is over and I achieved my objective of 85 wpm. I did this mostly by reducing mistakes – they can get really slow you down.

Thanks to my colleagues who followed in my track and helped me focus on this challenge.

How to warn users not to use an interface

Everybody knows no one reads documentation. Hamcrest found an original way to warn users to use the org.hamcrest.BaseMatcher class instead of the org.hamcrest.Matcher interface.

Look at the interface yourself.

They added a dummy deprecated method called _dont_implement_Matcher___instead_extend_BaseMatcher_ in the interface.

I am still unsure whether I will ever use this in my own projects. But when this method appeared in my code today I could not help but look at it. It was then totally clear that I was not doing what they wanted me to do. I’ve seldom seen documentation that obvious.

Minyaa Suite turns 1 year old today

Minyaa Suite was born to replace Kaamelot plugin, a plugin created 5 years ago, where I tried to merge all enhancements brought to JIRA, in order to meet our needs.

This first year was mainly spent:

Next year we will concentrate on the following points:

  • ERADICATE most intrusions performed by Minyaa, in order to :
    • simplify its installation,
    • support the UPM (Universal Plugin Manager)
    • perhaps support JIRA Studio (this will be a challenge!)
    • stop making the Atlassian Support guys crazy about Minyaa ;)
  • Continue to enhance Minyaa Workflows’s features (OSWorkflow has again some useful mechanisms),
  • Extend Minyaa Time with new features (wait and see!),
  • Integrate Myrddin plugin  in Minyaa Projects (Don’t try finding it… It was developed at the same time as Kaamelot, but was never released)
  • And always assist you in the adoption of Minyaa.

Happy Birthday Minyaa !

Align JIRA Workflow to your process

Align JIRA to your process is more than a slogan. It is an objective that we are trying to reach with Minyaa Suite for all our clients.

Since Minyaa 2.0, a new Workflow Designer allows you to create more easily Workflows using a graphical tool and giving the ability to use some unreachable features provided by OSWorkflow, library used by JIRA to manage workflows.

When you open JIRA for the first time, you discover the generic workflow :

  • 5 Steps : Open, In Progress, Resolved, Closed and Reopened
  • 7 Transitions : Create Issue, Start Progress, Stop Progress, Resolve Issue, Close Issue, Close (Resolved) Issue and Reopen Issue

Using the default Workflow Editor (HTML based), you see them as demonstrated below:

Default JIRA Workflow

There are 2 Close Issue transitions, but when you try to produce the same Workflow using the default editor, you are not able to create 2 transitions with the same name.

There are 4 transitions reachable from different Steps, but always trying to do the same with default editor, you are not able to reproduce it.

After reading JIRA documentation and different JIRA Community contributions, you will discover that you have to use XML language to reproduce the default JIRA Workflow!

If you open the default JIRA Workflow with Minyaa Workflow Designer, you will obtain the view below:

Default JIRA Workflow view with Minyaa Workflow Designer

You will have a better view of existing interactions between the different Steps and Transitions.

Many companies consider JIRA as an inexpensive tool to implement workflow for some of their processes … Fine ! But their processes are not always simple ones, and by using the default JIRA Workflow Editor, some of them may obtain something incomprehensible as showed below:

Very large Workflow built with JIRA

Workflow XXL (Very large Workflow built with JIRA)

Edited with the JIRA Default Workflow Editor, this workflow needs more than 5 pages of your Browser ! Even when edited with the Minyaa Workflow editor, this workflow is still too large to be used easily.

This Workflow has 28 Steps and 141 Transitions … an XXL Workflow !

If we take a deeper look inside this Workflow, we will be able to identify some Transitions candidate to be defined as Common Transition or perhaps as Global Transition, and/or qualified as Recursive Transition, but also some exotic practices :

  • 20 Cancel Transitions to step Cancelled:
    • 4 allowed to all Users
    • 1 reserved to the Reporter + Screen
    • 1 reserved to the Reporter or Project Roles (10002,10031)
    • 14 reserved to Project Roles (10002,10031)
  • 6 Reject Transitions to step Rejected:
    • 1 reserved to the Reporter or Project Roles (10002,10030,10031)
    • 4 reserved to the Reporter or Project Roles (10002,10031)
    • 1 allowed to all users
  • 12 Request More Info Transitions
    • 1 reserved to the Reporter or Project Roles (10002,10030,10031)
    • 11 reserved to the Reporter or Project Roles (10000)
      • 6 Transitions to step Deployment – Pending Info
      • 5 Transitions to other different Steps
  • 9 Edit Transitions (All recursives)
  • 11 Put on Hold Transitions
  • 18 Enter Info Transitions
    • 6 Transitions from Pending Info (each of them with a condition to return to previous step), but Pending Info is never reachable (It appears that it was an aborted try!)
    <condition type="class">
       <arg name="jira.previousstatus">Deployment - Upload Verification</arg>
       <arg name="class.name">com.innovalog.jmwe.plugins.conditions.PreviousStatusCondition</arg>
       <arg name="jira.mostRecentStatusOnly">yes</arg>
    </condition>
    • 6 Transitions from Deployment – Pending Info (each of them with a condition in order to return previous step)
    • 6 Transitions from different step, always returning to previous Step
  • 4 Activate Transitions
    • 2 Transitions are strictly identical
    • 2 Transitions differs just by a Post-Function
  • 13 Reschedule Transitions

As you see, most of these 93 Transitions may be assumed duplicated. When you have to define complex workflow, JIRA allows to create Step Transition only, and not Common Transition.

Editing workflows with XML may allow you to use Common Transition, but in this current example, the associated XML file has more 6000 lines !

Minyaa Workflow allows to declare Common Transitions, Global Transitions and qualify them as Recursive Transition, without using XML syntax.

To be honest, Minyaa Workflow Designer (developed in Flex) has encountered its current limits with this workflow when we tried to refactorize it. We will have to enhance its performance.

But in order to see what this workdlow would be, if it was created directly with the Minyaa Workflow Designer,  its re-factorization has been done manually through XML.

We are obtaining the following Transitions :

  • 4 Cancel Transition
  • 3 Reject Transition
  • 7 Request More Info Transition
  • 1 Edit Transition qualified as Recursive Transition
  • 1 Put on Hold Transitions
  • 1 Enter Info Transition with the Post-Function : Back to Previous Step
  • 3 Activate Transitions (potentially only 2)
  • 1 Reschedule Transitions

Just by using Common Transition and the Back to Previous Step Post-Function provided by Minyaa Workflows (release 2.1), the workflow has now 60 Transitions (21 Common Transitions) and 22 Steps. It is now a XL Workflow.

Workflow XL (refactorisation of Workflow XL)

Workflow XL

The above screenshot is excruciatingly painful to read… From 93 Transitions identified as possible duplication, there are now 21 Common Transitions. Links from Transition to Step have been reduced, but there are still many links from Transition to Step.

With the current workflow, most of the new Common Transition are not in the Nominal Scenario : Cancel, Reject , Request more Info, Enter Info, Edit, Put on Hold. Then, you are able to hide Links from Steps to Transition …

Workflow XL without Common Link

Workflow XL Light (Common Link hidden)

I hope you do not have to design workflow as complex as this one, but I imagine that you do not have time to invest in learning the XML syntax for OSWorkflow library.

Like the default Workflow Editor, with Minyaa Workflow Designer, you will be able to :

  1. Clone a Workflow or Create a new one,
  2. Create Normal Step and Step Transition
  3. Configure all Transition with Condition
  4. Validator and Post-functions

Still unable to associate a Screen to your transition!

But also, you will access more features provided by OSWorkflow and be able to :

  1. Move Step Transition as Common Transition,
  2. Move Common Transition as Global Transsition,
  3. Move Global Transition as Common Transition,
  4. Detach a Step from a Common Transition,
  5. Qualify any Step, Common or Global Transition as Recursive Transition,
  6. Link a Step directly to a any Step or Common Transition
  7. Link a Step to itself and also create a Recursive Step Transition
  8. Have unused Common Transition
  9. Use some special Worflow function provided by Minyaa
  10. See your workflow in a graphical interface (It is always more easy to present)
  11. Also create a Snapshot of your Workflow for documentation …

Download a 30 day Trial for Minyaa now and discover Minyaa Workflow Designer.

You can now design the workflow needed by your business, and  do not let a workflow design your business !

Your feedback is welcome to enhance the Minyaa Workflow Designer capacities.

Useful links to the documentation:

Note : The re-factorization presented above was done using Minyaa 2.1