基于模型的嵌入式开发流程

Unit testing is not enough – so let's start using model-based testing to improve our workflows.

单元测试还不够–因此,让我们开始使用基于模型的测试来改善我们的工作流程。

Software testing is an important phase in building a scalable software system that usually has critical functions, business flows/logic, and connected external entities. This distributed nature of software systems induces a certain level of complexity when writing tests for each unit, function, or flow.

软件测试是构建可伸缩软件系统的重要阶段,该系统通常具有关键功能,业务流程/逻辑以及连接的外部实体。 在为每个单元,功能或流程编写测试时,软件系统的这种分布式性质会引起一定程度的复杂性。

There are various types of testing approaches you can use. The best approach you can employ seamlessly is model-based testing. In simple terms, this means creating a model of your system (more like a digital twin that describes every aspect of the system) and generating a test against the model.

您可以使用多种测试方法。 您可以无缝采用的最佳方法是基于模型的测试。 简单来说,这意味着创建系统模型(更像是描述系统各个方面的数字孪生模型)并针对该模型生成测试。

什么是基于模型的测试? (What Is Model-Based Testing?)

First, we need to know that a model is basically the description and representation of how we expect the system to work. The system’s processes can be defined based on the series of input sequences, actions, functions, output, and flow of data starting from input to the output received.

首先,我们需要知道模型基本上是我们期望系统工作方式的描述和表示。 可以基于一系列输入序列,操作,功能,输出以及从输入到接收到的输出的数据流来定义系统的过程。

We must be able to determine all these behaviors while testing, and a model helps us do just that seamlessly. With that, we can then generate tests automatically based on the system models.

我们必须能够在测试时确定所有这些行为,并且模型可以帮助我们无缝地做到这一点。 这样,我们便可以基于系统模型自动生成测试。

Basically, model-based testing is a software testing technique in which the test cases are generated from a model that describes the functional aspects of the system under test. This is a new software testing method that employs a secondary, lightweight, time-efficient implementation of a software build which is called a model.

基本上,基于模型的测试是一种软件测试技术,其中从描述了被测系统功能方面的模型生成测试用例。 这是一种新的软件测试方法,该方法采用称为模型的软件构建的次要,轻量级,省时的实现。

We take this model coupled with the system requirements and generate efficient test cases. This software testing method is applicable to both hardware and software testing.

我们将此模型与系统需求结合起来,并生成有效的测试用例。 此软件测试方法适用于硬件和软件测试。

为什么以及如何改善工作流程 (Why and How It Improves Workflow)

Automating tests is unavoidable as it enables faster and more efficient software testing. You can streamline your workflow and use the latest development methodologies to improve it.

自动化测试是不可避免的,因为它可以实现更快,更有效的软件测试。 您可以简化工作流程并使用最新的开发方法进行改进。

Most software developers and teams find it challenging to create and update test cases in an environment of constantly changing dependencies and requirements.

大多数软件开发人员和团队都发现,在依赖和要求不断变化的环境中创建和更新测试用例具有挑战性。

From employing the simplest functional tests to heavyweight methods like E2E and so many others, there have been numerous testing methods designed for improving testing reliability and effectiveness.

从使用最简单的功能测试,以重量级的方法,如E2E和许多其他人 ,已经有不少测试方法专为提高测试的可靠性和有效性。

There’s absolutely nothing wrong with these methods. However, these test cases have to be written manually for each scenario. Whenever there’s a change in the system requirements, you have to update each test case affected by the change.

这些方法绝对没有错。 但是,必须针对每种情况手动编写这些测试用例。 只要系统要求发生变化,就必须更新受更改影响的每个测试用例。

Below, you’ll find a graphical exemplification of the model-based testing process:

在下面,您将找到基于模型的测试过程的图形示例:

These models are used to generate automated test cases using MBT tools as they describe the expected behaviour of the system being tested.

这些模型用于使用MBT工具生成自动化测试用例,因为它们描述了被测系统的预期行为。

We basically have two steps here:

我们基本上有两个步骤:

  1. Creating models to describe the behavior and processes of the system.创建模型来描述系统的行为和过程。
  2. Using MBT tools like Spec Explorer, Graphwalker, fMBT or Modbat, to interpret the models and generate test scripts for automated testing.使用诸如Spec Explorer,Graphwalker,fMBT或Modbat之类的MBT工具来解释模型并生成用于自动测试的测试脚本。

