摘要
接口测试是软件系统测试非常重要的一个方面。某广告接口入参及出参众多,针对该接口进行日常测试时,需要执行的测试用例数量达到指数膨胀状态,且测试用例无法全面覆盖线上流量场景。在软件研发日益敏捷的时代,为了达到快速测试、场景覆盖度高这两大要求,基于unittest、DDT数据驱动测试框架等自动化测试用例组织技术,设计并实现了一套非常实用的接口Diff自动化测试框架。框架支持自动从线上服务器拉取所需的测试请求日志数据,通过在测试、线上两套环境中同时回放请求并收集返回结果,并以优美的Web页面展示测试结果报告。基于该框架的接口Diff自动化测试,能够在非常短的时间内高效完成日常测试,有效缓解了该广告产品因迭代频繁带来的巨大测试压力。
Interface testing is a very important aspect of software system testing.Take an advertising interface as an example,there are many input params and output data,when test the interface daily,the number of test cases to be executed reaches an exponential expansion state,and the test cases can not fully cover the online traffic scenarios.In the era of increasingly agile software development,in order to meet the two requirements of rapid testing and high scene coverage,a very practical interface Diff automatic testing framework is designed and implemented based on the automation test case organizing technologies such as unittest and DDT data-driven testing framework.The framework supports automatically pulling the required test request log data from the online server,playing back the request and collecting the returned results in the test and online environments at the same time,and displaying the test result report in a beautiful web page.The interface Diff automatic test based on this framework can efficiently complete the daily test in a short time,and effectively solve the test pressure caused by frequent iterations of the advertising product.
作者
闫耀珍
YAN Yao-zhen(School of Information,Renmin University of China,Beijing 100872,China)
出处
《电脑知识与技术》
2021年第22期58-61,共4页
Computer Knowledge and Technology