Error handling

Check out the post on error handling by Mika Raento, the researcher at the University of Helsinki, Forum Nokia Champion and the author of the huge amount of free source code examples for Symbian.

Mika talks on the ways of error handling in software and how the developer can aid the error handling:

  • You may need to document specific errors and supply additional information to the immediate caller.
  • The error information must support generic handling strategies, like a blind retry.
  • Low-level exceptions should not be remapped by upper layers.
  • The routine detecting an error is responsible for describing it in terms understandable to a human, often the user.
  • The system must be able to tell the user if they should contact another human.
  • The system must produce different messages for consumption by different humans.

Toyota’s Five Why’s

Toyota is one of the industry leaders known both for its quality and revenues. It’s quality system was being built for decades and quite often the quality of the cars was by an order of magnitude better, than what, say, it’s US competitors had to offer.

There are few simple principles behind the Toyota quality system. Here are two of them:

  • Built-in-quality
    Quality is not something that is added at the end of the production line. Every major robot that works on the car parts has sensors and intelligence to recognize defects early and either fix them or remove the detail from the line.
  • Toyota’s five why’s
    Whenever the problem occurred, the engineers ask why. Once they identified the factors that led to it, they investigate the reasons for these factors to happen. This process is repeated until no new information is forthcoming. Usually five levels of investigation is enough, therefore the technique is called “five why’s”

Could the Toyota methods be applied in our industry? Early defect discovery and through investigation of the root cause should help producing astonishingly reliable programs. But wouldn’t it cost too much? Is it economically feasible? Do we have time to fix all these bugs?

Does it pay off? – Ask Toyota.

P.S.
Thanks to Lasse Koskela for the idea of this post

Do you own your code?

When there are more, than one programmer on the project, the work has to be divided somehow. Agile methodologies propose self-organized team to decide who is doing what, more traditional waterfall approaches propose that manager allocates tasks to the guys with the free time slots. Whatever the method is, there is one more thing to consider: who is allowed to make changes where.
It is quite often that particular modules are “owned” by particular people and only they are allowed to make reasonable changes there. Usual argument is “The person, who doesn’t know the module, can unintentionally break it”.

What is interesting is why is it easily possible to the fellow programmer to break the code easily. After all he is often as experienced as the author of the code. The sad answer could be that the code is hardly understandable, too complex, not well commented or doesn’t have enough unit tests to prevent the regression. Most of agile development methods promote: 1) fixing, testing and finishing the existing code, before adding new features; 2) test-driven development; 3) common code ownership; 4) frequent peer code reviews. The first two items help to cope with the “can unintentionally break it” part of the argument, the last two – with the “the person who doesn’t know the code”

Next time you will hear that somebody should have an “own” module, ask the speaker for the reasons and tell about the known cures for the “code ownership syndrome”.

P.S.
Thanks to the F-Secure person (sorry, still don’t know his name) who shared with me the arguments presented in the post

Test the platform

One concrete tip about from the seminar discussion: If you are unsure about the platform features, create a test for it.
One of the topics discussed was Test Driven Development (TDD). It is the software development method, when programmer first creates the unit test for the new functionality and only then implements it. I had the concern about the unknown platform capabilities. It happens so, that I and my colleagues often work on fresh betas of the coming software platforms that don’t have all the new features documented or even implemented. Therefore quite often I don’t have a concrete plan in mind. I try using one feature and another until I find a way that satisfies the original requirements somehow. Of course, these feature trials tend to become the release code and it’s mentally difficult to write a unit test after the code – after all this way it is not TDD anymore.
The solution proposed by somebody from F-Secure (sorry, I don’t know the name. Please, comment if you know) was as simple as every ingenious idea. If you are unsure about the platform features, create unit tests for them. It might not be possible for the GUI area, when you have to observe the results manually, but for all the other areas such tests would be a good compatibility test and a good starting point when you’ll have to port your application to the next version of the platform.

Agile SW Development Practices Seminar

