the infinite software development lifecycle of …...the infinite software development lifecycle of...

9
The Infinite Software Development Lifecycle of Connected Systems The Infinite Software Development Lifecycle of Connected Systems Introduction Anyone familiar with functional safety standards such as DO-178C 1 , IEC 61508 2 , ISO 26262 3 , or IEC 62304 4 , will know all about the concept of bi-directional traceability of requirements and the need to ensure that the design reflects the requirements, that the software implementation reflects the design, and that the test processes confirm the correct implementation of that software. Anyone used to developing safety critical software applications will be also familiar with how painful a change of requirements can be because of the need to identify the code to be changed, and to then identify any testing to be repeated. Until now, that cycle has concluded with product release. Sure, there might be tweaks in response to field conditions but the business of development is then essentially over. Then came the Connected Car; the Industrial Internet of Things; Remote Monitoring of Medical Devices. For these or any other connected systems, requirements don’t just change in an orderly manner during development. They change without warning - whenever some smart Alec finds a new vulnerability, develops a new hack, or puts your car into a ditch. And they keep on changing not just throughout the lifetime of the product, but as for long as it is out in the field, changing the significance and emphasis of the product maintenance phase. This paper outlines how next-generation automated management and requirements traceability tools and techniques can create relationships between requirements, code, static and dynamic analysis results, and unit- and system-level tests. It demonstrates how linking these elements enables the entire software development cycle to become traceable, making it easy for teams to identify problems and implement solutions faster and more cost effectively. And it highlights how such linked elements are even more important after product release, presenting a vital competitive advantage in dealing with the sinking feeling that starts with the message “We’ve been hacked”. Process objectives The ISO 26262 automotive functional safety standard serves as an example, but the principles discussed apply equally to the other safety critical industries and standards. Although terminology varies, a key element consistent to all such standards is the practice of allocating technical safety requirements in the system design specification, and developing that design further to derive an item integration and testing plan. It applies to all aspects of the system, with the explicit subdivision of hardware and software development practices being dealt with as the lifecycle progresses. 1 RTCA DO-178C “Software Considerations in Airborne Systems and Equipment Certification” http://www.rtca.org 2 IEC 61508-1:2010 Functional safety of electrical/electronic/programmable electronic safety-related systems 3 International standard ISO 26262:2011 Road vehicles Functional safety 4 IEC 62304 International Standard Medical device software Software life cycle processes Consolidated Version Edition 1.1 2015-06

Upload: others

Post on 28-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

The Infinite Software Development Lifecycle of Connected Systems

Introduction Anyone familiar with functional safety standards such as DO-178C1, IEC 615082, ISO 262623, or IEC 623044, will know all about the concept of bi-directional traceability of requirements and the need to ensure that the design reflects the requirements, that the software implementation reflects the design, and that the test processes confirm the correct implementation of that software. Anyone used to developing safety critical software applications will be also familiar with how painful a change of requirements can be because of the need to identify the code to be changed, and to then identify any testing to be repeated. Until now, that cycle has concluded with product release. Sure, there might be tweaks in response to field conditions but the business of development is then essentially over. Then came the Connected Car; the Industrial Internet of Things; Remote Monitoring of Medical Devices. For these or any other connected systems, requirements don’t just change in an orderly manner during development. They change without warning - whenever some smart Alec finds a new vulnerability, develops a new hack, or puts your car into a ditch. And they keep on changing not just throughout the lifetime of the product, but as for long as it is out in the field, changing the significance and emphasis of the product maintenance phase. This paper outlines how next-generation automated management and requirements traceability tools and techniques can create relationships between requirements, code, static and dynamic analysis results, and unit- and system-level tests. It demonstrates how linking these elements enables the entire software development cycle to become traceable, making it easy for teams to identify problems and implement solutions faster and more cost effectively. And it highlights how such linked elements are even more important after product release, presenting a vital competitive advantage in dealing with the sinking feeling that starts with the message “We’ve been hacked”.

Process objectives The ISO 26262 automotive functional safety standard serves as an example, but the principles discussed apply equally to the other safety critical industries and standards. Although terminology varies, a key element consistent to all such standards is the practice of allocating technical safety requirements in the system design specification, and developing that design further to derive an item integration and testing plan. It applies to all aspects of the system, with the explicit subdivision of hardware and software development practices being dealt with as the lifecycle progresses.

