필터 지우기
필터 지우기

Unit Testing Stateflow Models

조회 수: 1 (최근 30일)
Richard Good
Richard Good 2021년 3월 11일
댓글: Richard Good 2021년 3월 11일
Hello Mathworks Community,
I have looked at a similar post on unit testing in Stateflow, but the links didn't really help, maybe I'm using the wrong terms. I want to run a series of tests on a Stateflow model everytime we change it (regression tests) These tests involved introducing data into the charts. I want a sort of automated debugging session I guess. The idea would be to have all this kicked off by a simulink report and to run the various tests and create plots and output a test report. The model has been imported from another tool, so the practice of injecting data into the chart at various times automatically needs to be maintained. I can figure out how to do this manuall, but can't find an example of doing this using a script. Any wise words/ recommendations? Note I cannot use the Test toolbox as that is not available on the clients system.
Cheers
Richard

답변 (1개)

Steven Lord
Steven Lord 2021년 3월 11일
If you know how to programmatically interface with the charts and how to execute them but cannot use the Simulink Test product, try using the testing framework included as part of MATLAB.
  댓글 수: 1
Richard Good
Richard Good 2021년 3월 11일
Hi Steve
Thanks for your reply. I do know about the Stateflow API and I did have a look at the executing Standalone Charts article. The model I am looking at has several subsystems and lots of data going between them, I do not believe I can use this feature because of the limitations of Standalone charts. I think the Operating Points feature is the closest thing to what I want. Apologies, I mean regression tests not unit tests really. The legacy system created an executable model where you could inject chart data at the start and at various times during the simulation. I want to migrate the tests as directly as possible to verify I have migrated the model into Stateflow correctly. The legacy software is called Statemate if that helps.
Cheers for any pointers
Richard

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Inputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by