Unit testing Stateflow charts

4 次查看(过去 30 天)
Garret Fick
Garret Fick 2017-10-18
Hi,
I have a set of Stateflow Atomic Subcharts that we have developed. I would like to develop automated unit tests for these, but I cannot find any examples of how to implement these tests.
Can anyone point me to any examples of testing Stateflow charts?
Thanks

回答(1 个)

Julia Antoniou
Julia Antoniou 2017-10-25
Hi Garret,
There is a tutorial in our documentation that explains how to generate reusable code from an atomic stateflow chart. You can then use this code for unit testing. See the following link for the tutorial: https://www.mathworks.com/help/stateflow/ug/tutorial-generating-reusable-code-for-unit-testing.html
  4 个评论
Abhishek Ballaney
Abhishek Ballaney 2018-1-23
Hi Julia,
In this case, how do we convert a state chart to MATLAB code (.m file)? Please guide.
Garret Fick
Garret Fick 2018-1-23
I found it is possible to use Simulink Test to create tests and that has worked well for us.
The key is to create a Test Sequence, and then use that to send data into your model. If that isn't enough tips, reply and I'll fill in more details.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Syntax for States and Transitions 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by