welcome everyone and thank you for attending today's presentation on automo software testing for software defined Vehicles my name is Ricardo kachin I'm the director of Safety and Security compliance at parasoft and I'm accompanied by Charles Ox Ridder one of our extinguished solution Architects he's very talented and I admire his skills say hi Charles hi folks thanks Ricardo thanks Charles now this is going to be a very informative presentation so let's start by uh taking a look at the agenda now I'm going to start by providing a quick summary of what a software defined vehicle is
and why actually we find ourselves here in yet another major evolution in the automotive industry I'll also quickly talk about the architectural changes that have been taking place which is actually a transformation into a service oriented architecture and because this is new to the automotive industry standards are being defined and developed so I'll quickly discuss what organization is leading the way and some of its players I'll then jump into parasoft role in software defined Vehicles as a provider of test automation Solutions in the industry and Charles will deliver a live demo of cc++ test we
will have a live Q&A session at the end of the presentation so take a note that you have a questions dialogue window available to you and you can ask questions at any time also this presentation is being recorded and will be made available soon after the webinar is over all right so let's get started a uh software defined vehicle is a vehicle whose features and functions are primarily enabled through software now this probably still leaves quite a bit of ambiguity so one of the best ways to explain self- defined Vehicles is by giving you what
I believe is a really good analogy at the expense of dating myself now do you remember how cell phones were say back in the 1990s yeah 1990s so um you could just uh you know make phone calls and you could even do it while you were driving which was fun anyways uh cell phon started to evolve and the next thing you know cameras were added then you were able to access the internet and read your emails but it was slow cumbersome and first some folks like me my cell phone would actually get really hot overheated
because the hardware was uh over taxed but then cell phones got smart really smart today I use uh my cell phone for video conferencing um I have an awesome camera I can text I can play video games uh helps me navigate to places I use it to fact check and provide answers do my banking and listen to music and actually the list just keeps going now what happened then at that time or the recipe that came together uh was the evolution of the microprocessor the 3G network and I would argue that Apple was part of
that recipe to help evolve cell phones to where the hardware platform and the software were somewhat decoupled what happened was is a a service oriented architecture and new operating environment was established and this has been further refined to where you can break down the these large scale applications into smaller more flexible software components referred to as microservices now this Evolution very much parallels what is happening in the automotive industry the automotive industry has been moving into a service oriented operating environment the technology is there we have powerful microprocessors 5G Network and Tesla has been part
of that recipe also the business of microservices is well on understood and used by various Industries like Telecom of course and even video gaming uh you know my son has several gaming subscriptions he purchases skins weaponry and other applications that allow him to be somewhat unique and give him um advantages now today some car manufacturers have already deployed this type of operating environment they actually offer subscriptions to enable certain features uh in your cars for example B recognition so only certain drivers can drive the vehicle and other subscriptions to unlock everything from entertainment options to
enhance navigation and enhance free driving now let's talk a little bit about how we actually got here just like cameras and internet access were added to cell phones Advanced Driver assistance systems like Lane assist emergency braking active suspension radar cruise control and other stuff has been gradually uh added to cars also sensors and artificial intelligence for autonomous driving and other technology like over theair data transfer in fact quite a bit of telematics data collection occurs data from Vehicles performance fuel consumption speed GPS error faults which are used to diagnose issues and help you with maintenance
even the driver's driving behavior patterns can be tracked you know Tesla developed the model S over a decade ago and as a startup they took the opportunity to design an electronic architecture with fewer easy use but with more scalable functionality and the capabilities to distribute these capabilities over the air this actually marked the beginning for the software defined Vehicles where you have a base level of Hardware which is built into every vehicle and the selective functions are defined by the software this is actually very beneficial to the automakers uh because they can build one trim
one Hardware architecture that supports all of these capabilities and there's also room to scale this uh drastically simplifies and reduces the cost of manufacturing the vehicle also at the dealership you can then purchase the features or subscribe to the features that you actually uh desire and that benefit that um this new architecture enables is the vision and realization of connect cars this is where cars can communicate with other cars the infrastructure the traffic lights the network people uh and also through their cell phones and basically everything okay let's take a look at um this Evolution
but from the hardware perspective now this is a very simplified set of Graphics not every uh detail is included like sensors cameras actuators and so on so forth now starting with the traditional uh electronic architecture uh you have a distributed set of many electronic control units or ecus each is responsible for some specific functionality such as the engine control module the powertrain um and communication between these ecus is achieved over actually a very reliable controller area network or can bus then the integration of Adas and automated driving assistance systems uh evolve the architecture by grouping
functionality to specific ecus uh sensors cameras Radars and lar into uh a domain the communication between each domain became tightly coupled and actually relatively large this is because the vehicle's computer can now autonomously control the driving instead of the driver in addition for autonomous driving communication to the cloud is actually a prerequisite and these autom motive architectural changes laid out the basis for the next evolutionary step into software defined Vehicles the software defined vehicle architecture groups ecus sensors actuators and other electrical components by their location in the vehicle referred to as zones the zonal architecture
includes zonal gateways that act as a connectivity Hub relaying data through a high-speed ethernet link the connection speeds are many times higher than what's existed in vehicles in the past and also due to real-time safety critical requirements in vehicles the zonal gateways utilize time sensitive network TSN technology that actually ensures that communication is deterministic the communication and the zonal architecture resembles that of a computer network another benefit to this electronic architecture is that it requires substantially less cabling cabling is the third most costly part of a car's bill of material and the third heaviest component
in its build reaching and whopping 110 pounds of copper in some cars so eliminating this through Ethernet is huge savings now different car manufacturers have different implementations of the same components this is not efficient so new and Open Standards need to be defined and adopted last year in March of 2022 the eclips foundation announced the formation of the eclips software defined vehicle working group it consists of members like mercedesbenz Continental itas uh Bosch Microsoft IBM and the list continues their focus is to create a scalable modular extensible industry ready open source license uh software platform
standardizing the software defined vehicle architecture offers lots of cost savings it will will enable faster development uh improve quality uh scalability into the future it will offer the ability of different electronic components to exchange information in a safe and secure manner uh so realizing connected cars and working together will help remediate security threats um because they'll they're all in conjunction working together towards uh cyber security and which is actually very important also it will be quicker and easier to satisfy regulatory compliance so getting in from the ground app for these uh Eclipse software defined vehicle
members is very important in fact qualcom just joined in August of this year they want to contribute to the development of Advanced Driver assistance systems and connected Services capabilities utilizing their scalable open and flexible Snapdragon chip GM also recently joined and plans to contribute to creating an open shared software defined vehicle protocol specification and also its implementation this will enable Automotive applications and services to talk to each other and exchange information basically providing a uh transport agnostic layer communication protocol that's built on top of existing automotive and ethernet standards GM is actually using their open-
Source U protocol as their starting point and there are other companies and members that have their own platforms and want to contribute rute solutions to help develop the software defined vehicle architecture parasoft as a provider of software test automation tools is also poised to support this diverse set of software that goes into a software defined vehicle now parasoft provides test automation for every phase of the software development life cycle for all types of software from embedded uh Safety and Security critical devices to large Enterprise price applications from performing static code analysis unit testing security testing
saw API testing service virtualization and much more now our tools are all homegrown and can be integrated within your cicd pipeline for continuous testing in fact I recommend you visit our website we have tons of great educational content uh simulated tours that step you through our products and uh there's a lot more anyways we don't have time to go into the details here but I'm going to quickly introduce you to some of our solutions that very well fit within the software development life cycle and testing of software defined Vehicles many Automotive components are still developed
and will still continue to be developed in C and C++ and they require verification according to process standards like ISO 26262 ISO 21434 and coding standards like mistra CN C++ now travles is going to take you through a demo of this solution so I'm going to not spend much more time here but also know that similar to cc++ test is what you're going to see we support other development languages like Java C and uh vb.net I'm just going to give you a quick glimpse of Saw test parasoft saw test automates API testing by providing Advanced
test creation capabilities that also leverage Ai and machine learning to process service definitions and recorded traffic uh produce uh maintainable and reusable test assets and enable continuous functional and low testing in other words it delivers fully integrated API and web services testing capabilities that automate endtoend functional API testing it is widely recognized as best-in class and uh has a broad support for over 120 message formats and protocols you can perform API security testing which helps identify where an API diverges from the published API specification for example is the API uh endpoint responding to the correct
request this helps validate the correctness of the API and identify discrepancies against the published API so GM's U protocol actually comes to mind additionally saw test integrates directly into your cicd pipeline it also integrates with parasoft virtualized to facilitate test automation parasoft virtualized allows you to quickly create lightweight disposable virtual instances that can also be preconfigured to use both real and virtual Services it really enables users to produce just the right type of behavior for any given test scenario now parasa saw test integrates seamlessly with parasa virtualized by combining these two solutions team will benefit
from the efficiencies that enable virtual services and API tests to share message formats payloads and produce test assets that can be dynamically reconfigured making test cases portable so you can test the same application in different environments regardless of where they are deployed and can be packaged into a complete test environment with full control over everything from Behavior to Performance to data for example this makes development and testing a new API is much easier because you can design a prototype of a new API with with a virtual service and then they'll test against that virtual Service
as the actual service is being developed and we should probably follow this webinar up with another webinar on saw test and parasoft virtualized to really do it justice uh perhaps have a series of these Automotive um webinars okay let's get to the fun part and see our cc++ test solution and action over to you Charles thanks for Ricardo hi folks welcome to the technical demonstration of parasoft cc++ test and I'll be taking you on a tour on how parasoft C++ test how it relates to Quality and security how well the code is currently being tested
how hard it will be to maintain and identifying candidate areas for refactoring I'd like to start with our dtp solution which is our analytics and Reporting System whenever you run analysis on your cc++ code you have the ability to publish that data to dtp in order to view the data in an actionable way and monitor the trend of your project over time as changes are made dtp is a collection of customizable dashboards which each contain any number of customizable widgets on the left here you can see a number of dashboards that I've created and on
the right whenever you select a specific dashboard it contains any number of widgets that show you a variety of different pieces of information I'd like to start with our metrics dashboard as assessing the risk of inherited code may start with evaluating the various metrics of the code base for example you may want to see how many source files there are in the number of lines of code how maintainable the code is using a maintainability index or how Co complex the code is using various cyclomatic complexity metrics in addition to codebase size code complexity we also
have metrics that highlight uh various aspects of your code structure as well as functions or methods uh and of these these can also be used to evaluate the quality Andor security of your code base uh as with all widgets in dtp on a dashboard uh these all can be drilled into so for example we can drill into this maab cycle atic complexity to get a little bit more information about what we're looking at so uh we're going to pick a module we you choose DC here and then from here we can sort based on the
most complex functions down to the least complex and here we can see this method DC Funk is a very complex function and it looks like it is just a very large switch statement that has multiple if statements and return paths and this can give you a very quick view into the code to know where the problem areas may be and what it may take to maintain refactor or add capabilities to this code with respect to security we also have a variety of dashboards out of the box that can help you assess the security of your
project if you have certain compliance requirements such as SEI search C cwe or oasp we have dashboards which will not only allow you to assess the security of your project but help you achieve compliance and remove the burden of generating compliance reports for Auditors for example here's our SEI search C compliance dashboard which again is just a collection of widgets that give you insight into how well the project complies to SEI search c as clearly stated this project is not compliant and the widgets give us various pieces of information to help you ascertain where compliance
is problematic for example the top five CT categories shows us that the majority of violations revolve around integers and declarations in initialization alternatively we could drill into specific types of violations using the tree map from here we can click on any specific violation and make an assessment as to the seriousness of this violation for instance if we click on int 15-c this will take us to all of the violations that occur with this specific violation if it is unclear clear what this violation means uh the documentation is is readily available and we'll show you some
example code of of the violation and how to repair it finally you can use the compliance widget to look at your compliance report which details the project State against the c c compliance standard each guideline is listed the state of compliance and the number of violations for each guideline if not compliant these violations can also be viewed by clicking here which will take you to all of the different violations with this particular uh category of violation we can sort by the number of violations in order to help us prioritize where we need to focus our
efforts as far as compliance is concerned and the number of violations and finally we can Download a pdf of this report that we can then use to provide to an auditor or deliver it to anyone who may be concerned with this information similar to the sear C dashboard the misra dashboard can help you assess the overall quality of the project there will certainly be some overlap between the two since poor quality code can lead to SEC security vulnerabilities we currently support the latest Mis C 2012 or 2023 standard which is amendment four as we saw
with the SEI seert C dashboard many of the same widgets exist here except they are configured specifically for misra c as with the SE search C compliance dashboard we have a misra compliance widget which will allow you to go ahead and see the the report based on the guidelines and you can also download that PDF as well and finally I'd like to show you our complete code coverage dashboard uh this can give you insight into any uh current tests that have been executed and what the code coverage is uh based on those tests and So
based on your code the higher the code coverage the better and the more confidence you have that this code is fully tested and vetted out the lower this number obviously the more work that you need to do to make sure that this code is up to par either based on quality or security standards that you have we can also drill into the code coverage and see how this project breaks down based on various metrics and see the line coverage to see what code has been covered and what hasn't so the green indicates that it's been
covered and in this case we have red indicates that it was not covered okay let's switch to the analysis part of C++ test this is the part where all of the data we just viewed gets generated in the actual analysis of the acquired code occurs I'm going to put on my developer evaluator hat now and go into the Eclipse IDE for which we have a plugin to which you can see we have a parasoft menu here we also have plugins available for visual studio code visual studio and other flavors of of the Eclipse IDE like
wind rer workbench before I run any kind of analysis a brief overview of how we do things uh to parasoft everything that we run is a test configuration if it's static analysis code coverage uh any kind of memory monitoring or unit testing they all treated as various test configurations out of the box we have quite a few static analysis test configurations many of which are based off of uh books like modern C++ or effective C++ we also have compliance test configurations uh for instance this is where misra lives or Autos are or if you're focused
on security this is where cwe oasp SEI search C and C++ rules as well as dis ASD Stig test configurations exist and by simply selecting any one of these when we go to run a test configuration will apply the rules that are associated with this test configuration now in addition to static analysis when it gets into Gathering code coverage either through running unit tests or doing some sort of application monitoring we have a variety of ways to do that in embedded systems as well so if you need to do any of this on On Target
as far as collecting code coverage is concerned or running unit tests we have a variety of of different ways and test configurations set up ready to go to help you accomplish those goals let's go ahead and run misery 2023 on this project and so we were able to run analysis fairly quickly 231 tasks were reported and these can be viewed in our quality task view here these can be sorted by rule identifier or severity uh I recommend looking at things by severity since those are going to highlight the ones that are probably the most important
as far as quality is concerned and if we double click on any of these it'll take us to the exact line of code where the violation occurred we can provide we can perform the same process if we wanted to uh run the SE search seat test configuration uh first I will go ahead and remove all of the previous violations and then we can run the SII search C rules and with the SEI search C rules only 113 tests are reported and again we can look at all of the we can sort based on test type
or severity and we have various pieces of information here to allow us to triage the issue now in addition to misra C or SEI search C or any other test configuration uh these test configurations can be modified so if there are certain rules that you wanted to add or remove uh any of those could be modified uh to create your own custom test configuration to only execute the rules that you're interested in now that we've gathered static analysis violations either from a security perspective like SEI search C or from a quality perspective like misra C
the next next objective is to see how well the code is currently being tested and the way way we'll do that is by measuring code coverage the project may have existing system integration or unit tests or may even be run with a QA plan manually either way we can instrument the application libraries used or the test Suite to G gather various types of cover coverage metrics this will allow you to evaluate how well the project is currently tested in any risks Associated for this example I'm going to instrument this uh application itself which is a
simple console application that requires no user input however this could be a specific Library it could be uh the unit tests with another unit testing framework like Google test uh it could be anything that compiles into a binary that can be executed and was as with everything else it's just another test configuration that we run and we will go ahead and run this test configuration and this application ran very quickly and we can see anywhere in green these are lines that were actually executed and anywhere in red were lines that were not executed during the
running of this application we can take a peek at the coverage Tab and we can drill into this to see all of the different source files and the amount of coverage each one of them received as far as line coverage is concerned and we can also drill into each one of these C files to see uh what the current status is of various functions in their relative code code coverage percentages and from here we can see very quickly that by running the application this source file was not executed at all whereas these two source files
had partial execution and this one we hit 100% of the line cover so if you imagine this being a manual QA plan uh it certainly indicates some areas that uh either the QA plan uh is missing because this code was never executed and some places where it could be improved several other questions can be raised here for example if we look at this particular function add timer as we can see on line 83 this error path was never tested this raises several questions what happens if an error occurs was it tested is it an impossible
scenario another example May identify larger problematic sections of code like the function format Tim or record since this code wasn't covered at all it raised different questions since it wasn't covered what does it say about the existing test QA plan is this code ever used maybe it's unreachable dead code all of this information provides valuable insight into the current state of a project while we have been looking at simple line coverage we have multiple types of coverage available at your fingertips for instance we have statement block function path decision simple mod mcdc and call coverage
and finally not only are we Gathering code cover coverage and reporting that information back to you we're also doing memory monitoring of the application as it runs and during the execution the normal execution of this application run two very important things occurred one we read an array out of range which is very bad and then in another situation we freed an old Pointer while this may not necessarily be catastrophic it does indicate uh a place in code where somebody probably thought the pointer was going to be valid valid and non-null and so there are certain
assumptions made here that may indicate a larger issue at play so what if there are no existing tests or there are a lot of untested pieces of code within the project you inherited this is where parasoft can quickly close the gap and generate test for you automatically as with the theme of test configurations we have a test configuration that will allow you to generate unit tests let's go ahead and generate unit tests for this project now that the unit tests have been generated we can quickly inspect to see what parasoft created for each source file
we created a test Suite which has one or more unit tests generated for each function how the unit tests are generated depends on the complexity of the function under test and how the test configuration is configured let's take a look at a simple function and so we can understand that function and see how parasoft generated unit test cases for it and so this particular function was not covered during our previous application monitoring run a couple things we were ret turning an integer and it accepts an integer size and it does a simple comparison to buff
size and if it's less than it will return one otherwise it will return zero now as far as buff size is concerned let's go to the Declaration and see that this value is 100 and so if size is less than 100 we're going to return one and if it is greater than or equal to we will return zero with that information let's see what types of unit test cases we added and so this is our one of the unit test cases generated we had we generated a total of eight if we look at the first
test case generated we pass in a size of one into valid size the next unit test case generated we pass in a size of zero and you'll notice that we're doing one off our third test case uses a different number we use 99 here and this is where the intelligence of our solution comes into play we actually inspected the function under test and we know that something happens around the value 100 which was buff size and so from here you can see that we're testing 99 we're going to try 101 so we've tried both oneoff
situations and then finally we're going to test 100 and then in addition for good measure we're going to do a maximum integer as well as a minimum integer and finally -1 and so we hit all of the major test cases for this particular function so out of the box we should get close to 100% coverage on this function even though we didn't have any coverage before with our application monitoring run and the last step is to go ahead and run all of the unit tests that were generated and see what happens and now that we've
run these unit tests without writing a single line of code we can see how things have improved with code coverage so if you recall previously clock. C had 0% coverage but now it has 100% timer had much less percentage and now we have 90% And the same is true for driver. C and without writing a single line of code I've already increased the code coverage in my confidence with the code that I've inherited the beauty of this is that I've generated a variety of unit test cases that will capture the current behavior of the code
and will serve as an effective regression Suite now some modifications may need to be made uh some additional unit test cases may need to be created and so now if I were to make any modifications later I would understand very quickly what the impact was based on the unit test I would likely get a failing unit test and so that would all also allow me to assess risk of any changes so if a a large number of unit tests start failing when I make a modification I know that there's going to there's a change in
behavior and there likely going to cause some Downstream quality or security issues and the last thing we do when we generate unit tests automatically is since we are trying to pass in data to functions that could potentially cause issues you can see with the test that we generated on a aut atically we generated quite a few segmentation faults and this just means that the unit test that we created passed data to a function that it wasn't prepared for and so this can be viewed in a variety of ways it could be viewed as maybe this
code could never be executed in that way there's no way that value could be passed to the function where it could be viewed is that this function is inherently dangerous and that it doesn't check its inputs prior to using this and so it will at least highlight some of the challenges that you may run into and this concludes the technical demonstration of parasoft cc++ test I look forward to answering your questions at the end of the webinar and from here I'll pass it back to you Ricardo