1 RTCA DO-178C “Software Considerations in Airborne Systems and Equipment Certification” http://www.rtca.org 2 IEC 61508-1:2010 Functional safety of electrical/electronic/programmable electronic safety-related systems 3 International standard ISO 26262:2011 Road vehicles — Functional safety 4 IEC 62304 International Standard Medical device software – Software life cycle processes Consolidated Version Edition 1.1 2015-06

Page 2: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

The relationship between the system-wide ISO 26262-4:2011 and the software specific sub-phases found in ISO 26262-6:2011 can be represented in a V-model. Each of those steps is explained further in the following discussion (Figure 1).

Figure 1 - Software-development V-model with cross-references to ISO 26262 and standard development tools

System design (ISO 26262-4:2011 section 7)

The products of this system-wide design phase potentially include CAD drawings, spreadsheets, textual documents and many other artefacts, and clearly a variety of tools can be involved in their production. This phase also sees the technical safety requirements refined and allocated to hardware and software. Maintaining traceability between these requirements and the products of subsequent phases generally causes a project management headache. The ideal tools for requirements management can range from a simple spreadsheet or Microsoft Word document to purpose-designed requirements management tool such as IBM Rational DOORS Next Generation5 or Siemens Polarion REQUIREMENTS6. The selection of the appropriate tools will help in the maintenance of bi-directional traceability between phases of development, as discussed later.

Specification of software safety requirements (ISO 26262-6:2011 section 6) This sub-phase focuses on the specification of software safety requirements to support the subsequent design phases, bearing in mind any constraints imposed by the hardware.

5 IBM® Rational® DOORS® http://www-03.ibm.com/software/products/en/ratidoor 6 SIEMENS Polarion® REQUIREMENTSTM https://polarion.plm.automation.siemens.com/products/polarion-requirements

Page 3: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

It provides the interface between the product-wide system design of ISO 26262-4:2011 and the software specific ISO 26262-6:2011, and details the process of evolution of lower level, software related requirements. It will most likely involve the continued leveraging of the requirements management tools discussed in relation to the System Design sub-phase. Software architectural design (ISO 26262-6:2011 section 7) There are many tools available for the generation of the software architectural design, with graphical representation of that design an increasingly popular approach. Appropriate tools are exemplified by MathWorks® Simulink®7, IBM® Rational® Rhapsody®8, and ANSYS® SCADE.9

Figure 2 - Graphical representation of Control and Data Flow as depicted in the LDRA tool suite

Static analysis tools contribute to the verification of the design by means of the control and data flow analysis of the code derived from it, providing graphical representations of the relationship between code components for comparison with the intended design (Figure 2).

A similar approach can also be used to generate a graphical representation of legacy system code, providing a path for additions to it to be designed and proven in accordance with ISO 26262 principles. Software unit design and implementation (ISO 26262-6:2011 section 8) Coding rules: The illustration in Figure 3 is a typical example of a table from ISO 26262-6:2011. It shows the coding and modelling guidelines to be enforced during implementation, superimposed with an indication of where compliance can be confirmed using automated tools.

7 MathWorks® Simulink https://uk.mathworks.com/products/simulink.html 8 IBM® Rational® Rhapsody® family http://www-03.ibm.com/software/products/en/ratirhapfami 9 ANSYS® SCADE Suite http://www.ansys.com/products/embedded-software/ansys-scade-suite

Page 4: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

These guidelines combine to make the resulting code more reliable, less prone to error, easier to test, and/or easier to maintain. Peer reviews represent a traditional approach to enforcing adherence to such guidelines, and although they still have an important part to play, automating the more tedious checks using tools is far more efficient, less prone to error, repeatable, and demonstrable.

Figure 3 - Mapping the capabilities of the LDRA tool suite to “Table 6: Methods for the verification of the software architectural design” specified by ISO 26262-6:201110

ISO 26262-6:2011 highlights the MISRA11 coding guidelines language subsets as an example of what could be used. There are many different sets of coding guidelines available, but it is entirely permissible to use an in-house set or to manipulate, adjust and add to one of the standard sets to make it more appropriate for a particular application (Figure 4).

