Finding that
‘unexpected’ bug
It’s a real challenge to identify bugs in embedded code
across the Internet of Things, but visual trace diagnostics
has made that process easier. By Johan Kraft
As more projects move to
the Internet of Things, the
challenges of embedded code
become more obvious. With millions
of devices out in the eld in all kinds
of conditions, bugs in the embedded
code are even more likely to show up
at one time or another. It is also more
dif cult to identify and x those bugs
when the embedded systems are out
on the road or part of a supply chain
on the other side of the world.
This is potentially a huge problem.
Research from 13,500 software
projects found that the defect removal
rate was 95%. While this sounds
pretty impressive from the engineering
perspective, it still means 5% of
defects end up out in the eld. With
50-100 bugs typically introduced per
1000 lines of code, this means there
can be 25 to 50 major bugs in a
system of 50,000 lines of code.
As projects get bigger, combining
embedded control and cloud
systems across the latest industrial
automation systems and the IoT, this
problem keeps getting bigger, too.
While engineers do their best not to
introduce bugs in the rst place and
use extensive testing to remove all the
bugs they can nd. And this is where
the key lies – how to nd the bugs,
especially when they can show up
unexpectedly.
When embedded systems are
deployed in things that move around,
whether that’s in smart bins for
collecting refuse or monitoring the
cold chain delivering vaccines to tackle
the Covid-19 pandemic, all kinds of
different situations may occur. Some
Paper Glass
Plastic Metal Organic
retrieval method, day by day.
The cost of a bug in such systems
can be dramatic. While one trash
bin not being collected is not a
disaster, angry calls from customers
with over owing bins is not what an
operator wants to deal with. It is also
vital to know whether a sensor node
has failed as a result of the sensor,
the link or other parts of the system.
Losing a batch of vaccines that
might have been compromised during
transit is much more signi cant,
especially if this is the result of a
sensor failure. And if a sensor fails,
there is no way of knowing whether the
batch has been compromised or not.
Catching errors
So catching errors as they occur and
notifying developers is of tremendous
value to enterprises. The average
cost of xing bugs in an embedded
device’s rst year of service alone
can run into hundreds of thousands
of dollars, and this does not include
damages caused by bugs.
One method that is of tremendous
things can create a problem, and the
developers behind the software need
to know.
The bug may not be obvious,
but it may be a precursor to a
bigger problem. Catching problems
early before the issue becomes
catastrophic is ideal, especially if this
can be done without the customer or
user even noticing.
The same forces acting to drive
the connectivity of embedded systems
can also be used for identifying and
reporting any potential problems.
For example, monitoring the ambient
and air temperature across an entire
cold chain distribution highlights
weak points that can be addressed,
and ensures that products, including
vaccines, arrive effective at the
point of use without having been
compromised. This requires extensive
monitoring and logging, with data
uploaded to the cloud for analysis.
Similarly, smart refuse systems
use sensors and wireless links to
determine when a bin is full and needs
to be collected, rather than relying on
a set schedule. Fleet management
software and intelligent routing then
determine the most cost-effective
16 9 March 2021 www.newelectronics.co.uk
/www.newelectronics.co.uk