Unit testing Stateflow charts
古いコメントを表示
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
2017 年 10 月 25 日
0 投票
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 件のコメント
Garret Fick
2017 年 10 月 26 日
Julia Antoniou
2017 年 10 月 27 日
Hi Garret,
Yes, I see what you mean now. I am not sure we have an example specific to doing unit testing in MATLAB for Stateflow. However, I was able to find this documentation section on testing frameworks within the MATLAB environment. Using these frameworks, you could develop unit tests for your stateflow chart.
https://www.mathworks.com/help/matlab/matlab-unit-test-framework.html
The doc link below would be a good reference for how to programmatically interact with your stateflow chart:
https://www.mathworks.com/help/stateflow/programmatic-manipulation.html
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
2018 年 1 月 23 日
カテゴリ
ヘルプ センター および File Exchange で Stateflow についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!