Showing posts from May, 2011

Code review vs. static code audits

Yesterday I watched Mike Rozlog's presentation at Code PaLOUsa about Static Code Audits. I really enjoyed it. He gave a great motivational speech, advocating the use of static code audits, describing their benefits. I don't agree with Mr. Rozlog's attack at peer code reviews, though. He believes them to be inferior in efficacy to static code audits and he makes his point by bringing in statistics you can't fight. I, personally, think you should not compare these things at all. Yes, static code audits can find hidden bugs and code smells, they can check your code style etc. But, in my opinion, a peer code review is not about finding all bugs. It's about developer interaction, it's about exchange of knowledge. A static code audit can point out the bugs in your code but it cannot tell you how to make your code better (except for the most obvious things). It cannot teach you how to use your tools better. It doesn't teach you how to think and plan. It does

JSF (Oracle Mojarra 2.1.1): beware the exclamation mark!

It was one of those simple-but-nasty bugs that make you cry over them for several hours. The perfectly valid project just refused to start. I've got an error ( see the stacktrace below ): "com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! D:\ (The system cannot find the path specified)". I didn't know why on earth JSF wanted to read the configuration from the drive's root instead of using existing, perfectly legitimate configuration file until I started debugging the Mojarra's sources itself. Then it struck me - I put the project in the "D:\!eclipse\projectname" folder (note the exclamation mark!) and Mojarra just couldn't handle the exclamation mark because of the following code in the getAlternativeJarFile method of the com.sun.faces.facelets.util.Classpath :

Agile estimations

- And how long do you guys think it will take us to develop this user story? (The little yellow post-it boasted a proud title of "Synchronization of labile subkernel optimizers") - 5 hours. - No, 7! 12! 3! 48! 20! After about 15 minutes of heated discussion the estimate section was filled with a fresh inscription: “16hrs.” The two-week work schedule had 8 similar tasks, and each of the 5 developers was sure that the team would meet the deadline. - All tasks? By October 18? Consider it done. Naturally, two weeks later it turned out that the project was nowhere near the done stage. The code lacked both "lability" and "subkernelness". There were "optimizers", at times even "synchronized", but the general picture was inauspicious – the plan was foiled, the story was not ready, the product could not be released. Other stories did not fare much better. The Product Owner plunged into silent panic, vividly picturing the visit to Big

Agile: good, bad and ugly (random thoughts)

My very first encounter with Agile-methodology can be traced back to 1999. Like many others before and after me, I was left with a peculiar, not exactly pleasant aftertaste. Furthermore, this subjective impression pretty much proved to reflect objective reality with its many hidden traps. At that time the relatively tranquil life of our close-knit outsourcing team was disturbed by a delegation from a metallurgical plant. The messengers wanted us to develop specific software, since their in-house solution had almost given up the ghost. When faced with real production volumes, the program buzzed, glitched, went bananas and croaked, which finally pushed the plant management to the realization that their tasks needed a more adequate solution.

Javamail smells, we need a better Java mail library

When one starts using Javamail library, the inevitable problem will arise. Unit-testing. Testing Javamail -related functionality can be a major pain. You want to test how your messages are created, what contents and headers they have, whom they are addressed to, when they are sent etc., and this is where the problems start. Personally, I don't understand why I have to have a Session initialized and passed as a constructor parameter when I have to create a MimeMessage instance. Why on Earth do I need this Session to be created, especially in test environment? What point does it serve?