SIL Testing and Polyspace

4 次查看(过去 30 天)
vins
vins 2016-2-8
Hi, I actually work as software tester and my job consist in verify the Embedded C code generated from a Simulink model using SIL approach. Basically I have a model, a plant, that is a test harness, and the SIL block. What I have to do is implement test cases to verify part of the code, this could be an entire function or part of it. Tests should cover function behaviour completely, if possible, so each path should be tested, like a normal unit test. At the moment the entire process takes me a lot of time, most of which is spent for settings, the test harness is not generated automatically for example. So I'd like to know, is it be possible to perform all this actions automatically? I mean, does exist a tool which takes a function, or an entire component, and generate all the test cases that are needed. I was looking at Simulink Design Verifier features, and it seems to be just the Tool, I'd like to have a confirm here anyway! However, the problem is my Matlab and Simulink licence does not include Simulink Design Verifier, so it would be nice to use something else, if possible. Talking about Tools, could Polyspace be an alternative to the SIL testing? I know the first one is used for static analysis, whilst with SIL approach we have dinamic analysis, on the other hand, int the following article http://www.mathworks.com/products/polyspace/static-analysis-notes/better-testing-with-static-analysis.html appear that the abstract interpretation technique Polyspace uses would give completeness to the test, in term of static and dinamic behaviour. Can someone help with this matter?
  2 个评论
Satishkumar Aruljothi
Polyspace is not used for function testing. it is just a coverage tool.
you could use MATLAB simulink verification tools
Jay Abraham
Jay Abraham 2017-4-12
Note that Polyspace is a static code analysis tool. It is not a coverage analysis tool. See answer below for more information.

请先登录,再进行评论。

回答(3 个)

Lucas Lebert
Lucas Lebert 2016-12-6
The comment from Satiskumar is correct. The Code Prover detects runtime errors and the Bug Finder detects bugs in the code. The functionality of the code is not tested. For example Polyspace does not compare the expected output with the real output. If you want to generate test cases, you indeed need the Simulink Design Verifier.

Jay Abraham
Jay Abraham 2017-4-12
You can certainly use the Simulink Design Verifier tool to automatically generate test inputs from your Simulink and Stateflow model. The Simulink Design Verifier tool generates test from test objectives that you can specify or it can automatically generate tests to satisfy coverage objectives for block execution, condition, decision, and MCDC. See this link in the documentation page for more information (you need a MathWorks account to access)
The Polyspace products are static code analysis tools. They analyze and verify C/C++ code to find bugs or to prove that the code is free of critical run-time errors. The Polyspace products do not perform testing activities on the code, however they can find dead code. Dead code would indicate untestable elements in your code. You can learn more about dead code at the link below.

Jay Abraham
Jay Abraham 2017-9-10
The Simulink Test tool is intended to help you perform SIL testing. You can learn more about the product at the links below.

类别

Help CenterFile Exchange 中查找有关 Test Model Components 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by