Wednesday, April 14, 2010

An Ode To Testing

Even though I am all for quality, testing can get torturous at times. So here is a fun take on the perils of testing by yours truly :)

"O Horrible testing, in ways so many of thee
You take pleasure in tormenting me

Test cases are many, JUnit is one
And these useless stubs under the sun
Trying to focus my eyes water
As my head starts feeling hotter
And I yawn and I fall
Horribly sleepy one and all
In search of quality I seek thee
But a JMocking venomous smirk is all I see
Murderously as you try to JRun me
Yes, you take pleasure in tormenting me"

Tuesday, April 13, 2010

Thinking Quality: Basic Thumb Rules

Quality of code is often a critical issue in a development team. Ensuring the quality can get complicated for a variety of reasons, so let us explore the possible ways to ensure code quality.

First, it is important to get the programmer to think how he can keep improving the quality of his code. Bugs are inevitable, but that is no excuse for shabby programming. However, it is difficult to get most developers to take this seriously without antagonizing them. Nevertheless, making unit testing integral to development can check many if not all bugs. People can also be encouraged to develop a customized check-list for themselves to help them avoid common mistakes. Having a "company-wide" check-list may prove to be both counter-productive and bureaucratic.

Second, code reviews can be useful. However, it can cause antagonism within the team and people may be reluctant to criticize each other. Moreover, it can be done effectively only by senior and more experienced people in the team. Anonymous, time-bound reviews is one potential answer to use this tool.

Third, using Agile and related development technologies will help the manager to leverage the full experience of the team, get them closer to the requirements and avoid many bugs related with misunderstanding specifications.

Finally, the productivity of the team is the function of morale. Morale for different people can mean different things. The best way, however, to build it is by having a clear vision for the company and being able to percolate it meaningfully in every aspect of work. Further, focus on the strengths and interests of each team member instead of focussing on their weaknesses.

Thursday, February 4, 2010

Nested Table Component for Blackberry

Based on our last Simple Table component, I have put together a Nested Table as well. The main features are:

-Each row can be rendered like an irregular table
-Each row is backed by an object
-Possibility to add a popup to row click

These classes demonstrate how to use the component:
SampleApplication.java
SampleRowBackingBean.java
SampleBean.java

You would need the following classes to make this work:
BNestedTable.java
BMultiRowBackingBean.java
BGenericTableCallback.java
BAbstractRowRenderer
BNestedRowRenderer.java
BSimplePopupScreen.java
FieldCreatorUtility.java
UiProperties.java

Possible improvements:
-implementing varying row heights
-implement table header, table footer and column header

Wednesday, February 3, 2010

A Simple Table Component for Blackberry

Just worked on making a J2ME based prototype for a Blackberry (JDE 4.7+). The documentation, the website and the API are horrible, to say the least. We are using the Eclipse Plugin for development. One of the prime difficulties we faced was the absence of a well-defined table component. "ListField" is horribly designed and the example that is given in their documentation does needs serious improvement. Moreover, to make a flexible component that renders a list of messages (like the SMS message list) with each composite row selectable as a whole, no example could really help. So, I have made two components that you can improve upon and use as you please.

The first one, that is given in this post, is a simple table. It takes a 2-D array of fields and converts it into a visual table. It simply improves upon ListField. You would need the following three classes:

BSimpleTable.java
BSimpleTableCallback.java
BSimpleRowRenderer.java

Then in you code, use a similar code snippet to make and add a table (here we use it to create the title of the screen):

Field[][] titleContent = new Field[1][];
titleContent[0] = new Field[3];
titleContent[0][0] = new LabelField("S.No.",
DrawStyle.ELLIPSIS);
titleContent[0][1] = new LabelField("Message",
DrawStyle.ELLIPSIS);
titleContent[0][2] = new LabelField("Time",
DrawStyle.ELLIPSIS);
int[] widthPercent = {10,63,27};
int[] paddings = { 5, 0, 0 };
setTitle(new BSimpleTable(titleContent,
widthPercent, paddings,
Field.NON_FOCUSABLE));

If you don't want to sign the application, hard code the total screen width instead of using Display.getWidth()

Also, see: Version Specific Developmnet Guides (3.6 to 5.0 beta)

Wednesday, December 16, 2009

Marketing Triumphs Technology?

I have heard quite a few business leaders implying that marketing always triumphs technology. I do not dispute the importance of marketing. Nevertheless, working in technology business myself, I have no doubts that in the long-run technology is as important as marketing. Putting one above the other is to disparage one at the cost of other.

