Crossing the Boundaries while Analyzing
   Heterogeneous Component-Based
           Software Systems


                      Amir Reza Yazdanshenas
                                 Leon Moonen


                                      2011/09/28
                                      ICSM 2011
Safety Monitoring and Control System




                                       2
Safety Monitoring and Control System



     Sensor                            Actuator




     Sensor           logic            Actuator
              Input           Output



     Sensor                            Actuator




                                                  3
Safety Monitoring and Control System




                  logic
          Input           Output




                                       4
Case Description

Start with clear              More costumers:    More costumers:
design & documents            new requirements   scalability

Input1             Output1
Input2
         A     A
                   Output2
                              • Inhibit           Input1
                                                           A   A Output1
         D     D
Input3
         D     D
                 Output3      • Override
Input4           Output4
Input5
         D     D
                 Output5
                              • Suppress
         D     D
Input6
         D     D
                 Output6      • Acknowledge      CascIn            CascOut

Input7           Output7
         A     D
               D Output8
                 Output9                                   A   A
               D



 Similar to digital circuit                       CascIn
                                                                   CascOut
 design components!

                                                 Workaround:
                                                 • Cascading modules
                                                 • Voting modules
                                                                             5
Case Description…
More costumers:
reusing decisions




                    6
Case Description…

    Potentially unlimited number of configurations
    –  No default/standard configuration of components!
    –  Separate configuration for each installation



    –  (examples omitted due to NDA)




                                                          7
Problem Statement


                      logic




                Comp. 1   Comp. 3
        Input                       Output

                Comp. 2   Comp. n




                                             8
Problem Statement

      Do sensor signals reach the correct output actuators?

                               logic




         Input                                    Output




                       For certification purposes,
                 can we provide source based evidence?

                                                              9
Tracking Information Flow

           “find source based evidence that
       signals from sensors trigger the correct
                       actuators”

            is there information flow from
     the desired sensors to the selected actuator?

         are the desired sensors (input ports)
          part of the backward program slice
        for the selected actuator (output port)?

                                                     10
Heterogeneous Systems
  Deployed system is not just set of components
   –  actual behavior depends on composition &
      configuration
   –  literature focuses on analysis of homogeneous
      systems
⚡ Existing slicing tools are language specific
   ⚡ no support for “external” artifacts




                                                      11
