CN108763074A - A kind of method and device of SDK tests - Google Patents
A kind of method and device of SDK tests Download PDFInfo
- Publication number
- CN108763074A CN108763074A CN201810487677.0A CN201810487677A CN108763074A CN 108763074 A CN108763074 A CN 108763074A CN 201810487677 A CN201810487677 A CN 201810487677A CN 108763074 A CN108763074 A CN 108763074A
- Authority
- CN
- China
- Prior art keywords
- test
- data
- app
- sdk
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3696—Methods or tools to render software testable
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/126—Applying verification of the received information the source of the received data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本发明公开了android系统领域的一种SDK测试的方法及装置,包括:用户触发APP驱动客户端执行任务,然后将客户端输出的请求数据进行截取;针对截取的请求数据建立测试包,并为测试项目自动创建合适的构建文件、配置文件和目录结构,在测试包与需要测试的应用程序间设置链接;确定测试包内的数据是否与应用程序接收的是否相同,若相同则APP客户端下发的数据包通过验证测试,本发明将APP客户端与计算机系统之间建立连接,通过对客户端的输出请求数据进行截取并建立测试包,通过测试包内的数据集与系统结构的数据包进行对比,从而检测数SDK数据的准确性,该方法简便快捷,检测效率高,且测试结果准确。
The invention discloses a method and device for SDK testing in the field of android system, including: a user triggers an APP to drive a client to execute a task, and then intercepts the request data output by the client; establishes a test package for the intercepted request data, and provides The test project automatically creates appropriate build files, configuration files, and directory structures, and sets links between the test package and the application to be tested; determines whether the data in the test package is the same as that received by the application, and if they are the same, the APP client downloads The sent data packet passes the verification test. The present invention establishes a connection between the APP client and the computer system, intercepts the output request data of the client and establishes a test packet, and conducts a test through the data set in the test packet and the data packet of the system structure. To test the accuracy of the SDK data, the method is simple and fast, with high detection efficiency and accurate test results.
Description
技术领域technical field
本发明公开了一种SDK测试的方法及装置,具体为android系统领域。The invention discloses a method and device for SDK testing, specifically in the field of android systems.
背景技术Background technique
SDK即软件工具开发包,提供一套有一定结构和逻辑的对外接口,封装对内的业务逻辑,调用者按照说明文档使用相应的对外接口可实现预期的功能,简化了软件的开发流程,在一定程度上保证了软件的质量。其中,数据采集SDK内嵌在应用程序的代码库中,当用户触发APP时,SDK会记录并采集用户触发APP的用户行为数据,并将采集到的用户行为数据发送到服务器中。随着SDK在软件开发领域的不断普及,SDK发送用户行为数据的准确性也越来越重要,即测试SDK发送数据的准确性,从而确保软件的开发质量。The SDK is a software tool development kit, which provides a set of external interfaces with a certain structure and logic, and encapsulates the internal business logic. The caller can use the corresponding external interface according to the documentation to achieve the expected functions, which simplifies the software development process. To a certain extent, the quality of the software is guaranteed. Among them, the data collection SDK is embedded in the code library of the application program. When the user triggers the APP, the SDK will record and collect the user behavior data of the user triggering the APP, and send the collected user behavior data to the server. With the continuous popularization of SDK in the field of software development, the accuracy of user behavior data sent by SDK is becoming more and more important, that is, to test the accuracy of data sent by SDK to ensure the quality of software development.
目前,SDK测试主要包括两方面,一方面是手工或者自动在APP中执行用户界面操作,例如,打开视频、暂停视频等等,第二方面是验证SDK向服务器发送的UI操作对应的数据是否发送以及发送的数据是否准确,例如,UI中执行打开视频时,发送的数据是否为加载数据,视频的加载状态是否为加载中等等。At present, SDK testing mainly includes two aspects. One is to manually or automatically perform user interface operations in the APP, such as opening a video, pausing a video, etc. The second is to verify whether the data corresponding to the UI operation sent by the SDK to the server is sent. And whether the data sent is accurate, for example, when the video is opened in the UI, whether the data sent is loading data, whether the loading status of the video is loading, etc.
在执行上述第二方面验证SDK向服务器发送的UI操作对应的数据是否准确时,通常会在网关处设置随机抓取数据包的代理程序,并人工验证抓取的数据包中的数据的准确性,该种SDK验证方式的效率较为低下。同时,手机在安装某一软件时,从手机上非法获取其他信息,比如访问手机联系人、定位手机、访问手机识别码等,极大的降低了手机的安全性能。为此,我们提出了一种SDK测试的方法及装置投入使用,以解决上述问题。When performing the above second aspect to verify whether the data corresponding to the UI operation sent by the SDK to the server is accurate, an agent program that randomly grabs data packets is usually set at the gateway, and manually verifies the accuracy of the data in the captured data packets , the efficiency of this SDK verification method is relatively low. At the same time, when a certain software is installed on the mobile phone, other information is illegally obtained from the mobile phone, such as accessing mobile phone contacts, locating the mobile phone, accessing the mobile phone identification code, etc., which greatly reduces the security performance of the mobile phone. To this end, we put forward a method and device for SDK testing to solve the above problems.
发明内容Contents of the invention
本发明的目的在于提供一种SDK测试的方法及装置,以解决上述背景技术中提出的问题。The purpose of the present invention is to provide a method and device for SDK testing, so as to solve the problems raised in the above-mentioned background technology.
为实现上述目的,本发明提供如下技术方案:一种SDK测试的方法,包括:In order to achieve the above object, the present invention provides the following technical solutions: a method for SDK testing, comprising:
用户触发APP驱动客户端执行任务,然后将客户端输出的请求数据进行截取;The user triggers the APP to drive the client to perform tasks, and then intercepts the request data output by the client;
针对截取的请求数据建立测试包,并为测试项目自动创建合适的构建文件、配置文件和目录结构,在测试包与需要测试的应用程序间设置链接;Create a test package for the intercepted request data, and automatically create appropriate build files, configuration files and directory structures for the test project, and set up a link between the test package and the application to be tested;
确定测试包内的数据是否与应用程序接收的是否相同,若相同则APP客户端下发的数据包通过验证测试。Determine whether the data in the test packet is the same as that received by the application program. If they are the same, the data packet sent by the APP client passes the verification test.
优选的,所述用户触发APP时,通过广播实现,根据action name完成对行为类型的分类,并根据caseid完成对行为的区分。Preferably, when the user triggers the APP, it is realized by broadcasting, and the classification of the behavior type is completed according to the action name, and the classification of the behavior is completed according to the caseid.
优选的,所述的对请求数据进行截取时,具体的,用户使用adb命令与APP进行数据上的通信,如发送广播、启动Activity,同时使用shell命令对配置文件进行修改,再进行gradle编译,实现对APP级别参数的修改;将传输的字符串化为API调用。Preferably, when the request data is intercepted, specifically, the user uses the adb command to communicate with the APP on the data, such as sending a broadcast, starting the Activity, and at the same time using the shell command to modify the configuration file, and then compile the gradle, Realize the modification of APP level parameters; convert the transmitted string into API calls.
优选的,所述测试包在进行测试时,采用Application测试应用程序对象的setup和teardown,并保留对象信息的全局状态。Preferably, when testing, the test package uses Application to test setup and teardown of the application object, and preserves the global state of the object information.
优选的,一种SDK测试的装置,包括数据采集模块、数据截取模块、测试包建立模块以及测试解析模块;Preferably, a device for SDK testing includes a data acquisition module, a data interception module, a test package establishment module and a test analysis module;
所述数据采集模块用于采集用户触发APP执行指令,并抓取数据包,随后传递至所述数据截取模块中;The data collection module is used to collect the user's trigger APP execution instruction, and capture the data packet, and then deliver it to the data interception module;
所述数据截取模块通过使用adb命令与APP进行数据上的通信,利用shell命令对配置文件进行修改,再进行gradle编译,实现对APP级别参数的修改,随后将传输的字符串化为API供所述测试包建立模块实时调用;The data interception module uses the adb command to communicate with the APP on the data, uses the shell command to modify the configuration file, and then compiles the gradle to realize the modification of the APP level parameters, and then converts the transmitted string into an API for all The above test package building module is called in real time;
所述测试包建立模块为测试项目自动创建合适的构建文件、配置文件和目录结构,在测试包与需要测试的应用程序间设置链接;The test package building module automatically creates suitable construction files, configuration files and directory structure for the test project, and links are set between the test package and the application program that needs to be tested;
所述测试解析模块确定测试包内的数据是否与应用程序接收的是否相同,若相同则APP客户端下发的数据包通过验证测试。The test parsing module determines whether the data in the test packet is the same as that received by the application program, and if they are the same, the data packet delivered by the APP client passes the verification test.
与现有技术相比,本发明的有益效果是:本发明将APP客户端与计算机系统之间建立连接,通过对客户端的输出请求数据进行截取并建立测试包,通过测试包内的数据集与系统结构的数据包进行对比,从而检测数SDK数据的准确性,能够避免在软件安装时访问手机联系人、定位手机、访问手机识别码等,提高手机的安全性,该方法简便快捷,检测效率高,且测试结果准确。Compared with the prior art, the beneficial effects of the present invention are: the present invention establishes the connection between the APP client and the computer system, intercepts the output request data of the client and establishes a test package, and combines the data set in the test package with the computer system. The data packets of the system structure are compared to detect the accuracy of the SDK data, which can avoid accessing the mobile phone contacts, locating the mobile phone, accessing the mobile phone identification code, etc. during software installation, and improve the security of the mobile phone. This method is simple and fast, and the detection efficiency High, and the test results are accurate.
附图说明Description of drawings
图1为本发明运行流程图;Fig. 1 is the operation flowchart of the present invention;
图2为本发明系统原理框图。Fig. 2 is a functional block diagram of the system of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
请参阅图1-2,本发明提供一种技术方案:一种SDK测试的方法,包括:Please refer to Figure 1-2, the present invention provides a technical solution: a method for SDK testing, including:
用户触发APP驱动客户端执行任务,然后将客户端输出的请求数据进行截取;The user triggers the APP to drive the client to perform tasks, and then intercepts the request data output by the client;
针对截取的请求数据建立测试包,并为测试项目自动创建合适的构建文件、配置文件和目录结构,在测试包与需要测试的应用程序间设置链接;Create a test package for the intercepted request data, and automatically create appropriate build files, configuration files and directory structures for the test project, and set up a link between the test package and the application to be tested;
确定测试包内的数据是否与应用程序接收的是否相同,若相同则APP客户端下发的数据包通过验证测试。Determine whether the data in the test packet is the same as that received by the application program. If they are the same, the data packet sent by the APP client passes the verification test.
所述用户触发APP时,通过广播实现,根据action name完成对行为类型的分类,并根据caseid完成对行为的区分,所述的对请求数据进行截取时,具体的,用户使用adb命令与APP进行数据上的通信,如发送广播、启动Activity,同时使用shell命令对配置文件进行修改,再进行gradle编译,实现对APP级别参数的修改;将传输的字符串化为API调用,所述测试包在进行测试时,采用Application测试应用程序对象的setup和teardown,并保留对象信息的全局状态。When the user triggers the APP, it is realized by broadcasting, and the classification of the behavior type is completed according to the action name, and the behavior is distinguished according to the caseid. When the above-mentioned request data is intercepted, specifically, the user uses the adb command to communicate with the APP. Communication on the data, such as sending broadcasts, starting the Activity, modifying the configuration file by using the shell command at the same time, and then compiling the gradle to realize the modification of the APP level parameters; converting the transmitted string into an API call, and the test package is in the When testing, use Application to test the setup and teardown of the application object, and keep the global state of the object information.
本发明还提供了一种SDK测试的装置,包括数据采集模块、数据截取模块、测试包建立模块以及测试解析模块;The present invention also provides a device for SDK testing, including a data acquisition module, a data interception module, a test package establishment module and a test analysis module;
所述数据采集模块用于采集用户触发APP执行指令,并抓取数据包,随后传递至所述数据截取模块中;The data collection module is used to collect the user's trigger APP execution instruction, and capture the data packet, and then deliver it to the data interception module;
所述数据截取模块通过使用adb命令与APP进行数据上的通信,利用shell命令对配置文件进行修改,再进行gradle编译,实现对APP级别参数的修改,随后将传输的字符串化为API供所述测试包建立模块实时调用;The data interception module uses the adb command to communicate with the APP on the data, uses the shell command to modify the configuration file, and then compiles the gradle to realize the modification of the APP level parameters, and then converts the transmitted string into an API for all The above test package building module is called in real time;
所述测试包建立模块为测试项目自动创建合适的构建文件、配置文件和目录结构,在测试包与需要测试的应用程序间设置链接;The test package building module automatically creates suitable construction files, configuration files and directory structure for the test project, and links are set between the test package and the application program that needs to be tested;
所述测试解析模块确定测试包内的数据是否与应用程序接收的是否相同,若相同则APP客户端下发的数据包通过验证测试。The test parsing module determines whether the data in the test packet is the same as that received by the application program, and if they are the same, the data packet delivered by the APP client passes the verification test.
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, those skilled in the art can understand that various changes, modifications and substitutions can be made to these embodiments without departing from the principle and spirit of the present invention. and modifications, the scope of the invention is defined by the appended claims and their equivalents.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810487677.0A CN108763074A (en) | 2018-05-21 | 2018-05-21 | A kind of method and device of SDK tests |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810487677.0A CN108763074A (en) | 2018-05-21 | 2018-05-21 | A kind of method and device of SDK tests |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108763074A true CN108763074A (en) | 2018-11-06 |
Family
ID=64007405
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810487677.0A Pending CN108763074A (en) | 2018-05-21 | 2018-05-21 | A kind of method and device of SDK tests |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108763074A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110119350A (en) * | 2019-04-02 | 2019-08-13 | 深圳市腾讯信息技术有限公司 | Software Development Kit test method, device and equipment and computer storage medium |
CN111176720A (en) * | 2019-12-27 | 2020-05-19 | 珠海奔图电子有限公司 | Control method and control device for running application programs in multiple systems |
CN110298669B (en) * | 2019-06-27 | 2023-09-12 | 上海麦克风文化传媒有限公司 | iOS charging risk control system based on graphic structure |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399814A (en) * | 2013-07-16 | 2013-11-20 | 西安Tcl软件开发有限公司 | Automated testing method and automated testing device |
GB2524737A (en) * | 2014-03-31 | 2015-10-07 | Kainos Worksmart Ltd | A system and method for testing a workflow |
CN106598831A (en) * | 2015-10-16 | 2017-04-26 | 北京国双科技有限公司 | Method and device for testing SDK (software development kit) |
-
2018
- 2018-05-21 CN CN201810487677.0A patent/CN108763074A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399814A (en) * | 2013-07-16 | 2013-11-20 | 西安Tcl软件开发有限公司 | Automated testing method and automated testing device |
GB2524737A (en) * | 2014-03-31 | 2015-10-07 | Kainos Worksmart Ltd | A system and method for testing a workflow |
CN106598831A (en) * | 2015-10-16 | 2017-04-26 | 北京国双科技有限公司 | Method and device for testing SDK (software development kit) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110119350A (en) * | 2019-04-02 | 2019-08-13 | 深圳市腾讯信息技术有限公司 | Software Development Kit test method, device and equipment and computer storage medium |
CN110119350B (en) * | 2019-04-02 | 2023-02-03 | 深圳市腾讯信息技术有限公司 | Software development kit testing method, device and equipment and computer storage medium |
CN110298669B (en) * | 2019-06-27 | 2023-09-12 | 上海麦克风文化传媒有限公司 | iOS charging risk control system based on graphic structure |
CN111176720A (en) * | 2019-12-27 | 2020-05-19 | 珠海奔图电子有限公司 | Control method and control device for running application programs in multiple systems |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10528454B1 (en) | Intelligent automation of computer software testing log aggregation, analysis, and error remediation | |
CN106021095B (en) | A kind of Android application automated testing method based on push-mechanism | |
CN103186740B (en) | A kind of automated detection method of Android malware | |
CN108650149B (en) | Server testing method, device, equipment and computer readable storage medium | |
CN104699616B (en) | The method of a kind of application test, Apparatus and system | |
CN104766007B (en) | A kind of method that the fast quick-recovery of sandbox is realized based on file system filter driver | |
CN110162977A (en) | A kind of Android vehicle-mounted terminal system leakage location and method | |
CN104375938B (en) | Android application dynamic behavior monitoring method and system | |
CN104182688A (en) | Android malicious code detection device and method based on dynamic activation and behavior monitoring | |
CN102314561A (en) | Automatic analysis method and system of malicious codes based on API (application program interface) HOOK | |
CN101137170A (en) | Software automatic testing instrument and method of embedded equipment | |
CN112733369B (en) | Intelligent equipment maintenance method, terminal and system and electronic equipment | |
CN108255585B (en) | SDK exception control and application program running method, device and equipment thereof | |
CN107358103A (en) | The Android sensitive behavior monitoring method and system of pitching pile are called based on sensitivity function | |
CN110119350A (en) | Software Development Kit test method, device and equipment and computer storage medium | |
CN105187393B (en) | A kind of mobile terminal from malicious software network behavior reconstructing method and its system | |
CN108763074A (en) | A kind of method and device of SDK tests | |
US9232420B1 (en) | Automated network testing using in-progress call detail records | |
CN107807869A (en) | A kind of test system and method for testing | |
CN113032224A (en) | Information acquisition method and device, electronic equipment and readable storage medium | |
CN104486292A (en) | Enterprise-resource safety-access control method, device and system | |
CN104636249A (en) | Generation system and method of debugging information of application program | |
CN105847091A (en) | Method, device and system for monitoring network traffic in real time of android system | |
CN118250202A (en) | Network traffic acquisition method, device and system, electronic equipment and storage medium | |
CN110990221A (en) | Android platform malware automatic detection method and system based on kernel LKM |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181106 |
|
RJ01 | Rejection of invention patent application after publication |