When working with model-based testing, the model creation phase should be part of the software development life cycle and integrated as part of product design from the phase of requirements specification.

在进行基于模型的测试时,模型创建阶段应成为软件开发生命周期的一部分,并应从需求规范阶段集成为产品设计的一部分。

This allows the software development team to focus their attention on building a testable product and models that enhance user experience.Model-based testing can improve our workflow by:

这使软件开发团队可以将精力集中在构建可测试的产品和可增强用户体验的模型上。基于模型的测试可以通过以下方式改善我们的工作流程:

  1. Reducing the time spent on writing tests and allowing developers to focus on writing models to cover system requirements only and build a testable application from the onset.减少花费在编写测试上的时间,并允许开发人员专注于编写仅满足系统需求的模型,并从一开始就构建可测试的应用程序。
  2. Reducing test suite maintenance and generating more tests.减少测试套件维护并生成更多测试。
  3. Helping the team create automated scripts and increasing test coverage when used with testing tools and automation frameworks.与测试工具和自动化框架一起使用时,帮助团队创建自动化脚本并增加测试覆盖率。

如何实施基于模型的测试 (How to Implement Model-Based Testing)

Implementing model-based testing can’t be introduced suddenly to a system, as it has to be done gradually. It will be too much to introduce it to the entire system’s processes and operations.

基于模型的测试的实现不能突然引入系统,因为它必须逐步完成。 将其引入整个系统的流程和操作将是太多了。

It’s best fitted for the initial stage of the product, as things are still very minute. It's easy to integrate with the system requirements then, because as things get bigger you get to update just the model.

因为事情仍然很微小,所以它最适合产品的初始阶段。 这样就很容易与系统需求集成,因为随着事情的发展,您只需要更新模型即可。

To implement model-based testing you have to start with creating the models. Models can can cover any level of requirements, from business logic to user story, and can be connected to each other.

要实施基于模型的测试,您必须先创建模型。 模型可以涵盖从业务逻辑到用户故事的任何级别的需求,并且可以彼此连接。

Then you can automatically generate test cases based on the models once they are done creating it. And of course, if you make any changes to the models, the tests will be updated automatically.

然后,一旦完成创建模型,您便可以基于模型自动生成测试用例。 当然,如果您对模型进行了任何更改,测试将自动更新。

You can easily integrate these tests into your CI processes and tools once you’re able to generate automated tests from models.

一旦能够从模型生成自动化测试,就可以轻松地将这些测试集成到CI流程和工具中。

基于模型的测试的优势
(Advantages of Model-Based Testing)

  1. Optimizes the software testing time and cost优化软件测试时间和成本
  2. You can generate test scripts for each scenario with just a push of a button.您只需按一下按钮,就可以为每种情况生成测试脚本。
  3. This ensures the software testing team can communicate expected system behavior.这样可以确保软件测试团队可以传达预期的系统行为。
  4. Enables early detection of requirement irregularities.能够及早发现需求违规情况。
  5. Automated test case generation and execution make the overall testing solution more efficient and less error-prone.自动化的测试用例生成和执行使整个测试解决方案更加有效,并且不易出错。
  6. It helps generate a minimal number of test cases to validate a given functional or data flow to ensure that the system under test works flawlessly and never does anything undesirable.它有助于生成最少数量的测试用例,以验证给定的功能或数据流,以确保被测系统能够完美地工作,并且绝不会做任何不希望的事情。
  7. Project maintenance is minute.项目维护非常简单。

基于模型的测试的缺点
(Disadvantages of Model-Based Testing)

  1. Demands a high amount of investment as well as effort.需要大量的投资和精力。
  2. Requires skilled and disciplined software tester.需要熟练且训练有素的软件测试人员。
  3. The first test case takes longer to generate as it requires more advance work than traditional manual testing.与传统的手动测试相比,第一个测试用例的生成时间更长,因为它需要更多的工作。
  4. The learning curve of model-based testing is pretty steep and its complexity makes it harder to understand for beginners.基于模型的测试的学习曲线非常陡峭,其复杂性使初学者很难理解。