Last week I was attending the seminar on Agile SW Development Practices in Vantaa (Agenda in pdf).The seminar was very nice with a lot of speakers, talking about their own very practical experience in agile-related SW development. Most probably I’ll highlight several seminar topics in the coming posts.

At the moment I can present my main impression: all the agile methods are about is truth and visibility. Don’t lie to yourself; don’t overplan, what you are not going to implement; don’t pretend the project is 95% ready, if you are expecting endless bugfixes and don’t hide the current situation from your customers. That’s it. All the remaining details are about how to implement these principles in practice. I.e. how often and in which terms to report to customers so that they understood you and weren’t overloaded with the unnecessary details, how to prevent yourself from overplanning, etc.

Compilable Symbian Code Examples

SymbianExample.com is eventually up and running. It took quite some time to restart it, but I am very much pleased with the results. It is build on the Drupal CMS 4.7 Beta 4. As it is still beta, I disabled comments – they work ok, but display error-like messages, when you post. They will be enabled whenever Drupal community releases the next Beta or RC of the 4.7 (sometime in February)

Nevertheless, the site looks great (as for me) and I am extremely pleased with the customization possibilities, to be enabled one by one in the close future.

And by the way. You can post or link your Symbian code examples there 😉

Series 60 examples

Today I’ve spent several hours trying to locate a simple example for the Nokia’s Series 60 3rd edition. And miserably failed.

At the moment I am developing my first 3rd edition application. It is also the first app, where I am going to use vector icons in the svg format (introduced in Series 60 2nd edition Feature Pack 3). Somehow in all my previous projects I did the non-UI components only and never bothered about the application wrap-up.

Today in the morning I found that even though I have access to a lot of 3rd edition applications, I don’t have a single simple example. As you might guess the attempts to “intelligently copy” the existing code failed.

I’ve spent the following two or three hours digging NewLC, Forum Nokia and Google looking for a HelloWorld or at least some program with the custom icon. It happens, that neither on the Forum Nokia, nor on the web, nor even in the Series 60 SDK (!) there is no single 3rd edition example. I wonder how third party developers are supposed to create great applications for the new platform without any (!) example.

Fortunately I managed to solve the problem myself. Now the action point for me is to speed up the SymbianExample upgrade and start posting the 3rd edition examples there – looks like there is a big demand for them.

P.S.
For those interested the problem was in that I forgot to include one of the header files into the resource. Unfortunately resource compiler didn’t complain, and the path to the application was incorrect

Multitasking in the workspace

On Joel’s Multitasking in the Workplace
Multitasking in the Workplace:
Joel Spolsky, a known writer on software development related topics is a long standing advocate of private offices for every developer, perfect working conditions and managers whose main role is to “move furniture out of the way, so people can concentrate on their work”. Lately he found the support in the published in the NY Times research report claiming that in the cubicle space people loose hell a lot of time on interruptions. I believe that there is a proven way to unite the advantages of the open-space communication and private office focus.

Switching between tasks can take too much time
Joel’s point is in that software development is a type of task that requires very high concentration. It takes too much time to switch between different tasks. Open office space might mean the increased level of inter-communication, but at the same moment it means too high rate of interruptions by the colleagues. Gloria Mark’s study shows that in the open space based software development company
“Each employee spent only 11 minutes on any given project before being interrupted and whisked off to do something else. What’s more, each 11-minute project was itself fragmented into even shorter three-minute tasks, like answering e-mail messages, reading a Web page or working on a spreadsheet. And each time a worker was distracted from a task, it would take, on average, 25 minutes to return to that task”

Overcommunication and undercommunication
The lack of communication is a known problem in the software industry. Lack of developer’s focus and continuous interruptions is another one. It is the communication problem, that open space offices aim to resolve, and it is the concentration problem, Joel considers being the most worth solving.
There is a set of Agile development methods that put special emphasis on both enhancing the inter-developer communication and study of the consequences of the rate of communication. It is of no surprise, that having both “Individuals and interactions over processes and tools” and “Responding to change over following a plan” as the main values, Agile methods pay attention to the respect to the individual’s work (i.e. to its concentration) while trying not to harm the level of communication.
Here is how Scrum, one of the most popular methods, addresses the open space issue.

