Background
One of our existing client, lets call them TheClient, had a web based application for receiving orders from their dealers. The project was developed and maintained by a software company, lets call them TheITCompany.
For the past 5-6 years TheITCompany had been maintaining and enhancing the project for TheClient. The AMC for the project was due for renewal in coming few months when TheITCompany informed TheClient that they would have to pay a higher cost for the next AMC renewal.
As this did not fit TheClient’s budget, they wanted to end the contract with TheITCompany and find a new IT partner for managing this project. Because of the previous work done for them they contacted us and offered us the job.
The Maintenance
The maintenance contract was signed with us and we had started the support. One day we received a call from TheClient saying that their order screen, which is supposed to accept address along with other things, is not working properly. Even after entering proper value they were not stored correctly in the database. They also informed that the problem was not there previously and had only started after TheITCompany released some changes during the last few days of their AMC period.
Investigating more on this revealed that the order screen had 2 address lines before. The html code snippet for the address fields looked something like below.
Listing 1

TheClient wanted one more field Address Line 3 to be added to the system. TheITCompany had made the requested changes and deployed it on the production server without taking approval from TheClient. As per TheClient this resulted in goods being delivered to locations different from what was actually intended.
Although the task was simple to add a new field, it was done ridiculously. Diggng into the source code revealed some disturbing things. The new html snippet for the address fields looked something like below.
Listing 2

From the above one can see that although they had added the new address line field they had unnecessary shuffled the existing fields which were working properly. I fail to understand the logic behind this.
This was not the end. Further investigation revealed that some piece of code which was responsible for instantiating the Address object for saving to the database looked something like this.
Listing 3
Address deliveryAddress = new Address(
somefields..,
request.getParameter("name"),
“”,
request.getParameter(”address2″),
somemorefields..,
request.getParameter(”address3″)
);
The above constructor had the signature given below
Listing 4
public Address(
somefields...,
String name,
String address1,
String address2,
somemorefields..,
String address3) ;
If you look closely at Listing 3 you will see that the address1 argument was passed a hardcoded blank value. I assume this was not the case before because as TheClient mentioned things were working fine before they made the change.
In summary the cumulative effect of code in Listing 2 and Listing 3 was as below
- What the user entered as Address line 1 was stored in address2 field in database
- What the user entered as Address line 2 was stored in address3 field in database
- What the user entered as Address line 3 should have been stored in the address1 field as per the form(Listing 2) but the code responsible for actually collecting the form fields(Listing 3) just ignored the address1 field.
I want to remind everyone that the TheClient’s requirement was to “just add a new field Address Line 3 on the form”. There was no logical reason why existing fields should have been renamed and moved around.
I feel that maybe the above WTF was not a result of programming error but was Intended to leave the client sailing on rough seas. Maybe the reason for doing this was to force the client to renew the AMC even at a higher cost. I have a strong feeling that this was the case because however dumb a developer may be the above mess looks difficult to achieve.
There is a slight chance that this was a programming error. If this is the case then also its a big shame for TheITCompany. FYI this is a company based in India with branches in many countries, having an employee strength of more than 3000 and serving many big clients. Besides they have a whole section on their website dedicated to “Quality” and “Processes”. They also claim that they incorporate the best practices from SEI CMM, ISO, IEEE.. etc which is supposed to optimize their process and improve it. Even after following these so called best practices if they cannot deliver a decent working software then who is to blame?