与UI测试有何不同 (How it's Different from UI Testing)

Basically we know what model-based testing is now, and we already figured out the benefits of using it over using the traditional testing method.

基本上,我们知道现在基于模型的测试是什么,并且我们已经弄清楚了使用它比使用传统测试方法的好处。

UI (User Interface/Frontend Testing) is a type of software testing that simply involves the process of testing the function of the user interface, making sure the interface of the system is reacting as it’s supposed to.

UI(用户界面/前端测试)是一种软件测试 ,仅涉及测试用户界面功能的过程,以确保系统界面能够按预期进行响应。

This process involves manual testing, and each test scenario has to be written by hand. Any changes made to the UI will break the whole test case unless it's updated along with the changes. It employs the use of WebDrivers and most times Selenium in order to fully simulate the way users interact with the interface and validate the expected output.

此过程涉及手动测试,并且每个测试方案都必须手动编写。 对UI所做的任何更改都会破坏整个测试用例,除非它与更改一起更新。 它充分利用了WebDrivers和大多数Selenium的用法,以完全模拟用户与界面的交互方式并验证预期的输出。

UI testing can be employed in any stage of the product as it clearly doesn’t have much requirement and the learning curve is very easy compared to MBT.

UI测试可以用于产品的任何阶段,因为它显然不需要太多,并且与MBT相比,学习曲线非常容易。

The cost of testing is quite low and could be ground down to zero. The time spent can also be little. Maintenance can be very high depending on the complexity of the product interface.

测试成本非常低,可以降低到零。 花费的时间也可以很少。 维护可能非常高,具体取决于产品界面的复杂性。

It doesn’t require a very skillful developer or software. Any developer with basic testing knowledge can pick this up. There are so many differences when you look into this more, however, both are good for different use cases.

它不需要非常熟练的开发人员或软件。 任何具有基本测试知识的开发人员都可以掌握。 当您对此进行更多研究时,有很多差异,但是,两者都适用于不同的用例。

结论 (Conclusion)

Model-based testing is a powerful, cost-efficient, and profitable technique for large businesses in the long run.

从长远来看,基于模型的测试对于大型企业而言是一种强大,经济高效且有利可图的技术。

However, introducing this approach to large company processes can be a big challenge, especially when it involves overhauling their entire approach to software development and testing.

但是,将这种方法引入大型公司的流程可能是一个巨大的挑战,尤其是当涉及对软件开发和测试的整个方法进行全面检查时。

Model-based testing has to become a part of the development workflow, but this comes with its own challenges, including changes to the entire infrastructure. It also makes an already steep learning curve even more challenging.

基于模型的测试必须成为开发工作流程的一部分,但这带来了自身的挑战,包括更改整个基础架构。 这也使本已陡峭的学习曲线更具挑战性。

Luckily, there are some things that can help identify when model-based testing can really be useful. For example, if you have an infinite set of systems with requirements you can cover in different ways. Or if you have a distributed or reactive system, that can also be a reason to consider this approach.

幸运的是,有些事情可以帮助您确定何时基于模型的测试真正有用。 例如,如果您有无限多个具有要求的系统,则可以用不同的方式进行介绍。 或者,如果您有分布式或React性系统,那也可能是考虑使用此方法的原因。

Model-based testing can go a long way in testing and save significant time and effort when implemented properly.

基于模型的测试可以在测试中走很长一段路,如果正确实施,可以节省大量时间和精力。

翻译自: https://www.freecodecamp.org/news/improve-your-workflow-using-model-based-testing/

基于模型的嵌入式开发流程

基于模型的嵌入式开发流程_如何使用基于模型的测试来改善工作流程相关推荐

  1. io vivado 怎么查看ps_基于Vivado的嵌入式开发 ——PS+PL实践

    基于Vivado的嵌入式开发 --PS走起 硬件平台:ZedBoard 开发工具:Vivado 2014.2 1.规划 废话不多说,依然是流水灯,这次是采用PS+PL实现. 功能依旧简单,目标是为了学 ...

  2. 基于ubuntu的嵌入式开发环境

    基于ubuntu的嵌入式开发环境 1.更新系统源 2.安装嵌入式开发环境(安装嵌入式开发所需工具) 3.安装OPENCV(可选) 4.更新VIM配置 5.虚拟终端路径太长的问题 6.安装nfs和tft ...

  3. javascript控制台_如何使用JavaScript控制台改善工作流程

    javascript控制台 by Riccardo Canella 里卡多·卡内拉(Riccardo Canella) 如何使用JavaScript控制台改善工作流程 (How you can imp ...

  4. python嵌入式开发实战_嵌入式Qt实战教程 PDF 高清版

    给大家带来的一篇关于嵌入式相关的电子书资源,介绍了关于嵌入式.Qt实战方面的内容,本书是由电子工业出版社出版,格式为PDF,资源大小43.4 MB,陈志发,王苑增编写,目前豆瓣.亚马逊.当当.京东等电 ...

  5. 嵌入式开发:嵌入式软件的未来—基于平台的开发

    在项目启动后不久,工程师们不得不再次编写微控制器驱动程序,试图集成实时操作系统 (RTOS) 和第三方组件,从而深入研究细节.这些重复的项目任务会消耗时间.精力并抑制产品创新.一个有趣的解决方案开始出 ...

  6. php 积分商城_积分商城 - 基于ThinkPHP和FastAdmin开发的积分商城系统 – 基于ThinkPHP和Bootstrap的极速后台开发框架...

    ----------version 1.1.4 版本更新内容 2019-11-05--------------- 1.适配移动端. -----------version 1.1.3 版本更新内容--- ...

  7. illustrator下载_平面设计:16个Illustrator快捷方式可加快工作流程

    illustrator下载 I know, I know - keyboard shortcuts sound so nerdy, and you're a graphic designer, not ...

  8. python测试开发课程_小蜗分享:Python测试开发全套学习路线

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 第一阶段:专业基础课程 阶段目标: 1. 熟练掌握IT核心技术:编程,数据库,操作系统,版本控制 2. 能够熟练运用所学技术搭建各类服务器环境 3. 深入 ...

  9. 模型部署到移动端_分分钟打开倾斜摄影模型,新版本的老子云移动端也太好用了吧!...

    距离上次老子云web端更新已经过去一个月了 在这一期间老子云开发团队又在做什么呢? 没错,就是在筹备移动端更新ing 经过多次方案讨论与需求修改 2020年最后一个月 老子云移动端3.1版本更新啦 本 ...

最新文章

  1. NBT-2019-华大发布全球最大人体肠道细菌基因组集研究成果
  2. 【NIO】IO多路复用
  3. 常用的Meta标签写法和作用
  4. 微服务限流Sentinel讲解(四)
  5. STL 之find,find_if,find_end,find_first_of
  6. Python批量检查网页是否被注入其他页面
  7. VS2012如何显示行号
  8. 0 full gc时cpu idle_结合GC日志讲讲CMS垃圾收集器
  9. Linux命令解释之du
  10. 为什么黑客都用python-python为什么会作为黑客的首选语言?这几本书给你答案(已集齐)...
  11. 通过组策略集中管理管理用户桌面和开始菜单
  12. MySQL用C访问的示例代码
  13. mac 电脑安装 svn和brew
  14. Web项目部署到阿里云
  15. 慕课版软件质量保证与测试(第五章.课后作业)
  16. matlab qua2d,matlab 几个关于GPS/INS和GPS/AHRS的程序 - 下载 - 搜珍网
  17. 离散元后处理,将PFC数据写出并导入到matlab中形成云图
  18. Flare动画进阶——创建可互动的一拳超人动画
  19. 题目:输入一个整数a,其个位为第一位,十位为第二位,依次类推,计算a的偶数位的和奇数位的和。
  20. intel服务器最新主板芯片组,拒绝阴霾 主板芯片组如何承载时代经典

热门文章

  1. System V IPC之共享内存
  2. windows环境下C语言socket编程
  3. 透彻解析!字节跳动Android实习面试凉凉经,年薪超过80万!
  4. 14.vue路由脚手架
  5. 【黑客免杀攻防】读书笔记14 - 面向对象逆向-虚函数、MFC逆向
  6. GeoServer自动发布地图服务
  7. 【LeetCode】19. Remove Nth Node From End of List
  8. MySQL Workbench导出数据库
  9. day09_读写分离_Atlas小记
  10. Python pyenv