通過人工智能和機器學習實現完全自動化的5種方法

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在人工智能和機器學習領域,測試自動化已經取得了長足的進步。通過引入智能測試自動化工具,可以解決傳統測試自動化的難點,從而獲得最佳結果。下面分享5種通過人工智能和機器學習實現完全自動化的方法,這些方法能夠幫助項目團隊減少測試工作量,提高測試覆蓋率。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"1.測試自動化的自修復"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/ef\/db\/ef23541c3d61e7a02a300a1d7b2108db.jpeg","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"測試自動化中的自修復技術解決了測試腳本維護的主要問題,即自動測試腳本在對象屬性(包括名稱、ID、CSS 等)的每個變更階段都會中斷。測試自動化中的自修復技術在實現過程中使用了動態定位策略,程序可以自動檢測到這些變更,並動態地修正它們,無需人工干預。團隊可以利用敏捷測試方法中的左移方法,使得過程更加高效,提高工作效率,加速交付。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"舉個例子,當開發者對 HTML 頁面中的對象標識符進行任何更改時,測試用例中的 UI 標識符將自動更改。雖然屬性改變了,但人工智能引擎仍然定位這些元素,並根據在源代碼中的更改來修改它們。這一自修復技術使開發者不必花費大量時間來識別變更,同時更新 UI。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"2.測試腳本的自動生成"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/5f\/58\/5fb9ee0197a56d42d2514b2ce33c5d58.jpeg","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自動化測試腳本的開發是一項複雜的工作,需要用到 Java、Python、Ruby 等高技能的編程語言。同時還需要做大量的初始工作,並投入一定的時間和資源。使用自動化腳本進行開發可將測試腳本的生成時間減少 50%。另外,在測試腳本設計過程中加入人工智能和機器學習技術,也能大大簡化其設計流程。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"目前市面上有各種各樣的測試工具,比如通過手動測試用例構建的 selenium 自動化測試腳本,它可以讀取測試腳本,並自動生成自動化腳本。該人工智能算法使用自然語言處理,能夠理解用戶的意圖,並在 Web 應用中模擬這些行爲。它的優點是可以減少 80% 的測試腳本設計和經歷。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"3.大量測試數據的有效使用"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"很多使用敏捷和 DevOps 方法執行持續測試的組織都選擇了一種嚴格的測試方法,並在整個軟件開發生命週期中每天進行數次使用,其中包括單元、API、功能、可訪問性、集成和其他類型的測試。在執行這些測試用例時,系統將創建大量的測試數據。庫存的數據越多,管理人員就越難做出更準確的決定。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"通過可視化最不穩定的測試用例和其他需要重點關注的部分,機器學習可以幫助開發者更容易地識別關鍵的問題區域。此外,通過人工智能和機器學習系統的參與,還可以輕鬆地對測試數據進行切片、分塊和分析,並能夠讀取模式、量化業務風險和加快手頭項目的總體決策過程。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"具體來說,在人工智能和機器學習的幫助下,分析人員可以獲得以下更好的特性:"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"測試影響分析"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"安全漏洞"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"平臺特有缺陷"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"測試環境不穩定"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"測試失敗的重複模式"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"應用元素定位器的脆性"}]}]}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"4.利用自動視覺驗證工具對圖像進行測試"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當前,在基於圖像的測試領域中,自動視覺驗證工具得到了越來越多的應用。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"軟件開發中的視覺測試(也叫 UI 測試)可以確保開發者構建的 Web 或移動應用的 UI 呈現給最終用戶,這些工具旨在通過更新 UI 來幫助開發者實現應用的功能。不過當前,大多數正在進行的測試通常難以實現自動化,而是採用人工測試的方式。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"人工測試很容易導致一些元素被忽略,要想準確識別這些元素,測試人員可以利用基於機器學習的視覺驗證工具。這是一種基於圖像的測試注入,它動態地改變了公司在任何系統中提供自動測試服務的方式。測試分析人員可以創建自動檢測軟件中所有視覺錯誤的機器學習測試,這樣做有助於驗證應用的視覺正確性,而無需測試專家將輸入隱性地插入到系統中。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"5.人工智能搜索"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當前,開發者使用的基於人工智能的最新自動化技術是使用 spidering 方法爲應用自動編寫測試。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"開發者需要爲自己的 Web 應用提供一些新的人工智能 \/ 機器學習工具,以便啓動抓取。在抓取的過程中,該工具通過截圖收集數據,爲每個頁面下載 HTML 代碼,測量複雜,並不斷重複運行這些步驟。最後,這一工具會創建一個數據集,並訓練機器學習模型,從而理解應用程序的預期模式和行爲。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"此外,該工具還將其當前階段與之前觀察到的所有模式進行比較。如果有偏差,工具將把這部分標記爲測試期間可能出現的 Bug。下一步,開發者需要確認被標記的問題是否確實是 Bug。也就是說,機器學習工具負責 Bug 的檢測過程,但是開發者在接受調用之前必須進行最後的確認。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"結論"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"要想在測試中充分利用人工智能和機器學習技術,需要開發者具備一定的機器學習測試算法基礎,並且要有戰略上的測試方法。同時,還需要擁有一支測試團隊,團隊需要知道如何將複雜的數據結構分解成能夠幫助開發者加強決策過程,並提高總體項目效率和收益的簡化表示。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"作者介紹:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Mohit Shah,供職於 ImpactQA,高級技術內容營銷人員。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文鏈接:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https:\/\/dzone.com\/articles\/5-great-ways-to-achieve-complete-automation-with-a"}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章