See what API testing solution came out on top in the GigaOm Radar Report. Get your free analyst report >>

See what API testing solution came out on top in the GigaOm Radar Report. Get your free analyst report >>
Jump to Section
Coding standards for autonomous vehicles are constantly changing due to the evolution of technology and people's needs. Read on to learn about the challenges in autonomous driving software testing and best practices to ensure coding standards compliance.
Jump to Section
Jump to Section
Autonomous driving adds additional challenges to compliance when developing vehicles compared to traditional requirements. What’s more, autonomous driving is an extremely competitive space. Whoever can first bring a certified product to market will have a significant advantage over the competition. As such, it’s easy for developers to view static analysis and other quality initiatives as an obstacle to development.
Though cultural buy-in can be a challenge with development teams, education around the quality processes required for safety-critical software development is crucial to faster, lower-cost workflows with better documentation and higher rates of compliance. So how do you approach autonomous driving software testing?
Let’s explore the world of driverless cars, static analysis, functional safety requirements, and more.
Autonomous driving is when vehicles operate themselves without the need for human intervention. This operation utilizes a variety of technology including artificial intelligence algorithms, sensors, cameras, microprocessors, and more. Keep in mind that “self-driving” and “autonomous” are not the same thing.
A self-driving or automated car will still require human intervention at some point. Fully autonomous vehicles can sense and navigate their environments without human input. To categorize a car’s level of autonomy, there are six levels as developed by SAE International in 2014.
This level system suggests that automation increases in a linear fashion, which is not always the case. However, it remains a useful tool in classifying types of automation in vehicles.
Autonomous driving software is any software used on autonomous driving platforms. This includes much more than just artificial intelligence and machine learning. It also includes things found in non-autonomous driving capable vehicles such as electronic control units or ECUs. These onboard computerized resources control everything from the brakes to doors and driver-assistance systems. However, it is neural networks that power autonomous driving.
These networks can find data patterns for machine learning algorithms to parse and translate into actions. An example situation might be the autonomous car’s system seeing a green light changing to yellow and slowing down in response.
Autonomous driving software makes use of many types of sensors to perceive and parse data. They can determine where a vehicle is in physical space or in relation to objects like curbs or other cars. Other software plots a path for the vehicle to a specific location or controls acceleration, braking, steering, and more.
It is just like how you would operate a vehicle—except it is a series of programs, algorithms, and AI doing it for you.
As with any system designed for human use, autonomous driving platforms require rigorous testing and meeting specific standards. For instance, ISO 26262 acts as the automotive functional safety standard for the entire automotive product development process. It helps automakers detect, manage, and mitigate the effects of system and hardware failures to ensure safety. However, it’s not sufficient enough to cover all the engineering challenges that come with autonomous vehicles. They can perform as designed but fail to cope with real-world scenarios like extreme weather conditions or people’s conduct. For example, to consider child dart-out behavior in the streets or that of a drunken adult.
In lieu of many interesting scenarios and to help with analysis of environmental as well as human behavior, automotive standard ISO 21448:2021 was added to provide guidance on the applicable design, verification and validation measures, as well as activities during the operation phase that are needed to achieve and maintain Safety of the Intended Functionality (SOTIF).
AUTOSAR, or Automotive Open System Architecture, is a partnership of interested bodies that pursue and develop standardized software architecture for ECUs in vehicles. Additionally, MISRA, the Motor Industry Software Reliability Association, creates guidelines by which developers can create automotive industry electronic components.
Therefore, testing of autonomous driving software is more than just testing that the software components ensure safety even if failure occurs. It includes testing the vehicle’s autonomous response to real-world conditions and ensures safety. In addition, organizations need to prove that the autonomous software satisfies all regulatory requirements.
Autonomous vehicles require simulations of real-world test cases. These include realistic driving environments, models of other vehicles, and situations that automated cars would encounter. However, since these are computerized systems, concerns must also be addressed regarding cyberattacks.
Coding standards for autonomous vehicles are ever-evolving thanks to the technology and needs of people also evolving. Despite this, developers can always fall back on traditional safety-critical compliance standards when writing code for the cars of tomorrow.
There are a number of common coding standards across software for various industries. However, a coding standard by itself is merely a set of coding rules, best practices, and guidelines by which developers should write code.
This goes beyond general advice such as limiting the use of global or standardized naming conventions. There are guidelines or best practices from individuals and companies with decades of experience in software development that guarantee an increase in code quality.
From the automotive to medical devices, aviation, rail, and more, industries have adopted C and/or C++ safety and security coding standards. Some of these include:
When it comes to autonomous driving, teams should use the coding standards previously listed. These would be the ones highly recommended, but due to the nature of autonomous vehicles, these safety and security coding standards are not enough.
Other standards, like CWE and OWASP, have coding rules and guidelines but go beyond the scope of the code. They also take into consideration the overall development workflow, organizational policies, and processes that people need to follow to ensure the safety and security of autonomous vehicles.
Additional standards and regulations come into play when considering autonomous vehicles and the advanced AI systems involved with autonomous processes. This list is not comprehensive, but provides general guidance:
Key aspects of autonomous vehicles that these and other standards take into consideration are:
The inherent safety-critical nature of developing autonomous driving software naturally leads to the need for thorough and continuous testing. But, like all kinds of software development, creating AI-driven systems has its own pitfalls and challenges.
Achieving compliance is not an easy task. Even the most experienced professionals can fail in some capacity. But there are general best practices outside of autonomous driving software development that benefit all software engineers.
No matter the project scope, schedule, or budget, setting up expectations and standards at the beginning is crucial. Not only will this ensure that your code is more easily understood by everyone on a team, but it will also ensure that there are fewer issues with addressing bugs quickly. No one will have to play the telephone or a guessing game.
Just like continuous testing, regularly reviewing code allows you to better enforce standards and address problems early. This allows you to catch things like deep nesting, illegible code, correct naming conventions, and more.
Possessing a student mindset—even as an expert in a field—can help bolster and improve your abilities. As such, it pays to invest in your developers with education and training beyond what they might have initially been hired for. Besides, technology is always changing. That means that your team needs to keep up.
Static analysis testing is not every developer’s favorite thing. But automation has made reaping the benefits of such testing types much easier. Utilizing every tool in the arsenal, including AI and machine learning, is a no-brainer in an Agile or shift-left setup.
Again, the easiest way to avoid issues is to prevent them in the first place. Documentation and reporting allow teams to cross-reference as needed versus taking additional time to track down the person who originally wrote the code. Or worse, they might just make an assumption and move forward on something that won’t be usable.
Introducing static analysis with the soon-to-be-announced MISRA C++ 2023 and soon-to-be legacy AUTOSAR C++ 14 coding standards, compliance as a sustainable process can seem daunting. But testing remains an integral part of best practices, even in a field as innovative as autonomous driving.
Testing using tools such as C/C++test from Parasoft integrates benefits into your workflow including:
There are numerous companies out there trying to be the first to have a truly autonomous vehicle on the market. This technology requires comprehensive testing to protect life, function properly, and adapt to everyday life.
Though not an official document from the National Highway Traffic Safety Administration (NHTSA), the Institute of Electrical and Electronics Engineers (IEEE) published a preliminary set of guidelines for ADS standards in 2022. The IEEE P2846 Draft Standard for Assumptions for Models in Safety-Related Automated Vehicle Behavior seeks to address the unique issues with autonomy and driving. However, having a standard guideline for this use case is not the only future consideration.
As mentioned earlier, autonomous driving software testing also relies on the real-world to welcome actual self-driving cars. The traditional technology and manners by which we navigate may have to change with widespread adoption of automated driving. It begs the question: what if cities were designed around human use and not parking cars?
Incorporating static analysis or other types of continuous tests into your workflow delivers tangible results. But with tools such as one of Parasoft’s many solutions, reaching safety compliance with software for automated cars is that much more achievable. Just remember to do the following:
With the goals of being efficient, thorough, and developer-oriented, you will achieve safety compliance sooner than you think.