Figure 4 - Highlighting violated coding guidelines in the LDRA tool suite

Software architectural design and unit implementation: Establishing appropriate project guidelines for coding, architectural design and unit implementation are clearly three discrete tasks but software developers responsible for implementing the design need to be mindful of them all concurrently. As for the coding guidelines before them, the guidelines relating to software architectural design and unit implementation are founded on the notion that they make the resulting code more reliable, less prone to error, easier to test and/or easier to maintain. For example, architectural guidelines include:

10 Based on table 6 from ISO 26262-6:2011, Copyright © 2015 IEC, Geneva, Switzerland. All rights acknowledged 11 MISRA – The Motor Industry Software Reliability Association https://www.misra.org.uk/

Page 5: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

• Restricted size of software components and Restricted size of interfaces are recommended not least because large, rambling functions are difficult to read, maintain, and test – and hence more susceptible to error.

• High cohesion within each software component. High cohesion results from the close linking between the modules of a software program, which in turn impacts on how rapidly it can perform the different tasks assigned to it.

Figure 5 - Output from control and data coupling analysis as represented in the LDRA tool suite

Static analysis tools can provide metrics to ensure compliance with the standard such as complexity metrics as a product of interface analysis, cohesion metrics evaluated through data object analysis, and coupling metrics via data and control coupling analysis (Figure 5).

More generally, static analysis can help to ensure that the good practices required by ISO 26262:2011 are adhered to whether they are coding rules, design principles, or principles for software architectural design. In practice, for developers who are newcomers to ISO 26262, the role of such a tool often evolves from a mechanism for highlighting violations, to a means to confirm that there are none. Software unit testing (ISO 26262-6:2011 section 9) and Software integration and testing (ISO 26262-6:2011 section 10) Just as static analysis techniques (involving an automated “inspection” of the source code) are applicable across the sub-phases of coding, architectural design and unit implementation, dynamic analysis techniques (involving the execution of some or all of the code) are applicable to unit, integration and system testing. Unit testing is designed to focus on particular software procedures or functions in isolation, whereas integration testing ensures that safety and functional requirements are met when units are working together in accordance with the software architectural design. ISO 26262-6:2011 tables list techniques and metrics for performing unit and integration tests on target hardware to ensure that the safety and functional requirements are met and software interfaces are verified at the unit and integration levels. Fault injection and resource tests further prove robustness and resilience and, where applicable, back-to-back testing of model and code helps to prove the correct interpretation of the design. Artefacts associated with these techniques provide both reference for their management, and evidence of their completion. They include the software unit design specification, test procedures, verification plan and verification specification. On completing each test procedure, pass/fail results are reported and compliance with requirements verified appropriately.

Page 6: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

Figure 6 - Performing requirement based unit-testing using the LDRA tool suite

The example in Figure 6 shows how the software interface is exposed at the function scope allowing the user to enter inputs and expected outputs to form the basis of a test harness. The harness is then compiled and executed on the target hardware, and actual and expected outputs compared. Unit tests become integration tests as units are introduced as part of a call tree, rather than being “stubbed”. Exactly the same test data can be used to validate the code in both cases. Boundary values can be analysed by automatically generating a series of unit test cases, complete with associated input data. The same facility also provides a facility for the definition of equivalence boundary values such as the minimum value, value below lower partition value, lower partition value, upper partition value and value above upper partition boundary. Should changes become necessary – perhaps as a result of a failed test, or in response to a requirement change from a customer - then all impacted unit and integration tests would need to be re-run (regression tested), automatically re-applying those tests through the tool to ensure that the changes do not compromise any established functionality. ISO 26262:2011 does not require that any of the tests it promotes deploy software test tools. However, just as for static analysis, dynamic analysis tools help to make the test process far more efficient, especially for substantial projects.

Page 7: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

Figure 7 - Examples of representations of structural coverage within the LDRA tool suite

Structural coverage metrics: In addition to showing that the software functions correctly, dynamic analysis is used to generate structural coverage metrics. In conjunction with the coverage of requirements at the software unit level, these metrics provide the necessary data to evaluate the completeness of test cases and to demonstrate that there is no unintended functionality (Figure 7). Metrics recommended by ISO 26262:2011 include functional, call, statement, branch and MC/DC coverage. Unit and system test facilities can operate in tandem, so that (for instance) coverage data can be generated for most of the source code through a dynamic system test, and then be complemented using unit tests to exercise, for example, any defensive constructs which are inaccessible during normal system operation.

