Monday, 30 March 2009

The gene of the irresponsibility

    One of quality engineers from my former team asked me a stunning question:
- How many hotfix iteration have you been doing on average before the major release?

    You know, there is a special context of that conversation about our project and team, which still continuing without me on board. It was hard to admit that we used to have no hotfix iterations at all. To be precise, assume that hotfix is iteration when no functionality created, but rather fixed, visually improved or removed in order to keep software consistent and to not expose unfinished parts. In reality hotfixes became so usual recently that I didn't pay much attention that I had never done it.
    After rushing weekend I can confess: People, indeed I didn't have ANY hotfix iteration. In fact, I can see no argument why any project or team should have such iterations.

Aren't you able to predict that some certain parts won't be completed before?
Many will appeal to the hectic they suffer in the project and justify lack of strategic thinking. Still irrespective to what model did you choose agile or waterfall there are people whose primary responsibility is to make forecasts. So absence of any prediction can not be tolerated. Regarding our project I still have two arguments:

1. There is a difference between biasing within one iteration and biasing over iterations: I can imagine why team committed to 23 tasks was managed to finish only 20. That's something that forms team performance (or in Agile terms - velocity).
But how can you (team, manager and product owner) do 3 iteration in line and then you need 2 more?
2. We are talking about projects within one team and one product owner. New product implements functionality of the old one. Product owners and developers are mostly left unchanged. Users left the same. Even requirements can be reused. Only things were changed are technologies (I guess that's positive upgrade) and process (...)

Spit and polish in Software

    To my former NTSR project something called spit and polish has been introduced. Spit and polish is an iteration task which includes resolution of minor troubles and fixes.
Examples would be like incorrect rendering in webforms or some minor problems like only USD is supported (in control that suppose to have EUR and JPY).
IMHO, this is our project's KNOW-HOW and arguably the most stupid practice I've seen in IT. Pragmatically I would say there are 2 negative things about spit and polish:
1) everything can be claimed as spit and polish.
2) no one cares about time spent on that.

    The latter requires certain explanations: In fact developers are do not putting much efforts to register hours for tasks pretended to be spit and polish. And what they definitely not do is to describe what exactly has been done within spit and polish (because - saving time on that is primary reason why do we have spit and polish).
    But even if developers would be enough motivated to register time spent on that there is anyway deeper trouble ... From management perspective this time can be treated as nothing but direct loss: you can neither predict nor decompose this time. And that means that you can't do anything about it at all.
    The root causes of this is going through human factor and dissolving somewhere in the deepest aspect of human psychology. Being forced to deliver faster, people tend to shrink their responsibilities. Manager who suggested to deliver the functionality first and then the quality does not care about quality at all. I remember remarkable interview with Bjarne Stroustrup where he was saying
In reality, that's impossible. People reward developers who deliver software that is cheap, buggy, and first.

I guess there is no hope that at some point the gene of the irresponsibility will be extinct. God has special providence for its adherents ...

Friday, 27 March 2009

JIRA Studio tips

I used to work with Atlassian JIRA Studio, which is from technical perspective the most developed project management environment. It provides immensely rich capabilities for iteration planning and for tracking. I can agree that sometimes it's very compicated to use it, since some of features need skillful approach to use them properly. As you can see in Atlassian case studies customers sometimes very happy to have professional environment for their professionals.

Customer's CEO persuaded that JIRA Studio saved up to 20% of time. But I'm pretty sure that with compliant approach you can have even greater advantage. Especially if you are technical professional and not scared with exploiting it.
From management perspective the most informative thing is your dashboard. JIRA Studio is quite tolerant in providing information to everybody in team, but to collect it effectively is really important. And dashboard is either your favorite place already or... you should take care to make it your favorite place.

So, pay some attention to the switch on the left top. Managing dashboard allows you adding and customizing different portlets. Many of them are useful, but first thing you have to do is to remove surplus: keep here only information about 1-2 projects you really interested in.
After you have released space you may want to populate it with useful information: It's better to replace projects portlet with single project portlet:

My favorite portlets are
Created vs Resolved Issues - this very good overall statistic for any project. Just try to guess how deep is rabbit's hole.
Average Time in Status and Average Age - This allows you to define to keep in balance QA and development teams.
Bamboo Plan Summary - yes, sure I always can view Bamboo's dashboard, but how good is to have everything on one page.
Recent Changesets - good monitoring tool if developers lean to demonstrate their laziness.

