Stopping the recalls

Device Developers' Conference in Cambridge

Steve Rogerson reports from the Device Developers’ Conference in Cambridge

High profile software failures leading to expensive recalls have been worrying many in the automotive industry and thus it was no surprise to find this as one of the main areas of discussion in the software stream at last month’s Device Developers’ Conference in Cambridge, England.

Interestingly, and perhaps surprising to some, the first solution suggested to this problem was for the industry to adopt more open source software as a way of guaranteeing higher quality. This idea came from Peter Heyes, a director at SDC Systems.

“The world is very different to what it was ten or fifteen years ago,” said Heyes. “Now more than 30% of the software is free or open source.”

He said there had been a growth is support for this and he cited the Genivi Alliance as a good example within the automotive infotainment sector.

“Cars basically all do the same thing, but a lot of what they do is software based,” he said. “The infotainment system is basically the same across all cars even if they look different.”

The idea behind Genivi, he said, was to share code, which meant that more developers got to look at the code, which increased the chance of finding bugs.

“And you share the results of what you find,” he said. “This means you get more solid and reliable code.”

Within a car there is an enormous amount of software but this, he said, had to be safe and reliable.

“The software really is safety critical,” he said. “But there are some serious glitches being identified.”

The Toyota Prius recall is one of the most recent high-profile incidents, but there have been others.

“Something has to be done to stop expensive recalls and deaths and crashes,” said Mark Richardson, field application engineer at LDRA.

As well as the potential cost to human lives, a software failure can hit car makers hard in the pocket.

“In the USA,” Heyes said, “some $60bn a year is being spent fixing defects. If it goes wrong, it also damages your brand plus you can have litigation costs.”

The other aspect is security. With so many more entries into a car though the likes of Bluetooth and 3G, making them secure is becoming more difficult. Even a USB socket or CD player in the infotainment system can allow malware in.

Another issue to be aware of was that of licensing. Heyes said social networking had increased the amount of code sharing and a lot of that code had no licence associated with it but may become licensed later on.

When it comes to checking the software, Heyes is an advocate of source code analysis (SCA) tools.

“These tools let you find bugs with little effort,” he said. “And they will help you ensure compliance with standards such as ISO 26262 and Misra. What SCA does is look at the whole programme. It will find very difficult to identify issues and security vulnerabilities. You are improving the quality of your code without adding more development cost.”

Most bugs, he said, were introduced as the code was developed and SCA acted like a spellchecker in a word processor by finding the bugs as you type.

“If you can fix things earlier, the cost is lower and the productivity is better,” he said. “SCA tools will also prove compliance with coding guidelines and rules.”

However, he said there were other problems that needed to be considered when using open source code, such as what happens if it goes wrong. How do you fix it? Are there any active projects?

“You need to stay on top of changes that are submitted,” he said. “And when you patch, you have to check for new security vulnerabilities. You need to work with the open source developers to know what the state of play is with the project. But not going the open source route can be counter productive.”

Richardson believes that a key aspect of software development is keeping the requirements at the front of your mind.

“Everything has to be traced back to requirements,” he said. “If you can’t, then why are you doing it? Whatever we do, we need to make sure we can trace it back to a requirement, even just testing a bit of code.”

This was the first of three metrics he said were essential for designing good code. The second was adhering to coding standards.

“The best way to make sure there are no defects is not to put defects in,” he said. “Roughly 80% of software defects when using C and C++ are attributable to the incorrect use of 20% of language constructs. So avoid the subset that bring in the defects.”

But Jim Thomas, director of software testing at TVS, said that there were always going to be some defects.

“The goal is to develop software with zero defects,” he said. “This is not really practical in most cases, so you aim for a relatively small number of defects when you ship.”

He said it was important for engineers to take pride in what they produced but said he knew that often there was pressure to deliver on time rather than reducing the defects.

“This happens all too often and it can be difficult to change that culture,” he said.

Richardson also warned about writing code that was too complex as this made it difficult to maintain and difficult to test.

“I used to enjoy writing clever code,” he said, “until I had to do something to it. And other people would find it even harder to work out what I’d done. You need code that is easy to understand, easy to maintain and easy to test.”

And this lead to the third metric, which is to make sure it is tested.

“If you don’t exercise something before it goes into the field, you won’t know what will happen when it goes into the field,” he said.

Thomas said the key was for testing and development to work hand in hand.

“Testing should not be something that only happens after development,” he said. “But people are often not given enough time to do things properly and therefore have to cut corners on verification and testing.”

He said the answer was thus to build quality in rather than testing it in.

“That is what the safety standards are trying to do,” he said. “You should focus on defects right through the development rather than just testing them out at the end.”

When it comes to debugging, Barry Lock, UK manager for Lauterbach, has a rather interesting view of life.

“We only do debug tools, and that gives us a biased view of the world,” he said, “because all we ever see are things that go wrong.”

But he said that was because too many people did not think before starting their projects.

“Debug is not sexy,” he said, “but 70% of a project is spent debugging.”

Out of the two types of debug tools, he said he preferred trace over JTag because with JTag the core had to be stopped to look inside, which limited what you could do.

“Trace systems collect data on programme flow with the core trace port,” he said. “You get historical data non-intrusively, which you can then analyse.”

He warned that not using the trace port can seriously delay projects and said he knew of a case where a new car dashboard was delayed for seven months because they couldn’t find a bug as they didn’t have trace on board.

www.device-developer-conference.co.uk/

Recommend to Colleagues: