from my work as a developer
Posts tagged bug fixing
borrowed
May 12th
I was “borrowed” to a Maintenance team to solve some issues with print module
The estimation was for 5 Man days and I did that in 2, but anyway I must assist in tests and prepare an test environment. This time we used a new fancy tool – SharePoint – as a repository for the print specification documents. It has nice future to store other version on the same document – the same way as Subversion or CVS are working. As usual with such tools there was a problem with the diff! It was real hard to read what was changed and use of so many colours didn’t help! I was able to do the job only with our analyst’s help!
Don’t be afraid of analyst, may be helpful!
are you affraid
May 6th
The last two weeks I’ve been simplifying an application flow engine base on Apache Struts 1 – I know it’s a bit old technology but I don’t care, I have a job to do
Anyway I discovered lot of strange use cases where some custom mechanism was build instead to use what was already provided with the framework. It was like inventing a wheel once again! Frankly, I was truly surprised how someone could do this that way. And I start thinking what was the reason to do that…
The only thought came to the mind that someone was afraid to use what was already provided to him with Apache Struts 1 – he didn’t know the framework well, he was too lazy to check sources, and so on. I was real devastated! If someone doing application in such way, no framework will help him or do the job for him!
Recently I’ve been solving issues in Apache Struts 2 and one of them was to add wildcard support to a file upload mechanism. Provided patch had solved that problem with some home made RegExp engine. I just added a test case to proof it was working properly and committed all the changes to a source code repository. After that a more experienced Committer pointed me out that I should use existing PatterMatcher class instead, what I did and the code looks much better right now. You can see an example here Apache Struts 2 useful beans.
a battle conitnues
Mar 12th
Another day I was fighting with Axis 2 and optimizing namespaces for Xml generated from XmlBeans – I mentioned that in my previous post. With help from a team mate I was able to introduce changes to how Axis 2 Ant task generating client’s web service stubs. I modified XSLT file used to do that – I was basing on existing issues with exactly the same problem. I followed the advice and changed XSLT template, added also some debug info and functionality do save results to file – to be sure I got what I wanted to get.
Everything went well, the first results were promising so I started an application to have a full test. And then I got such a problem:
WebService error: Invalid headers received: Attribute not allowed: v1 in element RequestorIdentity@http://technical.schemas.host.net/header/requestoridentity/v1, Attribute not allowed: v1 in element User@http://technical.schemas.host.net/header/caller/v1, Attribute not allowed: v11 in element User@http://technical.schemas.host.net/header/caller/v1, Attribute not allowed: v1 in element Applications@http://technical.schemas.host.net/header/application/v1
It looks like one of web services has some problems with optimized namespaces because the application is calling few other web services before I hit in the trouble with that one
So after two day I’m still in the same place!
bugs, gwt and appengine, ocr
Feb 3rd
At last I got a new task – I mean new bugs to solve
Yea all were related to a print layout. Many simple text changes, it took me around half a day to solve them all. I still have some bugs to solve but first I need to investigate how they will impact application – the changes I made to layout till now were safe, they will not brake application. So it’s a bit boring but better than nothing
Another thing, I started learning Google Web Toolkit – as a member of Warszawa Java User Group I have access to group’s bookshelf and free books from many publishers – you know “book for review”. Anyway I had a copy on my PC and started reading it.
In the same time when I’m reading GWT in Action I started working on Maven2 archetype to work with Google AppEngine. You can find some over the Internet but they are not really suitable to what I want. After two day I had stable environment to work with GWT and AppEngine. I’m using my good old IntelliJ IDEA instead existing plugin for Eclipse
The last thing, I’ve presented my idea about Open Code Review on Design Patterns Study Group’s meeting, I explained what it’s about, how to steer the whole activity and how to solve problem with “gurus”
I hope they will be able to introduce it in their teams! I’m waiting for feedback!
a new year
Jan 7th
Yap, the New Year became
I’ve came back to work to rest
I had fixed my “last three bugs” and have nothing to do
I had started playing a flash game and I got pain in my neck – the Flash is an evil
I started preparing Javarsovia 2010 conference
I’m thinking to participate in GeeCON 2010 conference as a presenter – first I must have some good topic to present
Yap, the old year had gone, New Year became
reanimation
Dec 22nd
Last time I had been writing about merging branch to trunk just before deployment to production. Business side wasn’t happy about that, so we had to clean up the mess
It’s very weird how merge can replace whole files with older versions – by older I mean that were formatted on branch – no other changes. In such case it’s very hard to find what was changed. The only hope is in Subversion’s history. It’s the only place where you can find how it was before, though if you have history
Anyway, the problem was solved quite fast and we were able to deploy a new version to test environment and business were able to test it also. The last step was to prepare deployment to production and hope that everything will go smoothly – we will see next day morning!
I also discovered superb future in IntelliJ IDEA – Productivity Guide – you can open it with ALT + H + P

