基于模型的嵌入式開發流程_如何使用基于模型的測試來改善工作流程

基于模型的嵌入式開發流程

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/

基于模型的嵌入式開發流程

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390199.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390199.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390199.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

166. 分數到小數

166. 分數到小數 給定兩個整數,分別表示分數的分子 numerator 和分母 denominator,以 字符串形式返回小數 。 如果小數部分為循環小數,則將循環的部分括在括號內。 如果存在多個答案,只需返回 任意一個 。 對于所有給定的輸入…

最近用.NET實現DHT爬蟲,全.NET實現

最近用.NET實現DHT爬蟲,全.NET實現,大家可以加我QQ交流下 309159808 轉載于:https://www.cnblogs.com/oshoh/p/9236186.html

C++貪吃蛇

動畫鏈接 GitHub鏈接:https://github.com/yanpeng1314/Snake 1 #include "Snake.h"2 3 int iScore 0;4 int iGrade 1;5 6 //蛇頭蛇尾初始位置7 int x_head 1, y_head 3;8 int x_tail 1, y_tail 1;9 10 //地圖坐標11 int i_Map 1, j_Map 1;12 13 /…

遠程辦公招聘_招聘遠程人才時要尋找的5種技能

遠程辦公招聘Remote work is a fast emerging segment of the labor market. How to embrace this shift as an employer - and find, recruit, and empower remote staff - is a question many companies and hiring managers are grappling with.遠程工作是勞動力市場中快速崛…

10分鐘騰訊云配置免費https

騰訊云免費證書申請地址: https://console.cloud.tencent... 填寫相關信息 域名身份驗證 文件驗證 將fileauth.text 創建在網站訪問根目錄的 .well-known/pki-validation/目錄使得 www.**.com/.well-known/pki-validation/fileauth.text 能夠訪問詳情 等待5分鐘左右…

1588. 所有奇數長度子數組的和

1588. 所有奇數長度子數組的和 給你一個正整數數組 arr ,請你計算所有可能的奇數長度子數組的和。 子數組 定義為原數組中的一個連續子序列。 請你返回 arr 中 所有奇數長度子數組的和 。 示例 1: 輸入:arr [1,4,2,5,3] 輸出&#xff1…

洛谷P3195 [HNOI2008]玩具裝箱TOY(單調隊列優化DP)

題目描述 P教授要去看奧運,但是他舍不下他的玩具,于是他決定把所有的玩具運到北京。他使用自己的壓縮器進行壓縮,其可以將任意物品變成一堆,再放到一種特殊的一維容器中。P教授有編號為1...N的N件玩具,第i件玩具經過壓…

680. 驗證回文字符串 Ⅱ

680. 驗證回文字符串 Ⅱ 給定一個非空字符串 s,最多刪除一個字符。判斷是否能成為回文字符串。 示例 1: 輸入: s “aba” 輸出: true 示例 2: 輸入: s “abca” 輸出: true 解釋: 你可以刪除c字符。 示例 3: 輸入: s “abc” 輸出: false 解題思路 使用…

Android--RxJava2更新體驗

截止日前最新版2017-3-15: RxJava compile ‘io.reactivex:rxjava:1.2.7’ compile ‘io.reactivex:rxandroid:1.2.1’ RxJava2 compile “io.reactivex.rxjava2:rxjava:2.0.7” compile “io.reactivex.rxjava2:rxandroid:2.0.1” 1:create操作改變 Rxjava CompositeSubscri…

kotlin和java語言_Kotlin VS Java – 2020年您應該學習哪種編程語言?

kotlin和java語言It has been several years since Kotlin came out, and it has been doing well. Since it was created specifically to replace Java, Kotlin has naturally been compared with Java in many respects.自Kotlin問世以來已經有好幾年了,而且一切…

oracle部署--安裝oracle軟件與部署單實例數據庫

一、安裝oracle數據庫軟件 1.創建相應的用戶組及用戶 groupadd oinstall groupadd oper groupadd dba useradd -g oinstall -G oper,dba oracle 2.創建oracle software安裝路徑 mkdir -p /u01/app/oracle/product/11.2.0/db_1 3.修改安裝路徑權限 chown -R oracle:oinstall …

web前端【第十一篇】jQuery屬性相關操作

知識點總結 1、屬性 屬性(如果你的選擇器選出了多個對象,那么默認只會返回出第一個屬性)、 attr(屬性名|屬性值) - 一個參數是獲取屬性的值,兩個參數是設置屬性值 - 點擊加載圖片示例 re…

528. 按權重隨機選擇

528. 按權重隨機選擇 給定一個正整數數組 w ,其中 w[i] 代表下標 i 的權重(下標從 0 開始),請寫一個函數 pickIndex ,它可以隨機地獲取下標 i,選取下標 i 的概率與 w[i] 成正比。 例如,對于 w…

sql語句語法多表關聯_SQL創建表語句-帶有示例語法

sql語句語法多表關聯SQL is one of the most reliable and straightforward querying languages around. It provides clear cut syntax that reads easily without abstracting away too much of the functionalitys meaning.SQL是最可靠,最直接的查詢語言之一。 它…

分布式改造劇集三:Ehcache分布式改造

第三集:分布式Ehcache緩存改造 前言 ? 好久沒有寫博客了,大有半途而廢的趨勢。忙不是借口,這個好習慣還是要繼續堅持。前面我承諾的第一期的DIY分布式,是時候上終篇了---DIY分布式緩存。 探索之路 ? 在前面的文章中,…

85. 最大矩形

85. 最大矩形 給定一個僅包含 0 和 1 、大小為 rows x cols 的二維二進制矩陣,找出只包含 1 的最大矩形,并返回其面積。 示例 1: 輸入:matrix [[“1”,“0”,“1”,“0”,“0”],[“1”,“0”,“1”,“1”,“1”],[“1”,“1”…

TP單字母函數

A方法 A方法用于在內部實例化控制器 調用格式:A(‘[項目://][分組/]模塊’,’控制器層名稱’) 最簡單的用法: $User A(User); 表示實例化當前項目的UserAction控制器(這個控制器對應的文件位于Lib/Action/UserAction.class.php)…

Angular問題03 @angular/material版本問題

1 問題描述 應用使用 angular4在使用angular/material時,若果在導入模塊時使用mat開頭,就會報錯。 2 問題原因 angular/material版本出現問題,angular/material 從版本5開始就必須要angular5的核心依賴;想要在angular5之前版本中的…

onclick判斷組件調用_從子組件Onclick更新狀態

onclick判斷組件調用How to update the state of a parent component from a child component is one of the most commonly asked React questions.如何從子組件更新父組件的狀態是最常見的React問題之一。 Imagine youre trying to write a simple recipe box application, …

Python 列表List的定義及操作

# 列表概念:有序的可變的元素集合# 定義 # 直接定義 nums [1,2,3,4,5]# 通過range函數構造,python2 和python3 版本之間的差異; # python3 用的時候才會去構造 nums range(1,101)# 列表嵌套 # 注意和C語言中數組的區別,是否可…