26
Test generation from functional 3D virtual environment models Barath Kumar 1 , Rainer Drath 2 and Juergen Jasperneite 3 (Contact: [email protected] ) 1 inIT Institute of Industrial Information Technologies, Germany (former employer ). 1 dSPACE GmbH, Paderborn, Germany (current employer ). 2 ABB Corporate Research Center, Ladenburg, Germany. 3 Fraunhofer IOSB INA, Anwendungszentrum Industrial Automation, Lemgo, Germany.

Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

Test generation from functional 3D

virtual environment models

Barath Kumar1, Rainer Drath2 and Juergen Jasperneite3

(Contact: [email protected])

1 inIT – Institute of Industrial Information Technologies, Germany (former employer).

1 dSPACE GmbH, Paderborn, Germany (current employer).

2 ABB Corporate Research Center, Ladenburg, Germany.

3 Fraunhofer IOSB – INA, Anwendungszentrum Industrial Automation, Lemgo, Germany.

Page 2: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

2 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Objective of the prototype

Automated test case generation from 3D virtual production floor models (plant models) for Programmable logic Controller (PLC) testing.

Page 3: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

3 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

To Test

Control software of:

Migrating PLCs (i.e. PLCs with updated logic)

Exchanged PLCs (i.e. New hardware without changes to logic)

Page 4: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

4 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Errors to be identified in the control logic:

• Logical Errors

• e.g. If the tray is empty, does the PLC take an appropriate action?

• Timing Errors (Not considered in this work)

• e.g. If the tray is empty, does the PLC take appropriate action in a pre-defined duration?

• Plant Errors

• e.g. if a sensor is broken can the PLC still handle the plant appropriately

Page 5: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

5 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Haves and Challenge

• A 3D virtual representation of a production facility (plant model). This virtual facility can mimic the workings of the real plant – when we provide the necessary stimulus

• We know how to generated test cases from formal behavior models

• To extract the necessary behavior information from the 3D virtual plant model to construct formal behavioral model of the plant

Our Challenge:

Haves:

Page 6: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

6 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Proposed Approach

Plant Model (Robot Studio Model)

Formal Model

of the Plant

Behavior

(Test Model)

Learning

Test Case

Generation

Test Suite

Test Case

Execution

PLC

Page 7: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

7 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Proposed Approach

Plant Model (Robot Studio Model)

Formal Model

of the Plant

Behavior

(Test Model)

Learning

Test Case

Generation

Test Suite

Test Case

Execution

PLC

Page 8: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

8 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Hardware-in-the-loop (HIL) Simulation - Information Source

Plant Model

Reference PLC

Industrial

Bus

Hardware-in-the-Loop Model Learning Setup

Page 9: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

9 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Model Learning

Learning

Signal Analyser

Plant Model (Robot Studio Model)

Formal Model

of the Plant

Behavior

(Test Model)

Page 10: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

10 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Virtual Plant Model

Sensor 3

Sensor 2

Sensor 12

Sensor 4

Sensor 11

Page 11: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

11 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Information from Signal Analysis

Sensors (State Variables)

Page 12: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

12 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Information from Signal Analysis

State Variables

and so on..

Event Occurrence

e.g. State Structure: 0 0 0 0 0

s2

s3

s12

s4

s1100000 00010

00011

Page 13: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

13 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Formal Plant Model (Test Model)

00000

0001000011

e.g. Structure: 0 0 0 0 0

s2

s3 s4

s11s12

Page 14: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

14 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Plant Model (Robot Studio Model)

Formal Model

of the Plant

Behavior

(Test Model)

Learning

Test Case

Generation

Test Suite

Test Case

Execution

PLC

Test Case Generation

Page 15: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

15 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Test Case Generation (with coverage criterion)

Test case

generationCoverage

criterion

Q

Test case

is the

Coverage criterion

met?

No

Yes

1

3

2

4

5

a

b

c

def

g

h

Test model/Automaton Final_test_suite

{

// All paths from state 1 to

state 5

a ; b ; h ;

a ; b ; e ; f ;

a ; d ; f ;

}

Test suite

Page 16: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

16 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Generated Test Suite

Module Test Suite

s3 = 1;s2 = 1;s3 = 0;s12 = 1;s2 = 0;s12 = 0;

s3 = 1;s2 = 1;s3 = 0;s2 = 0;

s3 = 1;s3 = 0;

s2 = 1;s12 = 1;s2 = 0;s12 = 0;

s2 = 1;s3 = 1;s3 = 0;s12 = 1;s2 = 0;s12 = 0;

s2 = 1;s3 = 1;s3 = 0;s2 = 0;

s2 = 1;s2 = 0;

s11 = 1;s11 = 0;

s11 = 1;s4 = 1;s4 = 0;s11 = 0;

s11 = 1;s4 = 1;s11 = 0;s11 = 1;s4 = 0;s11 = 0;

s11 = 1;s4 = 1;s11 = 0;s4 = 0;

s4 = 1;s11 = 1;s4 = 0;s11 = 0;

s4 = 1;s11 = 1;s4 = 0;s4 = 1;s11 = 0;s4 = 0;

s4 = 1;s11 = 1;s11 = 0;s4 = 0;

s4 = 1;s4 = 0;

Test case generation time: 00:00:45.5781250 seconds

Avoided loops : 8

Generated test cases: 15

Page 17: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

17 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Plant Model (Robot Studio Model)

Formal Model

of the Plant

Behavior

(Test Model)

Learning

Test Case

Generation

Test Suite

Test Case

Execution

PLC

Test Case Execution

Completes the process

but not part of this

pilot project

Page 18: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

18 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Analysis of the Approach

• Errors in ‘Migrating PLCs’ and on ‘Exchanged PLCs’ can be detected

• No manual formal modeling effort is required

• This approach can be adopted even for testing legacy systems thathave been in existence for decades

• Existence of a reference implementation (‘Reference PLC’) is a pre-requisite

• As the reference implementation is the input for the learned model,logical errors present in the reference implementation cannot bedetected

Page 19: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

19 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Outlook

• Learning of continous behavior

• Learning of non-deterministic behavior

• Learning of real-time behavior

• Test case generation from complex ‘non-deterministic hybrid real-time’ models

• Identification of timing errors

Page 20: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

20 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

I am done !

Page 21: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

21 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Reserve Slides

Page 22: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

22 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Information from Signal Analysis

State Variables

and so on..

Event Occurrence

e.g. State Structure: 0 0 0 0 0

s2

s3

s12

s4

s1100000 00010

00011

Page 23: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

23 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Formal Plant Model (Test Model)

00000

0001000011

00001

01000

10000 11000

10100

00100

e.g. Structure: 0 0 0 0 0

s2

s3 s4

s11s12

Page 24: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

24 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Benefits

• Cost-effective

• Reduces plant down-time (planned and unplanned downtime)

• Surprises during commissioning can be minimized

• To improve testing thoroughness and maintenance of tests cases

Page 25: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

25 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Analysis Summary

Logical Errors Plant Errors

Reference PLC No Yes

Exchanged PLC Yes Yes

Migrating PLC Yes Yes

Page 26: Test generation from functional 3D virtual environment models · 2014-09-18 · Test generation from functional 3D virtual environment models Barath Kumar1, Rainer Drath2 and Juergen

26 | 17.09.2014 | Barath Kumar – Test generation from functional 3D virtual environment models

Test Case Generation (Basic Idea)

1

3

2

4

5

a

b

c

def

g

hTest case

generation

Test Model / Automaton

Test_case

{

a ; b ; h ; g

}