摘要
众包测试是软件测试领域的一种新兴趋势,具有更加可靠、成本更低和效率更快的优点。但是由于众测工人专业水平不同,提交的测试用例报告缺乏规范性,为报告的审核、缺陷的复现都增加了困难。该文提出了一种通过众测工人的操作记录自动生成文本测试用例的新方法,并实现了该测试工具。首先,对测试工人的操作进行录制从而获取录制信息,录制信息可以划分为三大模块,包含静态页面信息、动态页面信息和交互信息;其次,通过深度优先遍历算法获取组件名称、组件类型、交互动作和交互数据,并按照众测工人的实际操作步骤生成测试序列;对于测试序列中存在组件名称匹配错误的问题,通过YOLOv5目标检测和OCR文字识别技术设计了n元组生成算法,用于生成组件名称与其选项的对应关系,并对匹配错误的组件名称进行自动修改;最后,通过自定义规则集将测试序列转换为文本测试用例。该方法自动生成统一规范的测试用例,降低了众测的门槛,提高了测试效率,并且有利于众测服务平台的质量评估工作。为了验证该方法的有效性,针对不同开发技术的Web系统进行了测试,并与目前最新版本的UFT,Selenium IDE和Katalon Recorder三款工具进行了对比。实验结果表明,该方法生成的测试用例在测试步骤完整性、测试用例信息完整性和时间性能方面具有较好的表现。
Crowdsourcing testing is an emerging trend in the field of software testing,with the advantages of greater reliability,lower cost,and faster efficiency.However,due to the different professional levels and abilities of the crowd testing workers,the submitted test case reports lack standardization,which increases difficulties for report review and defect recurrence.A new method for automatically generating text test cases through the operation records of crowdsourced testing workers has been proposed and the testing tool has been implemented.Firstly,the test worker's actions are recorded to obtain recording information,which can be divided into three modules including static page information,dynamic page information and interactive information.Secondly,the control name,control type,interaction action and interaction data are obtained through the depth-first traversal algorithm,and the test sequence is generated according to the actual operation steps.For the issue of control name matching errors in the test sequence,an n-tuple generation algorithm was designed using YOLOv5 object detection and OCR text recognition technology to generate the corresponding relationship between control names and their options,and to automatically modify control names that match incorrectly.Finally,the test sequence is converted to a text test case through a custom rule set.To verify the effectiveness of the proposed method,Web systems with different development technologies are tested and compared with the latest UFT,Selenium IDE and Katalon Recorder tools.The experimental results show that the test cases generated by the proposed method have good performance in the integrity of test steps and test case information.
作者
张清睿
黄松
孙乐乐
ZHANG Qing-rui;HUANG Song;SUN Le-le(School of Command and Control Engineering,Army Engineering University of PLA,Nanjing 210007,China)
出处
《计算机技术与发展》
2024年第1期83-90,共8页
Computer Technology and Development
基金
国家重点研发计划基金项目(2018YFB1403400)。