Detecting Cars Using Gaussian Mixture Models - MATLAB & Simulink Example - MathWorks India
Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models
-
Upload
lionel-briand -
Category
Software
-
view
49 -
download
2
Transcript of Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models
![Page 1: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/1.jpg)
.lusoftware verification & validationVVS
Improving Fault Localization for Simulink Models
using Search-Based Testing and Prediction Models
Bing Liu, Lucia, Shiva Nejati, Lionel BriandSnT Centre, University of Luxembourg
SANER 2017, Klagenfurt, Austria
![Page 2: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/2.jpg)
Simulation
2
![Page 3: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/3.jpg)
Simulink
• Is a data flow-driven block diagram language
• Is widely used in the automotive domain
• Is executable and enables simulation and early testing
• Supports automated code generation
3
![Page 4: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/4.jpg)
Simulink Fault Localization
4
✔ ATestcase
![Page 5: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/5.jpg)
Background: Statistical Debugging
5
b4
b2 b3 b5
b7b6
b8
b10 b11 b12
b14b13
b9
b1
Block Rankings
b1b2b3b4b5b6b7b8b9
b10b11b12b13b14
input1
input2
input3
output
![Page 6: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/6.jpg)
6
Ranking Scoreb1 0b2 0b3 0b4 0b5 0b6 0b7 0b8 0b9 0
b10 0b11 0b12 0b13 0b14 0
input1
input2
input3
output
Execute test case 1b4
b2 b3 b5
b7b6
b8
b10 b11 b12
b14b13
b9
b1
Background: Statistical Debugging
![Page 7: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/7.jpg)
7
Ranking Scoreb6 1b2 0.5b3 0.5b5 0.5b7 0.5b8 0.5b9 0.5
b10 0.5b12 0.5b13 0.5b14 0.5b1 0b4 0
b11 0
input1
input2
input3
output
Execute test case 2b4
b2 b3 b5
b7b6
b8
b10 b11 b12
b14b13
b9
b1
Background: Statistical Debugging
![Page 8: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/8.jpg)
Problem: Performance Limitations
8
Ranking Scoreb6 1b2 0.5b3 0.5b5 0.5b7 0.5b8 0.5b9 0.5
b10 0.5b12 0.5b13 0.5b14 0.5b1 0b4 0
b11 0
• Faulty blocks may not be ranked high
• Many blocks may have the same score
• Engineers may have to inspect many blocks until they find the faulty block(s)
![Page 9: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/9.jpg)
Goal: Improving Statistical Debugging
• Statistical debugging can be improved by using larger test suites
• But, adding test cases is not cost-free in some contexts because
* test oracles need to be developed manually
* running test cases might be expensive
• We need to generate a small but effective set of test cases9
![Page 10: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/10.jpg)
Our Approach
10
Model Test Suite + Test Oracle Ranking
Generate a small but effective set of test cases
No
YesRegenerate rankings
Are existing rankings likely to be improved by adding more test cases?
Static analysis+
Predictor models
By diversifying test cases
![Page 11: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/11.jpg)
Test Case Generation
• We use a Single-State search technique to generate new test cases
• Our search strategy is guided by three alternative test objectives that aim to increase the diversity of the test suite
• Dynamic basic blocks; Baudry et al. [ICSE’06]
• Coverage Density; Campos et al. [ASE’13]
• Coverage dissimilarity; Jiang et al. [ASE’09]
• None of the above test objectives require test oracles11
![Page 12: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/12.jpg)
Stop Test Generation Criteria
• We stop the test generation when adding test cases is unlikely to improve the rankings
• We rely on
* Simulink Super Blocks: based on static analysis of Simulink models
* Predictor models built using a supervised learningtechnique and historical data
12
![Page 13: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/13.jpg)
Decision Trees• Input features:
• Current Round index
• Set Distance
• Ordering Distance
13
![Page 14: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/14.jpg)
Experiment Evaluation
• We applied our approach to 60 single-fault-seeded versions of our three industrial Simulink models
• We compared our three different test objectives
• We evaluated the effectiveness of predictor models
• The experiment results (except for original industry models) are available at https://github.com/Avartar/TCGenForFL/)
14
![Page 15: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/15.jpg)
Results (1)
15
• [Accuracies of different test objectives]ü The generated test cases significantly improved the fault localization accuracy
ü The three test objectives outperform Random test generation
ü No significant difference in the three test objectives
![Page 16: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/16.jpg)
Results (2)
16
• [Impact of adding test cases]ü Adding test cases may not always improve fault localization accuracy
![Page 17: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/17.jpg)
Results (3)
17
• [Effectiveness of predictor model]ü Our approach is able to maintain almost the same fault localization accuracy
while reducing the average number of newly generated test cases by more than half.
![Page 18: Improving Fault Localization for Simulink Models using Search-Based Testing and Prediction Models](https://reader031.fdocuments.in/reader031/viewer/2022030306/58cea2081a28abb26e8b5623/html5/thumbnails/18.jpg)
Conclusion
• We proposed a new approach to improve fault localization accuracy for Simulink models by extending an existing test suite with a small number of high quality test cases.
• We evaluated our approach on 60 faulty versions of industry models.
• Our approach significantly improves the accuracy of fault localization for small test suite sizes
• Our approach is able to maintain almost the same fault localization accuracy while reducing the average number of newly generated test cases by more than half
18