Software: On the button

In the third in his series of four articles, Niroshan Rajadurai from Vector Software explains how establishing a common testing platform ensures the highest quality control
It is no surprise that cars will become ever more dependent on embedded software, but this increased reliance means increased scrutiny in terms of quality and reliability. From a consumer’s perspective, software quality is becoming the differentiating factor that can sway purchasing decisions. Ultimately, it can make or break life-long brand loyalty.
Cost of quality
Manufacturers have always been guilty of pushing the boundaries to reach the market first with the latest features, but at what cost? A product release date is a line in the sand, and with the clock ticking, developers, product managers and engineers are all racing to completion by the launch date circled in the diary. Software testing is often rushed or incomplete with products brought to market to feed demand with often sub-par software littered with bugs. Cue patches and software updates aplenty, as we saw with McLaren and Tesla.
Shift testing left
This quality deficit, more commonly known as technical debt, is a result of shortcuts and compromises taken to meet the short-term goal – product launch. Rarely written by a single developer or engineer, code integration can be time-consuming. The resulting knock-on effect plays into the hands of the next enemy of code quality – inadequate testing. However, developing the right tests and running appropriate tests greatly impacts on the final product. Yes, testing takes time, will cost money and absorbs resources, but the consequences of inadequate testing are really too great to bear.
Timing is everything – due to the pressure to get a product to market, more time is allocated to coding and less to API development and test case design. Running tests too late in the development process after source code changes have been integrated means the origin of software errors are hard to find. Therefore, the logical reaction is to move software testing to the left, moreover as early in the development process as possible, see diagram.
Development methods
Over time, developers devised and adopted different approaches and methodologies to try to tread the line between quality and time. Test-driven development (TDD) has become the ideal candidate for software development. The test-driven development methodology centres on the creation of tests before developers write a piece of code for a software project.
This forces the developer to think about test cases based on the interface and not based on the design of the code. These tests are based on the predetermined specifications and requirements for that feature or component. As in the agile framework, test-driven development requires that a project be divided into small iterations, each of which produces a deliverable unit.
By implementing TDD and starting the testing process earlier in the development stage – after system design but before code is written – developers build test cases for the specific system requirements. As each part of the system is designed and functions clarified, tests can be developed specifically for this function.
Regulatory compliance
The increase in software in safety-critical applications has seen a natural rise in regulations and guidelines to mitigate software-based disasters. With nearly all vehicular features now software driven and so many of them with safety implications, testing and compliance has never been more important.
A software code base used in embedded automotive software has many permutations and derivatives depending on the make and model of the vehicle. Adding to this complexity, each version needs to comply with numerous differing safety regulations such as Misra C, which is tested through static analysis, and ISO26262, which is tested through dynamic analysis.
Therefore, it is easy to see the test suite needs to become the developer’s best friend. Software engineers need a single source of testing truth, a common testing platform to simplify the process while ensuring regulations are met.
The fragmented nature of automotive manufacture places great pressure on tier-one suppliers and OEMs who have the responsibility of piecing all the disparate parts of the process together. The developer will write their own test cases when they write code and upload to a central repository. As components and code are pooled from around the supply chain, integration testing is required to ensure optimum software quality. With so many code bases to integrate with different hardware options during on-target testing, having the ability to test code in each configuration is a tall order, as it is time consuming and can leave holes in all levels of code coverage.
Common platform
The mixing of code bases from various points around the supply chain can contain gaps in testing completeness and inconsistencies from using different testing tools, which lead to poor software quality. A common testing platform removes this obstacle.
There are a number of additional benefits of a common testing platform. For example, it can offer a dashboard view, an overarching look at software testing performance and provide the option to drill down into areas that do not meet required quality metrics. This allows bugs to be found fast. The work to fix them can begin immediately and applied fixes re-tested quickly, which benefits everyone in the supply chain.
It can be a scalable resource that can span the entire supply chain from manufacturer right down to a sub-contractor – everyone is working from the same single source of the truth. And it can exponentially increase software quality even with multi-variant production environments as well as boosting compliance with regulations, as it allows manufacturers to complete a whole suite of tests, perform static and dynamic analysis from one single resource, avoiding discrepancies that can occur from using different tool sets.
There is a real business case for automated testing using a common platform, as it:
- • supports TDD and agile production methods;
- • reduces the cost of test equipment;
- • increases production efficiency;
- • reduces training costs; and
- • prepares the development process to adopt the next generation approach – continuous delivery of high quality software.
In conclusion, this is a time when competition between automotive manufacturers has never been so strong. The right testing platform can set a company apart from the rest.
Niroshan Rajadurai is director of EMEA for Vector Software
