If it ain't broken, don't fix it

Recently, I was involved in trying to solve a blocking issue at work. It took us quite some time to figure out was what going on, and it ended up being one of those cases of "If it ain't broken, don't fix it". So, even though everybody knows about this line, I want to give it some extra attention.

The issue was rather nasty, because the action that led to it was actually quite logical and made sense to the developer. I might well have done the same thing, had I encountered the code that was changed. Let me explain the issue.

Our application makes heavy use of external API's, usually SOAP webservices, to configure systems, fetch data, etc. In this specific case, our application was calling an external webservice to push a configuration into it. The developer causing the issue found a small typo in this code: It said "Emegrency" instead of "Emergency". Funny enough though, in earlier tests the system appeared to be working. He fixed the issue, committed it to Subversion, and went on to do his job.

Little did he know that his quick spelling fix would cause a lot of searching later on. After the sprint, we deployed to our test server, and our test users started testing the system. Quickly they found out that the configuration system would not work anymore, and let us know about this blocking issue. I started digging into the code, amongst other things by reading the diff of the sprint to find out what was changed. I found the spelling fix but quickly discarded this as the cause of the problem, since, after all, it was just a spelling fix.

It took me ages to find the problem. I faked SOAP calls, sniffed the SOAP connection to see if there was anything going wrong, checked the WSDL of the SOAP server to see if there were any obvious issues. There was nothing strange to be found! Or was there? On a closer inspection of the WSDL I noticed an inconsistency in it: The inline documentation was mentioning the element "Emergency" while the actual definition was mentioning "Emegrency". The SOAP server was expecting the element with the typo!

Apparently, the original developer of this code had actually spotted this inconsistency (since there is hardly any documentation on this SOAP server aside from the inline docs of the WSDL) and developed to accomodate the spelling mistake. Unfortunately this was not spotted by the fixing developer. And not by me while trying to find the cause of this issue, at least not before spending a lot of time trying to find the cause of the issue.

So what to learn from this? Don't fix things that are actually working! Even though there is a spelling mistake somewhere, be very cautious and don't just go about fixing the mistake unless you are absolutely sure you are not breaking anything, especially when working with external APIs.
Add comment

Comments

gravatar Emily: Good post, I have just stumbled it, Thanks.
March 13, 2013
gravatar Dana: I am delighted to comment on your post, your post has the power to get many comments, thanks for the wonderful post.
March 20, 2013
gravatar Our FOG: Very value able post, I read the whole story when I start reading it.
April 8, 2013
gravatar Dcf Florida Food Stamp Application: day care teacher- leads all daytime activities, monitors behavior, creates structured and educational programs as well as ensures the child's safety. a position of this kind earns around $28,000.00 a year. 17. what interests you most in your work? 2-there are cases where head office deduct the tds on salary and file the return and also some cases where the head office leaves it to deduct the salary on branches. requiring the company to filethe returnwith them even where this is being filed with the assessing officer where branch or head office is situated.
May 16, 2013
gravatar calorimeter constant equation: oas has extensive knowledge of corning 180, 450, 455 flame photometers and is a service agent for parr cause a lower final gravity (dryer beer) while mashing high near 158f will cause a higher fg (sweeter beer). certificate ukas 22750-2 digital digital stopwatch with lcd display in water resistant case supplied with battery with audible alarm 7 x 6 x 2cm 22750-2 flow 99965-0 portable flowmeter 0 to 200ml/ show all 3 pages with hits for water flow meter calibration by austin petroleum extension service. reporter gene assays.
May 22, 2013

Php5_zce_logo

Tags

1337 2008 2010 2011 4developers access modifiers accessibility AdaLovelaceDay09 advent agavi agile alfred amsterdam amsterdamphp apache api apple article articles atk atkMetaNode audioscrobbler autoloading automation azure backwards compatibility barcelona barcodes bash bbc bbq beatstad belgium best practices bittorrent blogging blogs boards of canada book books bughuntday bundle caching cake cal evans calendar career cat cerf certificate cfp cilex clear cms cologne common sense communities community components composer conference conferences contest continuous integration contribute contribution crisis css curl custom d-day data migration datetime DbFinderPlugin decorator decorators deployment deps devdays development directoryindex directoryiterator docblox doctrine doctrine2 documentation download dpc dpc09 dpc10 dpc11 DPC2008 dreamhost drupal dv7 eclipse ed editors efficiency enterprise errors event events expertise ezcomponents facebook filter-branch filteriterator finland flickr fork framework frameworks free ticket freelance freeze frontend fun game games geoip germany getting real git github globiterator gnome-do google google calendar googletalk graceful degradation hack hackers hidden gem hiphop howto hp HR html http i386 ibuildings icann ide ideasofmarch idm imovie inclusivity indy ingewikkeld integration international php conference internet interview ipad IPC ipc ipc08 ipc10 ipc11se iterators iterm2 javascript jenkins jenkins-php job job openings jobeet john peel joomla joomladays kiva kubuntu launcher launchy left on the web libcurl libraries library lighttpd lime linktuesday linux live london loudblog m2ts mac magazines malware mambo manchester marjolein mediterra meeting meme meta methodology micro-financing microframework microsoft migration movie music mysql namespace namespaces netbeans netherlands newsfire nllgg northeastphp nos odmarco open source opinion ORM osx paradiso paris partnership pavilion pear pecl performance personal pfc10 pfc11 pfcongres pfcongrez pfz pfz.nl photo php PHP php5.3 phpabstract phpazure phpBB phpbb phpbelgium phpbenelux phpbnl10 phpday phpdoc phpdocumentor phpgg phpitalia phpnw phpnw08 phpnw11 phpnw12 phpstorm phptek phptek09 phpuk2009 phpUnderControl phpunit php|architect php|tek podcast politics portability postcrossing presentation presentations private projects protected prototype PSR-0 public python qa qr codes re2c recruiting refactoring review rewrite ruby on rails san francisco schedule scifi script security sensio seven things sexism sfdaycgn sflive2011 shell scripting silex simplexml slides smfony software sogeti solar sound speakers spl ssh standard standards star trek static steer strings stylesheets subversion symfony symfony live symfony2 Symfony2 symfonycamp symfonyday symfonylive symfonyUnderControlPlugin talk talks tech techademy technology techportal tek09 telecommuting terratec terrorism testfest testing textmate textpattern the right tool timeout tips tld todo tomas tools training twig uncon unet usability usergroup validation vhost video vim vinyl virus warp webinar weblogging webservices wiki windows winphp women wordpress work workshop world world of warcraft wpi writing wunderlist xml xpath xsd yara year youtube zc11 ZCE zemanta zend zend framework zend server zend studio zendcon Zend_Form zite
© 2004 - 2013 Stefan Koopmanschap + Powered by Symfony, photos powered by Flickr, links powered by Delicious, Shanghai smilies by Iconbuffet. Feeds: rss / atom. Left on the Web v4.4.0.1