SIMULINK中的大中型系统模型的单元测试和集成测试 [英] Unit-testing and Integration Testing for Large or Medium-Complexity System Models in SIMULINK

查看:765
本文介绍了SIMULINK中的大中型系统模型的单元测试和集成测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的液压气动系统模型,由大约20-25个不同的子系统组成.然后,每个子系统都由数字逻辑,边沿延迟模块以及通往外部输出端口(实际输出)的网关组成.另外,一些小型构件是作为S函数导入的旧式C代码,以最大程度地提高成本效益比.每个子系统模型都是使用基本块集在SIMULINK中设计的,即不使用任何附加的商业块集(例如航空航天,simscape,simMechanics等).

I have a fairly large Hydro-Pneumatic system model composed of roughly 20-25 different subsystems. Each of the subsystem is then composed of digital logic, edge delay blocks, and gateway to external output ports (real-world outputs). Additionally some of the small building blocks are legacy C code imported as S-functions in order to maximise cost-benefit ratio. Each of the subsytem model has been designed in SIMULINK with the use of basic blockset i.e. no add-on commercial blocksets (e.g. aerospace, simscape, simMechanics, etc.) used.

主要问题是我对SIMULINK中的测试模型没有足够的了解.我知道MathWorks提供了一个定制的单元测试框架,用于测试和验证.问题是我不太确定这与我的领域有什么关系.另外,我的子系统本身非常复杂,对每个子系统进行单元测试是一场噩梦.但是,如果只有输入和输出的黑盒测试是唯一的方法,那就可以了,我很乐意接受.

The main issue is that I don't have sufficient knowledge of testing models in SIMULINK. I know that there is a bespoke unit testing framework that Mathworks provides for testing and verification. The trouble is that I am not quite sure how this will be relevant to my domain. Additionally, my subsystems are quite complex themselves and unit testing each of them is a nightmare. BUT if black-box testing with inputs and outputs is the only way, so be it and I am happy to accept that.

尽管我的问题在于在SIMULINK中测试大型和复杂的系统,但我的目的是从经验丰富的SIMULINK用户那里获得建议,这些用户过去曾经这样做过,将来会做很多事情.我之前曾在SIMULINK中进行过单元测试,但所有这些测试甚至都没有接近我的正确设计.

Although my question lies around testing large-scale and complex systems in SIMULINK, my aim is to get suggestions from experienced SIMULINK users who have done it in the past and will be doing it a lot in the future. I have done unit testing in SIMULINK before, but all those tests where not even near the vicinity of my correct design.

任何帮助将不胜感激!!

Any help will be appreciated!!

我在上面忘了提到我对HIL和PIL很熟悉.但是,只有当您的目标实时平台可用于循环测试时,这些参数才有效.如果有人想进行软实时测试该怎么办?

I forgot to mention above that I am familiar with the HIL and PIL. However, those are valid only when you have your target real-time platform available for loop testing. What if someone wants to do a soft real-time testing?

我正等待一两天的时间通过Mathworks大型系统测试网络研讨会.希望我能从中得到一些更好的答案/建议?

I am waiting to go through the Mathworks large-scale system testing Webinar in a day or two. Hopfully, I can get some better answers/suggestions through that?

为了进一步阐明上下文,我们在不使用任何物理设备的情况下在软件中对所有交互系统进行建模,即在软件中对所有系统进行建模和仿真,并在操作员/指导员终端中显示输出....例如我们将电气,空调和液压气动系统配合使用,但是我们已经在软件中对其进行了建模.因此,当我们对其进行仿真时,所有必需的信号都是从软件模型的行为生成的,而实际的硬件/物理设备不参与这些行为输出.

To clarify the context a bit further, we are modelling all the interacting systems in software without involving any physical devices i.e. the modelling and simulation of all the systems in software with the outputs being displayed in operator/instructor terminals..... e.g. we have electrical, air conditioning, and hydro-pneumatic systems working together, but we have modelled them in software. therefore, when we simulate it, all the necessary signals are generated from the behaviour of the software models, no actual hardware/physical device is involved in delivering those behavioural outputs.

推荐答案

我会研究 Simulink Design Verifier Simulink Verification& Validation .具体来说,它们提供了自动测试生成和覆盖率分析等功能,我认为这些功能适用于您的问题.

I would look into Simulink Design Verifier and Simulink Verification&Validation. Specifically, they offer features such as automated test generation and coverage analysis, which I think are applicable to your problem.

作为旁注...

关于matlab 单元测试框架 xUnit 框架的MATLAB实现.因此,如果您希望能够将xUnit设计模式应用于MATLAB代码的测试,则显然很方便.

With regards to the matlab unit-testing framework which you mentioned in your post, this is basically a MATLAB implementation of the xUnit framework. So it obviously comes in handy if you want to be able to apply xUnit design patterns to tests of MATLAB code.

该框架可用于为Simulink模型编写测试,但请记住,您必须能够在MATLAB代码中编写测试.因此,这仅意味着要使用Simulink命令行界面(例如set_paramsim之类的命令)来设置和执行模型,然后使用框架的验证方法(例如verifyEqual)来比较实际的模型和模型.预期结果.

The framework can be used to write tests for a Simulink model, but keep in mind that you have to be able to write the tests in MATLAB code. So this just means making use of the Simulink command-line interface (e.g. commands like set_param and sim) to setup and exercise your model, then use the verification methods of the framework (e.g. verifyEqual) to compare actual and expected results.

这篇关于SIMULINK中的大中型系统模型的单元测试和集成测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