Found this function call in a code audit I performed on software development that’s being outsourced:
function loadAndPlayAudio2(audioFileName, continueToNext, audioPosition)
Unfortunately, there are several other function calls that apparently have twins as well. I don’t have to look anywhere else to know that I could have a bumpy ride ahead of me in terms of release quality, additional support needs and increased costs and time to release with upgrades down the line.
How do those few function calls lead me to this conclusion?
- These developers don’t know much about refactoring. They are creating artifacts in production code that don’t need to be there.
- A versioning system does not exist or is poorly executed. These duplicate functions were created to test variations in behavior from the original. Good versioning allows you to sandbox it and scrap it if doesn’t work, check it in if it does and gives a safety net just in case
- Unit testing probably doesn’t exist. It is unlikely that development teams who have unit testing in their DNA would make redundant tests.
- There’s a lack of experience on this team. This as a junior programmer’s mistake that wasn’t caught by a more experienced programmer.
- Additional artifacts means the code is already more difficult to maintain.
- It is impossible to know which version of the function is actually being called without doing a deeper dive. Troubleshooting time goes up.
- Transfer of knowledge will be more difficult and likely not a formal process. When this code passes to new team members it will take them longer to figure out what’s going on in the code.
- The software will have more bugs than it should due to many of the reasons above.
- As the code matures and grows in features and functionality the problems above will compound.
Remember, this is production code. The gold master.
Code audits are a must if you are developing software in any capacity. If it is new software, the audit can tell you what kind of headaches you are likely to expect in supporting it, the quality of releases and challenges of adding new functionality down the line. For legacy software, it’s likely to produce an “Aha!” for that buggy code that no one likes to touch.
And it really doesn’t matter what kind of code that’s being written. The software can be web applications, database scripts, services, desktop applications or the glue that integrates legacy systems. Audits benefit them all.
For companies that develop their software in house, an audit should be less critical since there should be code review sessions that accomplish much of the same goals. For those companies that outsource development of their intellectual property an audit is critical.