It is possible to use logic to exhalt any department. For example, the Business Development department can as easily assert that it is the sales force that gets in the money and is truly in touch with the truths at the ground level, unlike marketing managers that make a sweet sounding theoretical plans in their ivory towers. Technology, Marketing and Sales have their own place in the company structure. Comparing one with the other is absurd, unwarranted and potentially destructive.

Many technology guys are more interested in developing and creating. Innovation cannot come to them easily unless they are given a chance to interact with customers and involved with the business side of things. Barricading engineers & scientists in laboratories and complaining about lack of innovation is ironic, to say the least. Without customer interaction innovation is difficult to achieve. Marketing itself can be highly destructive if it operates in isolation from the customer. Sales without customer focus will kill the product eventually. Some people talk of innovation as if it is a commodity or a God given gift. My experience tells me that innovation is a result of closeness to customer and willingness to experiment.

Innovation may not be about wearing white coats, but it is not about wearing a tie and a suit (with a marketing hat) either. Innovation is an attitude born out of a company's culture and its people. Period.

Thursday, September 10, 2009

Speeding Up Technology: Thinking People

In the previous two articles I have talked about the need for a vision with an ambition and the need to cultivate leaders. I have talked about the importance of policy. It, however, strikes me that who will make policy? Policy is the product created by people. So we have read about the importance of hiring the right people. But who will hire the right people? Only somebody who believes in it as a concept and is willing to implement it in practice. Moreover, it does not end here and the company needs to be ready with at least ambition-vision + cultivate leadership mindset so as it can make full use of the right people and retain them. Bottom-up changes are generally painful and often viewed with suspicion by almost everybody at top. Top-down changes without getting people involved are viewed similarly by people who are not party to it. The next pre-requisite, then, is a lot of communication and flexibility within the limits of the clearly defined vision/ policy.

The organization is defined by its people. Nevertheless, people cannot operate in a vacuum. Having a leader that nurtures such people and inculcates a sense of pride and ownership in them without duping them is a rarity, and can be a supremely powerful force in the growth of a company.

What has to be remembered, though, is that no policy, no vision can be immutable. If there is one certainty in this universe, it is change. More so in the technical world. The playing field can change completely in few years at best and few months at worse, such is the speed of change. The only defence can be having the right people and cultivating in them a spirit of learning and leadership. I would call it a "nursery" of leaders, hiring brilliant people and preparing them to rise

Tuesday, September 1, 2009

Speeding Up Technology: Cultivating Leaders

Most people understand leadership as power and/or authority and there is a lot of talk about the "strength" and "vision" of a leader. However, it is easy to mistake bullying & stubbornness for strength and demagogy & rhetoric for vision. The difference is too subtle and short-term results too similar to cause any alarm.

The generally accepted way to make a new product at greatest speed is to place some brilliant developers under an able Senior Manager or Product Architect. Now, it can take two directions from this basic set up. One way is that the manager just focuses on the current product and executes the project in the style of "Command and Conquer" by making things simpler for his team and spelling out clear instructions to execute the project. If the team struggles, he dives right in and leads from the front ensuring the correct course for the ship. All sailors learn a lot by seeing the able captain in action and there is tremendous growth. He can encourage his sailors to learn and grow.

All is happy in the world till the point, till one of the sailor learns enough to attempt to captain the ship, perhaps a smaller ship. The captain may view it as abject desertion or, worse, covert mutiny. Or he may provide the testing ground for the willing sailor as he knows that the company will eventually have many ships and he cannot steer all of them alone. In this context, the vision and growth strategy of company assumes paramount importance. If there is no growth potential, it will definitely be either desertion or mutiny (with accompanying unpleasantness). Else the business will gain another leader and grow.

This also makes further demand on the captain to actively recognize, cultivate and have an outlet for promising young sailors. Else he should hire sailors who do not harbour such ambitions and are happy sticking their nose only to their immediate work. Since no company can provide an unlimited supply of opportunities, one has to be ready to let go of talented people if they cannot neither find optimum use of the same nor think of ways to cultivate them further.

A company trusts only the best to build the nuts and bolts of their product. If it cannot make a strategy to retain them, it is a shame. This can not only lead to loss of talent but can also disrupt progress of the product due to loss of expertise and problems associated with hiring. Hence, it is in the best interest of the project to give a thought about this before starting. Here, as I said, the vision and policy of a company may be the ultimate deciding factor. At least in the initial life of a company, an entrepreneurial team that generates more entrepreneurial teams can be a powerhouse of growth and innovation. That it will affect speed positively over the long run is but one of the many side-effects of a well-thought and flexible company policy.