The disadvantage is that all this things (that belong to unexplored functionality) is badly supported and extremely slow. So after your Studio project exceeds 3000 issues you have to wait very long before you'll get dashboard statistics. Fortunately, dashboard can be interrupted anytime and there are workarounds to get summary you need.
The key is to use {sql} and {sql-query} tags. This is not only very flexible mechanism to retrieve information from JIRA, but also unrelenting security violation (oops ...) This queries allows you to get any info directly from database. Even if it's restricted accordingly to security rights. For instance if you are restricted to view document named Server access policies. All you need is to create page and put this wiki markup:

select bc.body from content c inner join bodycontent bc on c.contentid = bc.contentid
where c.title = 'Server access policies'
order by c.version desc limit 1

Where ConfluenceDB is database name where all wiki pages are contained.

But how to get information about Db objects? Well, you have to grow in postgre and learn JIRA database objects. The best way is too post this wiki page for everybody's disposal

Let's use [DB Schema|] and [PostgreSQL|] to retrieve information from JIRA Studio.

h5. How to get all databases
select datname from pg_database where datistemplate <> 't'

h5. How to get all tables? {run:autorun=false|hideRun=false}
SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' and tablename not like 'sql_%'
order by tablename

h5. How to get all table columns? {run:autorun=false|hideRun=false|replace=tableName:jiraissue}
SELECT attname , pg_type.typname, atttypmod FROM pg_attribute, pg_type WHERE
typrelid=attrelid AND typname = '$tableName' and attname not in ('tableoid', 'cmax', 'xmax', 'cmin', 'xmin', 'oid', 'ctid');

h5. How to get all tables from Confluence? {run:autorun=false|hideRun=false}
SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' and tablename not like 'sql_%'
order by tablename

h5. How to get all table columns from Confluence? {run:autorun=false|hideRun=false|replace=tableName:content}
SELECT attname , pg_type.typname, atttypmod FROM pg_attribute, pg_type WHERE
typrelid=attrelid AND typname = '$tableName' and attname not in ('tableoid', 'cmax', 'xmax', 'cmin', 'xmin', 'oid', 'ctid');

For instance if you wish to know how many tasks assigned to your people and what are those tasks let's use this wiki markup
Opened tasks:
SELECT pkey, issuestatus, summary, assignee, reporter FROM jiraissue where
assignee in ('john', 'viktor', 'ashoka', 'kolyan', 'boss', 'vlado', 'kim')
and issuestatus <= 3

How many tasks assigned with references to people:
SELECT '[~' || assignee || ']' as Assignee, Count(*) FROM jiraissue
where assignee in ('john', 'viktor', 'ashoka', 'kolyan', 'boss', 'vlado', 'kim')
and issuestatus <= 3
group by assignee

The latter part is undocumented functionality of JIRA, so it might be changed if JIRA Studio is updated.
JIRA Studio is quite avarice to give information about itself. To get all information you have to trigger some exception inside: This differs from version to version but in most cases errors are connected with issue navigation. Fresh errors can be retrieved from here

There are many more tricks to make JIRA Studio to a dream collaboration tool.

Grateful acknowledgments to Dmitra and Mykola R. who helped me very much in collecting information about JIRA Studio tips and tricks.

Monday, 9 March 2009