BTW the new version of IDEA was release few days ago – Ulimate 9 – I already have it! Hurraaa!
PS. You can be surprised but I’m working remotely from my new home
day as usual
Oct 27th
I think it was a day as usual – I fixed some bugs (two
), prepared a presentation on Parleys.com and made some Web Services integration skeleton. And I had the second part of Communication training.
Day as usual
I started the day preparing the presentation, as a JUG we have a dedicated channel on beta.parleys.com where we are publishing materials from conferences or JUG events. All are in Polish so you have to know it
It was about JBoss and clustering that it had been presented during Javarsovia 2009 conference! I also made a note about podcast from COOLuary v1 conference.
Then I fixed two simple bugs regarding print template that I had been working a while ago – they looked a quite hard, but we team-mate help it was a moment! Collective knowledge!
And at the end of work day I made skeleton for web service integration – I used more or less copy-paste pattern
After work we had a second part of Communication training – we learned a lot interesting things and behaviour about ourselves! I made some notes for future and maybe publish my thoughts lately!
divide by int
Oct 23rd
I made very stupid mistake – I had to prepare some simple calculation to show some figures on print out. It was something like this:
figure = round( (index / 4) + 0.4 )
As you see quit easy and simple to implement – business rule from Excel sheet
I thought the same – 10 minutes and I finished, without unit test and some deep testing – I couldn’t make mistake, it’s so easy! You probably know what happened next! A Bug!
It was matter of time when I’ve got bug report from tester – the figure is wrong – it wasn’t following the guidance! Impossible – that what I first thought! I started making some tests and the figure was calculated wrongly for some index values. It was like a magic! Magic in coding? Impossible again! So, I write a unit test to just test that one method. I’ve started playing with different values and I very quickly discovered that for index below 4 the figure is 0!
It was a blast! I was dividing by int! In Java! That was the origin of my problems! As you may know when dividing by int the result is automatically cast to int. All I had to do, it was turn the routine into:
figure = round( (index / 4.0) + 0.4 )
and finish the unit test for a all possible values. What I did and it took me about 20 minutes – I should do that at first time!
business debuger
Oct 12th
Did you ever want to have tools which shows you your mistakes as soon as possible?
During software development process we’re using many tools to implement such idea – continues integration, using CruiseControl, unit tests with JUnit, Checkstyle to correct typos – we are just humans and we’re making mistakes all the time!
What is missing with mentioned tools is that they’re as good as we configure them – they wouldn’t check business rules if don’t configure them how to use them. They’re smart as we’re – neither more nor less.
Ok, what would be the best solution? To have external business debuger – someone who can check what you implemented but against business rules. Totally distinguished from you and your way of thinking. It’s great, but we also afraid – someone will discovered ours mistakes, discovered that we aren’t prefect. We aren’t professional as we thought! It’s strange – we want that, but at the same time – we afraid!
I’ve been working in such way for last three days – I implemented a change, informed business guy and in few minutes got answer. It’s like working with debuger – all my mistakes are discovered before I was able to figure them out! As I mentioned early, it isn’t comfortable, but it’s the most efficient way of working – from business perspective
neither either nor or
Oct 7th
Solving bugs is sometimes quite interesting developer’s activity. Some of you can disagree – it’s boring, mind devastating and so on… Yes, usually it’s like this, but the worst thing you have to keep focus on what you are doing to don’t introduce new bugs instead
Today I was solving some minor but urgent bugs in a small project – that one where I’ve been preparing print layout. Everything was simple and understandable, till I’ve started implementing some “small text mistakes” – they weren’t small, they were enormous! Additional two rows in a table with different logic when they should appear and when not. This logic was interfering with what had been done previously. It wasn’t clear for me and I noticed some duplication. So, I asked an author what he was on mind? And I got very suspicious answer: either section 1, 2, 4 or 3 should be printed – khe? And with that answer I got another – he’s going out.
Yes, very clear and informative answer. I could wait one day and tried to clarify that, but I decided to implement how I was understanding that. All 4 sections were exclusive, only one can be showed for given case. It was more reasonable for me and I will see if I had right next day
As you see, solving bugs is often harder than implementing new functionality!
