Performing Integration Testing on Simulink Models

enter image description here

Let's say I have UNITs 1,2,3,4 (either as a model or subsystem reference) for which I have unit tests ready using the matlab.unittest.TestCase platform.

What could be the simplest way to record an integration test for the entire system?

Do I need to somehow set Global_Inputx (x = 1,2,3) and check Global_Outy (y = 1,2) in the easiest way (maybe use unit tests)?

I can use Matlab 14a

PS: I've already gone through but it didn't help .

+3


source to share


1 answer


I think the question of integration testing in Simulink is complex, which can involve formal methods such as code analysis and coverage of the dynamic system under test, automatic test generation, etc. If you haven't already, you can check the Validation, Validation, and Verification "in the MathWorks product line: http://www.mathworks.com/products/?s_tid=gn_ps .

However, to answer your specific question about how you set the global input and inspect the global output in your test:

Depending on where your global inputs that feed the inport blocks (base MATLAB workspace, model workspace, etc) are stored, you might think you can set the external model input to that data. For example:

set_param (, 'ExternalInput',)



This can be defined in your test class setup, test method setup, or test, depending on when the data is available and where the definition is appropriate. Data can also be passed directly to the sim () command. Parameterized testing ( http://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameterized-test.html ) is an opportunity to consider if you want to test the system with different sets of inputs. The external input value becomes a parameter in this context.

If your model is set up to log output, then once the simulation is done, you will receive logged results that you can then compare to a baseline.

Does it help? or I'm from here. If you can add more details, I can try again.

+2


source







All Articles