Challenge #1:

          void main() {       void main() {                                             void main() {                    void main() {
           int sum, I;
           while ( i<11 ){
            sum = add(sum)
                               int sum, I;
                               while ( i<11 ){
                                sum = add(sum)
                                                                                         int sum, I;
                                                                                         while ( i<11 ){
                                                                                          sum = add(sum)
                                                                                                                     ✗    int sum, I;
                                                                                                                          while ( i<11 ){
                                                                                                                           sum = add(sum)
            i = add(i, 1);      i = add(i, 1);                                            i = add(i, 1);                   i = add(i, 1);
                 …                   …                                                         …                                …
                                                                                                                     ✗
                                                                                                                                                 ✓




                                                          ✗
           sensor.c              input.c                                                   voter.c                        output.c




© 2011 Leon Moonen           Model-driven Information Flow Analysis to Support Software Certification - NECSIS Seminar at Queen's (2011/06/27)       12
Shared Memory Communication


                                    main

                           cause & effect
               cause           matrix           effect
     input A           1    2   3           j
                                                         output B
                       2
                       3

                                                effect
                                                         output C



     input B   cause   i
                                                         output D
                                                effect




                                                                    13
Challenge #2:


                     output#1
sensor#1


           input#1
                     output#2
sensor#2



           input#2   output#3



sensor#N
                     output#4


                                14
Challenge #2:


                     output#1
sensor#1


           input#1
                     output#2
sensor#2



           input#2   output#3



sensor#N
                     output#4


                                15
Our solution: Build a Homogeneous
Model of the System




                                    16
KDM: Flexible and Extensible




                               17
SDG: ICDG + CDGs




                   18
Conclusion
void main() {      void main() {      void main() {      void main() {
 int sum, I;        int sum, I;        int sum, I;        int sum, I;
 while ( i<11 ){    while ( i<11 ){    while ( i<11 ){    while ( i<11 ){
  sum = add(sum)     sum = add(sum)     sum = add(sum)     sum = add(sum)
  i = add(i, 1);     i = add(i, 1);     i = add(i, 1);     i = add(i, 1);
       …                  …                  …                  …




 sensor.C             input.C            voter.C          output.C




                                                                            19
Conclusion


                               output#1
sensor#1
                     voter#1
           input#1
                               output#2
sensor#2
                     voter#2

           input#2             output#3



sensor#N             voter#3

                               output#4


                                          20
Conclusion

✓              ✓
✓                  ✓
                                     ✓
               ✓                                           output#1
                                                   ✓
✓ sensor#1         ✓                 ✓
                                 ✓
                                         voter#1       ✓
                       input#1                         ✓
                                                           output#2
                                                                      ✓
    sensor#2
                   ✓
                                         voter#2
                   ✓             ✓
                       input#2       ✓             ✓       output#3
               ✓
                                     ✓
✓ sensor#N                           ✓ voter#3
                                                           output#4


                                                                          21
Precision & Scalability Tests
  Identical results with CodeSurfer on an
   example program

  Kongsberg code base:




                                             22
Precision & Scalability Tests
  Identical results with CodeSurfer on an
   example program

  Kongsberg code base:




                                             23
Limitations
   Bit manipulation: no precise information flow
    –  granularity limitation in Codesurfer implementation
   Implemented for C with proprietary composition
    –  experiment with other languages, e.g. Java and other
       composition languages/frameworks



 Future Work
  Abstraction and visualization
   –  improve comprehensibility of results
   –  present the result in multiple abstraction layers
       –  separate Intra- and Inter- component information
          flows
                                                              24
Thank you!


Comments/Questions?



                      25

Components - Crossing the Boundaries while Analyzing Heterogeneous Component-Based Software Systems

  • 1.
    Crossing the Boundarieswhile Analyzing Heterogeneous Component-Based Software Systems Amir Reza Yazdanshenas Leon Moonen 2011/09/28 ICSM 2011
  • 2.
    Safety Monitoring andControl System 2
  • 3.
    Safety Monitoring andControl System Sensor Actuator Sensor logic Actuator Input Output Sensor Actuator 3
  • 4.
    Safety Monitoring andControl System logic Input Output 4
  • 5.
    Case Description Start withclear More costumers: More costumers: design & documents new requirements scalability Input1 Output1 Input2 A A Output2 • Inhibit Input1 A A Output1 D D Input3 D D Output3 • Override Input4 Output4 Input5 D D Output5 • Suppress D D Input6 D D Output6 • Acknowledge CascIn CascOut Input7 Output7 A D D Output8 Output9 A A D Similar to digital circuit CascIn CascOut design components! Workaround: • Cascading modules • Voting modules 5
  • 6.
  • 7.
    Case Description…   Potentially unlimited number of configurations –  No default/standard configuration of components! –  Separate configuration for each installation –  (examples omitted due to NDA) 7
  • 8.
    Problem Statement logic Comp. 1 Comp. 3 Input Output Comp. 2 Comp. n 8
  • 9.
    Problem Statement Do sensor signals reach the correct output actuators? logic Input Output For certification purposes, can we provide source based evidence? 9
  • 10.
    Tracking Information Flow “find source based evidence that signals from sensors trigger the correct actuators”   is there information flow from the desired sensors to the selected actuator?   are the desired sensors (input ports) part of the backward program slice for the selected actuator (output port)? 10
  • 11.
    Heterogeneous Systems   Deployedsystem is not just set of components –  actual behavior depends on composition & configuration –  literature focuses on analysis of homogeneous systems ⚡ Existing slicing tools are language specific ⚡ no support for “external” artifacts 11
  • 12.
    Challenge #1: void main() { void main() { void main() { void main() { int sum, I; while ( i<11 ){ sum = add(sum) int sum, I; while ( i<11 ){ sum = add(sum) int sum, I; while ( i<11 ){ sum = add(sum) ✗ int sum, I; while ( i<11 ){ sum = add(sum) i = add(i, 1); i = add(i, 1); i = add(i, 1); i = add(i, 1); … … … … ✗ ✓ ✗ sensor.c input.c voter.c output.c © 2011 Leon Moonen Model-driven Information Flow Analysis to Support Software Certification - NECSIS Seminar at Queen's (2011/06/27) 12
  • 13.
    Shared Memory Communication main cause & effect cause matrix effect input A 1 2 3 j output B 2 3 effect output C input B cause i output D effect 13
  • 14.
    Challenge #2: output#1 sensor#1 input#1 output#2 sensor#2 input#2 output#3 sensor#N output#4 14
  • 15.
    Challenge #2: output#1 sensor#1 input#1 output#2 sensor#2 input#2 output#3 sensor#N output#4 15
  • 16.
    Our solution: Builda Homogeneous Model of the System 16
  • 17.
    KDM: Flexible andExtensible 17
  • 18.
    SDG: ICDG +CDGs 18
  • 19.
    Conclusion void main() { void main() { void main() { void main() { int sum, I; int sum, I; int sum, I; int sum, I; while ( i<11 ){ while ( i<11 ){ while ( i<11 ){ while ( i<11 ){ sum = add(sum) sum = add(sum) sum = add(sum) sum = add(sum) i = add(i, 1); i = add(i, 1); i = add(i, 1); i = add(i, 1); … … … … sensor.C input.C voter.C output.C 19
  • 20.
    Conclusion output#1 sensor#1 voter#1 input#1 output#2 sensor#2 voter#2 input#2 output#3 sensor#N voter#3 output#4 20
  • 21.
    Conclusion ✓ ✓ ✓ ✓ ✓ ✓ output#1 ✓ ✓ sensor#1 ✓ ✓ ✓ voter#1 ✓ input#1 ✓ output#2 ✓ sensor#2 ✓ voter#2 ✓ ✓ input#2 ✓ ✓ output#3 ✓ ✓ ✓ sensor#N ✓ voter#3 output#4 21
  • 22.
    Precision & ScalabilityTests   Identical results with CodeSurfer on an example program   Kongsberg code base: 22
  • 23.
    Precision & ScalabilityTests   Identical results with CodeSurfer on an example program   Kongsberg code base: 23
  • 24.
    Limitations   Bitmanipulation: no precise information flow –  granularity limitation in Codesurfer implementation   Implemented for C with proprietary composition –  experiment with other languages, e.g. Java and other composition languages/frameworks Future Work   Abstraction and visualization –  improve comprehensibility of results –  present the result in multiple abstraction layers –  separate Intra- and Inter- component information flows 24
  • 25.