Bi-directional traceability (ISO 26262-4:2011 and ISO 26262-6:2011) Bi-directional traceability runs as a principle throughout ISO 26262:2011, with each development phase required to accurately reflect the one before it. In theory, if the exact sequence of the V-model is adhered to, then the requirements will never change and tests will never throw up a problem. But life’s not like that. Consider, then, what happens if there is a code change in response to a failed integration test, perhaps because the requirements are inconsistent or there is a coding error. What other software units were dependent on the modified code? Such scenarios can quickly lead to situations where the traceability between the products of software development falls down. Once again, while it is possible to maintaining traceability manually, automation helps a great deal. Software unit design can take many forms – perhaps in the form of a natural language detailed design document, or perhaps model based. Either way, these design elements need to be bi-directionally traceable to both software safety requirements and the software architecture. The software units must then be implemented as specified and then be traceable to their design specification. Automated requirements traceability tools are used to establish traceability between requirements and tests cases of different scopes, which allows test coverage to be assessed (Figure 8). The impact of failed test cases can be assessed and addressed, as can the impact in requirements changes and gaps in requirements coverage. And artefacts such as traceability matrices can be automatically generated to present evidence of compliance to ISO 26262:2011.

Page 8: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

Figure 8 - Performing requirement based testing. Test cases are linked to requirements and executed within the LDRA tool suite

In practise, initial structural coverage is usually accrued as part of this holistic process from the execution of functional tests on instrumented code leaving unexecuted portions of code which require further analysis. That ultimately results in the addition or modification of test cases, changes to requirements, and/or the removal of dead code. Typically, an iterative sequence of review, correct and analyse ensures that design specifications are satisfied.

The Infinite Development Lifecycle When such changes become necessary, revised code needs to be reanalysed statically, and all impacted unit and integration tests need to be re-run (regression tested). Although that can result in a project management nightmare at the time, in an isolated application the need to support such occurrences lasts little longer than the time the product is under development. But connectivity demands the ability to respond to vulnerabilities identified in the field. Each newly discovered vulnerability implies a changed or new requirement, and one to which an immediate response is needed – even though the system itself may not have been touched by development engineers for quite some time. In such circumstances, being able to isolate what is needed and automatically test only the functions implemented becomes something much more significant. Whenever a new vulnerability is discovered, there is a resulting change of requirement to cater for it, coupled with the additional pressure of knowing that a speedy response could be critically important if products are not to be compromised in the field. Automated bi-directional traceability links requirements from a host of different sources through to design, code and test. The impact of any requirements changes – or, indeed, of failed test cases - can be assessed by means of impact analysis, and addressed accordingly. And artefacts can be automatically re-generated to present evidence of continued compliance to the functional safety standard of choice.

Conclusions Functional safety standards such as DO-178C, IEC 61508, ISO 26262, and IEC 62304, have made the concept of bi-directional traceability of requirements a familiar concept to anyone working in those industries, to ensure that the design reflects the requirements; that the software implementation reflects the design; and how the test processes confirm the correct implementation of that software. Anyone used to developing safety critical software applications will be also familiar with how painful a change of requirements can be, with its resulting change of design and code, consequential retesting.

Page 9: The Infinite Software Development Lifecycle of …...The Infinite Software Development Lifecycle of Connected Systems It provides the interface between the product-wide system design

The Infinite Software Development Lifecycle of Connected Systems

Although functional safety standards have significant contributions to make to both safety and security, there is no doubt that they bring considerable overhead with them. The application of automated tools throughout the development lifecycle can help considerably to minimize that overhead, whilst removing much of the potential for human error from the process. Never has that been more significant than now. Connectivity changes the notion of the development process ending when a product is launched, and whenever a new vulnerability is discovered in the field, there is a resulting change of requirement to cater for it. Responding to those requirements places new emphasis on the need for an automated solution, both during the development lifecycle and beyond.

Speaker

Company Details LDRA Portside Monks Ferry Wirral CH41 5LH Tel: 0151 649 9300 Fax: 0151 649 9666 E-mail: [email protected]

Contact Details