Scrum
The grand Scrum’s idea of finding a concentration-communication balance is in protecting the developers from the potentially irrelevant discussion topics, in encouraging irrelevant topic discussions to happen at the dedicated moments. This idea is not unique to Scrum, but here it is used to the full extent.

1. Time-boxed iterations with a fixed set of goals
As most of iterative development methods Scrum utilizes time-boxed iterations strictly limited in time and, what’s more important, with very limited set of concrete goals. Scrum does encourage frequent and early requirements and design changes, but all the changes are permitted only at the edges of the iterations. During the 30 days of the iteration, goals and main focus are frozen. In the world of chaos, there is a need for some stability. To emphasize this feature, Ken Schwaber, one of the Scrum creators, even named his web-site www.controlchaos.com.

2. Daily meetings

Scrum overview from www.controlchaos.com

To filter out the interruptions even more, Scrum features the daily meeting practice. They are sometimes referred to as “stand-up meetings” to emphasize the short length of the meeting. During it every person answers only three concrete questions: 1) What did you do yesterday? 2) What are you going to do today? 3) What got in your way of doing work? The daily meeting is a very short moment (usually 5-15 minutes) when everybody updates the understanding of the project state. At this moment potential problems (usual source of interruptions) are discovered, team has an opportunity to relocate resources and Scrum master is able to schedule actions for removing the obstacles as soon as possible.

3. Whole team together
The last Scrum practice I am going to mention is “Whole team together”. “Whole team together”, taken from XP means exactly the whole team sitting together in a single common room without cubicle borders and working on a closely related set of tasks. After all the irrelevant stuff has been filtered out by the fixed-goals iterations or scheduled to happen at specific time-place by the daily stand-up meetings, there is very little what can irrelevantly interrupt the programmer. If Mutt asks Jeff about the advanced usage of the ProvideReports function, it is quite probable, that he is working on something related to either ProvideReports itself or to some services that it uses. Voila, interruptions have been transformed into a useful channel of communication.


There is no silver bullet in the software development. Private offices do attract people, but harm inter-developer communication. Neither Scrum, nor XP, nor any other method can guarantee the success. Nevertheless the right balance between the developer’s communication and concentration seems to be one of the keys to the successful software development. Scrum proposes a thoroughly elaborated set of practices aimed at finding this balance. At least, these practices are worth consideration.

Welcome to SymbianExample.com

www.SymbianExample.com is up and running. In perfect accordance to the Agile Manifesto‘s “Working software over comprehensive documentation”, design is far from perfect, e-mail is not functioning, no forum installed, but it is up and running. You can already find there a launcher of ExeDll projects and sample code for global key capturing (including a tricky case of long key press capturing).

From now on, whenever I publish some more or less non-trivial code, I hope it to be stored on www.SymbianExample.com

Second Agile Finland seminar

On the 7th of September I was visiting the Nokia Research Center in Helsinki, where the Second Agile Finland seminar was hosted.

The popularity of the Agile methods among the software developers is growing all over the world. My first university degree was focused on the ways of constructing large software systems. So I’ve been always curious about different trends in the design methodologies. I could not miss a chance to discover more about this area.

The presentations were very impressive. What particularly excited me was the great amount of statistical and historical background presented by Craig Larman from Valtech. You all know, that “waterfall” is a devastating way to go. It was amazing to discover, that it was considered harmful from the very first time it was mentioned (!). But not so many readers of the article, where the waterfall was introduced and thoroughly described bothered themselves to read to the part, where it was criticized and iterative methods were offered instead.

2nd and 3rd presentations were devoted to the success stories about using Scrum methodology  – lightweight iterative way to design software. It proved to be really simple, controllable and effective.
If you want to improve the software development at your company, have a look at Scrum. I will definitely try using some elements of it – its backlog and burndown chart seem to be very simple and at the same time effective and even fun tools to use.

Craig Larman starting the seminar