guided test case generation through ai enabled output

17
Guided Test Case Generation Through AI Enabled Output Space Exploration SIEMENS CT RDA SSI AVI-US siemens.com Restricted © Siemens AG 2018

Upload: others

Post on 18-Dec-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Guided Test Case Generation Through AI Enabled Output

Guided Test Case Generation Through AI Enabled Output Space Exploration

SIEMENS CT RDA SSI AVI-US

siemens.comRestricted © Siemens AG 2018

Page 2: Guided Test Case Generation Through AI Enabled Output

Problem Statement

Page 3: Guided Test Case Generation Through AI Enabled Output

Page 3 Restricted © Siemens AG 2018

Overview

Challenge• Test data plays a crucial role in the overall software testing process

• describes the initial conditions for a test • influence the behavior of the system under test

• Most test designs are based on test data generated either at random, or through systematic input space exploration, i.e. guided through fault ontology or some coverage metric

à translates to highly non-deterministic probability and time frame for discovering relevant faults.à coverage of input space does not correlate to coverage of the output space.

Objective• Systematically explore the SUT’s output space to ensure an adequate coverage and to find new input/output

pairs of interest, i.e.:• values, not covered by the existing test-suite, or • values where small changes to the input result in un-proportionally large changes of the output)

à better chance of exposing system faults

Page 4: Guided Test Case Generation Through AI Enabled Output

Guided Test Case Generation Through AI Enabled Output Space Exploration

Page 5: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 201728.11.2017Page 5 Corporate Technology

AI-enabled output-space exploration

NN as SUT approximation

Output space exploration àdefine of new outputs

Reverse exploration of NN àobtain respective inputs

Use new inputs for testing

Page 6: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 201728.11.2017Page 6 Corporate Technology

The Evaluation Phase

Eval Input ResultsMatch? Add to test suite

DisambiguatemismatchTrain SUTNN

Query SUTNN

for new input

Bug found!Add to training data

Match

Mis

smat

ch

Page 7: Guided Test Case Generation Through AI Enabled Output

Pilot Context

Page 8: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 2017Page 8 Corporate Technology - Architecture and Verification of Intelligent Systems (CT SSI AVI-US)

Train Control Systeman advanced train protection system designed to monitor and control train movements with the goal to: 1. increase safety2. reduce infrastructure utilization3. increase operational efficiency by automatically stopping the train in cases where the train engineer fails to act according to protocol.

Challenges- high level of complexity, heterogeneity, and

sensitivity to the uncertainties of sensor data (e.g. positioning information)

- safety-critical

Research Context

Page 9: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 201728.11.2017Page 9 Corporate Technology

Step 1: Train• Obtain Test Data

• 2000 Observation with 80/20 split• Neural Network Architecture & Training

• 2-layer NN (1 fully-connected layer with 5 neurons) in TensorFlow

• Inference: ReLU non-linearity applied to hidden layer, identity function to output layer

• Loss Measurement: Mean Square Error• Optimizer: ADAM

Step 2: Query• Exploration Strategies• Generation of Adversaries

Step 3: Evaluate

Pilot approach

Functional Continuity Strategy

Output Categorization Strategy

Page 10: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 2017Page 12 Corporate Technology - Architecture and Verification of Intelligent Systems (CT SSI AVI-US)

Query NN

• Synthesizing an adversarial example:• Use of FGSM (fast gradient sign method)

• constrained minimization within a predefined

max. change budget - !.• Given a new breaking distance "′, i.e.

$%&'($_*+$,+$ = ([208.564966], )• try to find an adversarial input ;’

• constrained by some distance metric used to

quantify similarity (!), so that ; − ;′ ≤ !.• At the same time à fix the model

• already trained ? & @ won’t change

• the only thing left to modify is the input vector

;.

Page 11: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 201728.11.2017Page 13 Corporate Technology

Pilot results

• Original Coverage obtained from 2000 Test Cases generated at random• Non-uniform distribution in output space à Coverage in the category (700 – 800ft.) - <2%

• Coverage increase to at least 250 data points per category after application of our method

Original Coverage New Test Case Distribution

Page 12: Guided Test Case Generation Through AI Enabled Output

Summary

Page 13: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 201728.11.2017Page 15 Corporate Technology

Summary

• Ensured significant increase of output-space coverage

• Initial findings of deviations between results from SUT and NN on newly generated datasets

Next Steps

• Addressing some open questions:

• Stateful vs stateless problems

• Mapping real data to NN input layer

• Automated test oracle & test data generation through integration with formal verification method (see Formal Verification of Train Control with Air Pressure Brakes paper à link)

• Efficiency (vs customer’s Monte-Carlo Simulation approach) & Effectiveness benchmark (Mutation Test)

Summary, Next steps & Transfer to the BUs

Page 14: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 2017

Page 16 Corporate Technology - Architecture and Verification of Intelligent Systems (CT SSI AVI-US)

Contact

GeorgiMarkov

CT RDA SSI AVI-USTest ArchitectArchitecture and Verification of Intelligent Systems

755 College Rd EPrinceton, NJ 08540USAPhone: +1 (609) 216 6403

E-mail: [email protected]

Marco Gario

ChristofBudnik

ZhuWang

Page 15: Guided Test Case Generation Through AI Enabled Output

BackUp Slides

Page 16: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 2017Page 19 Corporate Technology - Architecture and Verification of Intelligent Systems (CT SSI AVI-US)

Verification of functional equivalence using a formal Test Oracle

Page 17: Guided Test Case Generation Through AI Enabled Output

Restricted © Siemens AG 2017Page 20 Corporate Technology - Architecture and Verification of Intelligent Systems (CT SSI AVI-US)

White-box Testing Approach: Progress Summary

Vision:• Improve quality of Cyber-Physical System

algorithms by formally proving safety and performance of MO’s braking curve algorithm

• Ensure functional equivalence of proven formal model and actual existing implementation by means of cross-validation

Progress:

• RSSRail Model of braking curve algorithm

• Proof of the braking safety property

• Generator for controller code and test data

• Case Study: OBU Braking Curve

• Finding deviations in permitted speed

Next Steps:

• Model enhancements

• Improvements to code generators

• Performance evaluation of proposed approach in

comparison with Monte-Carlo Simulation (MO)