Boffins zapped '2,000 bugs' from Curiosity's 2 MILLION lines of code

Billion-dollar laser-firing nuke tank - what could go wrong?


With a $2.5bn price tag, a 350-million mile journey and 2 million lines of C and some C++ code, the only bugs NASA wants its Curiosity rover to find are those possibly beneath the Martian surface.

And it may not be a particularly glamorous job, but software analysis outfit Coverity was the company tasked with "ensuring that every software defect is found and fixed before launch".

Roughly 2,000 bugs were zapped in the rover's code, estimates Andy Chou, the chief technical officer of Coverity, although NASA is schtum on the exact figures.

"For typical software (which this clearly isn't), it's not unusual to find approximately 1 defect for every thousand lines of code," Chou said. "For a project with 2 million lines of code, it would therefore not be unusual for Coverity to be able to find about 2,000 defects."

The company's static analysis tool was used to examine the source code written by NASA's Jet Propulsion Laboratory scientists - specifically the systems that guided Curiosity's flight to the Red Planet and are now running all of the laser-armed robot's onboard functions. At this stage, every bug correction is vital – after all, there's no service desk on Mars.

The source code was fed through Coverity's package, which examined the code to identify flawed logic and common programming gaffes. The error reports were then sent back to NASA's JPL developers so they could sort them out.

Coverity's tool checked the software that controls all the functions of the Rover. Credit: NASA

According to the software vendor's communications manager Chris Adlard, NASA threw all kinds of tests at the code. "You can't really test the Mars landing, so NASA wanted to use every possible way of pruning out mistakes, that's why they were using a lot of methods," he said.

The automated analysis tool was developed from research cooked up by Stanford University boffins. The tech analyses C/C++, Java and C# code bases as it is being compiled for hard-to-spot critical defects including resource leaks, memory corruptions and null pointer dereferences. It also looks at code behaviour to iron out flaws.

Rock-zapping Curiosity is the most complicated project NASA has ever launched to date, and testing was of huge importance. However a software checker can't catch all mistakes: the error that wrecked the space agency's Mars Climate Orbiter wouldn't have been spotted by Coverity's software, Chou admitted. That particular cock-up was caused by boffins mixing up measurements in imperial and metric units.

It's not the first time the static analysis tool has been called up to check the globe's biggest projects: it was also responsible for pulling the bugs out of CERN's particle accelerator, which included 3.5 million lines of code in the ROOT framework - the software that sifted the petabytes of data coming out of the machine - and 50 million lines in associated science projects. The Large Hadron Collider's ROOT code was more buggy than average: 40,000 bugs were found and squashed. ®

Similar topics


Other stories you might like

  • Uncle Sam to clip wings of Pegasus-like spyware – sorry, 'intrusion software' – with proposed export controls

    Surveillance tech faces trade limits as America syncs policy with treaty obligations

    More than six years after proposing export restrictions on "intrusion software," the US Commerce Department's Bureau of Industry and Security (BIS) has formulated a rule that it believes balances the latitude required to investigate cyber threats with the need to limit dangerous code.

    The BIS on Wednesday announced an interim final rule that defines when an export license will be required to distribute what is basically commercial spyware, in order to align US policy with the 1996 Wassenaar Arrangement, an international arms control regime.

    The rule [PDF] – which spans 65 pages – aims to prevent the distribution of surveillance tools, like NSO Group's Pegasus, to countries subject to arms controls, like China and Russia, while allowing legitimate security research and transactions to continue. Made available for public comment over the next 45 days, the rule is scheduled to be finalized in 90 days.

    Continue reading
  • Global IT spending to hit $4.5 trillion in 2022, says Gartner

    The future's bright, and expensive

    Corporate technology soothsayer Gartner is forecasting worldwide IT spending will hit $4.5tr in 2022, up 5.5 per cent from 2021.

    The strongest growth is set to come from enterprise software, which the analyst firm expects to increase by 11.5 per cent in 2022 to reach a global spending level of £670bn. Growth has fallen slightly, though. In 2021 it was 13.6 per cent for this market segment. The increase was driven by infrastructure software spending, which outpaced application software spending.

    The largest chunk of IT spending is set to remain communication services, which will reach £1.48tr next year, after modest growth of 2.1 per cent. The next largest category is IT services, which is set to grow by 8.9 per cent to reach $1.29tr over the next year, according to the analysts.

    Continue reading
  • Memory maker Micron moots $150bn mega manufacturing moneybag

    AI and 5G to fuel demand for new plants and R&D

    Chip giant Micron has announced a $150bn global investment plan designed to support manufacturing and research over the next decade.

    The memory maker said it would include expansion of its fabrication facilities to help meet demand.

    As well as chip shortages due to COVID-19 disruption, the $21bn-revenue company said it wanted to take advantage of the fact memory and storage accounts for around 30 per cent of the global semiconductor industry today.

    Continue reading

Biting the hand that feeds IT © 1998–2021