检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:刘盈盈 杨秋辉[1] 姚邦国 刘巧韵 LIU Yingying;YANG Qiuhui;YAO Bangguo;LIU Qiaoyun(College of Computer Science,Sichuan University,Chengdu 610065,China)
出 处:《计算机科学》2023年第9期101-107,共7页Computer Science
基 金:四川省自然科学基金(23NSFSC3752);四川大学专职博士后研发基金(2022SCU12077)。
摘 要:REST接口中普遍存在依赖关系,导致生成合理的接口调用序列与输入参数变得十分困难。现有的大多数方法只考虑了其中一种依赖关系,并需要人工执行繁杂的前置操作,生成的测试用例有效性仍然较低。针对以上问题,文中提出了一种基于依赖模型的测试用例生成方法。通过解析OpenAPI文档,该方法提取了接口内的操作间依赖关系与参数间依赖关系,并据此建立了两种依赖模型,从模型生成测试用例,最后从3方面确定测试预言。实验结果表明,该方法的输入度量覆盖率达到了100%,状态码类别、状态码、响应资源类型的覆盖率分别达到了100%,91.67%,83.33%,并能在限定时间内检出接口内部缺陷;与RESTler和RESTest相比,该方法的输出度量覆盖率最大提高了36%,触发了最多次的异常响应状态码,检测到接口异常响应的比例最大提高了10%。该方法为REST接口的测试用例生成问题提供了有价值的参考。The prevalence of dependencies in REST API makes it difficult to generate a reasonable sequence of API calls with input parameters.Most existing approaches only consider one of these dependencies and require cumbersome manual preliminaries,thus the generated test cases are still less effective.To address the above problem,a test case generation method based on depen-dency model is proposed.By parsing the OpenAPI documentation,this method extracts the inter-operation dependencies and inter-parameter dependencies,establishes two dependency models,generates test cases from the models,and determines test oracles.Experimental results show that the proposed method achieves 100%input metric coverage,and 100%,91.67%,and 83.33%coverage for status code category,status code,and response resource type,respectively,and can detect internal interface defects within a limited time.Compared with RESTler and RESTest,the proposed method improves the maximum 36%of output metric coverage,triggeres the most number of abnormal response status codes,and detects a maximum of 10%increase in the percentage of abnormal responses.The method provides a valuable reference for the test case generation problem of REST API.
关 键 词:REST接口 测试用例生成 操作间依赖 参数间依赖 BERT模型
分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.227