Internet dog

    I remember good old times when in the late 90s this image appears on my very first mailbox.

    It wasn't as cute as any other jokes, but I remember that my conscience was totally agree on that: yes, said I, no one knows and nobody really cares who I am.

    Later on this message from the past is turning to be very dubious. Nowadays I'm convinced on Internet anyone knows that you're dog. Moreover be sure, they know everything about you: how often you bark, how often are you beaten by your host, how many puppies you have. The reason?

  1. Internet still makes you feel safe and carefree (It's better to say careless) about your privacy

  2. ... but becomes extremely effective in searching

    What if someone cares to be aware who you are? I was amazed how much information people can learn about me just googling my name: my profiles in social networks, my articles, publications, connections, out-dated CVs ... I'm not sure that I can memorize all those things better ;)
    How about specialized services to get information about people? Recently I have discovered PIPL.
    Oh cool, here I can type e.g. name of my classmate and find extensive information that he was graduated his college, then was hired by Morgan Stanley, then in one year got fired with some peculiar circumstances ...
Let me try to type my ex-girlfriend name: she's got married in USA and in two years got divorced (I can see it in her CVs). How about my former chief? My German language teacher? My friends? My enemies?
Do I need to know all these things?

    In most cases information is scarce: most of people (fortunately to them) do not have adequate representation in Web. Wait a minute! What if I type my name?
    Woosh! Those people who created PIPL know their job well. And if you get embarrassed with result to the right side you can see proposal to defend your reputation.
    Cool, isn't it? Have you ever though you have public reputation?

    Reputation defender will be happy to track news, messages, comments, suggestions and rumors about you from your lyceum's alumni journal to Forbes and Wall Street Journal in order to defend your reputation.

    Embracing Agile ideas I never think that openness and transparency is bad thing. And now I didn't change my mind. All you need to know is that you're responsible for your representation from the very beginning of your career and you only who cares about your privacy. In XXI century no one can expect that information told to someone or written somewhere will be not exposed to publicity. Whatever it was living journal, facebook or your profile at gay-portal.
    That's shocking, but not as bad as it seems to be at first site. Although many people will suffer from this, in most cases they are just people who are succeed in trying to be better than they are. No mercy to them. In most cases no one need to slander your name and you will have more or less adequate self-portrait in public sources

Have a nice day!

Saturday, 7 March 2009

C# vs. Java. Slight differences

So, there is a one month passed since I became Java developer ...

Long before I've started to develop something essential on Java, this language invoked very contradicting thoughts in my mind.

In early 2005 when I have started my career in IT, I've started mainly with VB and C#, but there were dozen of languages I used as supplementary: Python, Perl, PHP, VBScript, JavaScript, batch, NAnt scripts and so on. Among them Java turned to be something prominent. Since it was and is lingua franca of IT industry I extensively used literature and articles written by Java developers and architects. Even if they were created to be used by exclusively Java teams. Thus besides Anders Hejlsberg and Andrew Troelsen not only people like Martin Fowler and Mike Cohn, but also Craig Larman and Bruce Eckel became my masterminds in IT branch. Later on when I grown up enough to make presentations how to do software and how not to do I was leaning to make code snippets either Java, still being quite distant from development in Java itself. But to be honest I was never felt uncomfortable talking to my colleagues in Java. Java and C# is in fact very close to each other, but there is one more peculiarity that makes couple Java-C# very similar to language couples: C# developers normally better understood Java then vice versa.

Now when I delved deeper into Java, I realize how many peculiarities in Java are actually different: Java has larger heritage from C++ then C#.

In practice you can try to evaluate this code in both languages:

String a = "Falafel";
String c = "fel";
String b = "Fala" + c;
System.out.println(a == b);

In C# you'll have to use System.Console.WriteLine instead of System.out.println
In Java you'll get false, while in C# you'll get true. Why? Simply because Java compares addresses of a and b, while .Net compares content. You should use equals (before 1.6) and StringUtils (since 1.6) in Java to compare strings correctly.

How about casting? Have you ever tried evaluate this expression


Experienced Java developers will answer: (byte)-1 will cause overflow, so you might expect something like 65535 on the very end. C# gets obviously the same answer, but by default C# compiler refrains to compile such a mess. You'll be kindly asked to use unchecked option on your own risk:

    int i = (int)(char)(byte)-1

Working with numbers is very messy in Java (I will keep using references whenever I worked with arithmetic operations
Hex number 0xfa1afe11 will output positive result in C#, but negative in Java. The reason is that hex number with leading 1 treat as negative.
Floats can also challenge you: Java expression

System.out.println(2 - 1.1);

outputs 0.8999999999999999
while in C#

Console.WriteLine(2 - 1.1);

gets 0.9

NB: I must admit, that in .Net trouble with floating point operations are not finally resolved (MathLab and Maple in any case do them better)

Java has special class BigDecimal to perform operations with additional precision or value, but you might be careful using them either. Don't you know what is the difference between two following expressions in Java

BigDecimal dec1 = new BigDecimal(.1);
BigDecimal dec2 = new BigDecimal(".1");

Can't you guess?
Oh, you might be surprised that first one will output huge ugly number


Gurus highly recommend to use constructor BigDecimal(String) and not convert primitives to BigDecimal directly

Expressions like i = i + k; and i += k; are not equivalent in Java, although many Java developers think they are.

In any case my way in Java has just begun and it will take couples month until I will be able to cause another overproduction crisis in IT ...