CN113312254A - Kernel code testing method and device, storage medium and processor - Google Patents

Kernel code testing method and device, storage medium and processor Download PDF

Info

Publication number
CN113312254A
CN113312254A CN202110333205.1A CN202110333205A CN113312254A CN 113312254 A CN113312254 A CN 113312254A CN 202110333205 A CN202110333205 A CN 202110333205A CN 113312254 A CN113312254 A CN 113312254A
Authority
CN
China
Prior art keywords
target
corpus
kernel code
coverage
test
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
Application number
CN202110333205.1A
Other languages
Chinese (zh)
Inventor
施鹤远
王润哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Innovation Co
Original Assignee
Alibaba Singapore Holdings Pte Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alibaba Singapore Holdings Pte Ltd filed Critical Alibaba Singapore Holdings Pte Ltd
Priority to CN202110333205.1A priority Critical patent/CN113312254A/en
Publication of CN113312254A publication Critical patent/CN113312254A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a test method and device of kernel codes, a storage medium and a processor. Wherein, the method comprises the following steps: acquiring an initial corpus and a target to-be-tested position set corresponding to a to-be-tested kernel code; determining a target kernel code position covered in the target test case execution process; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus. The method and the device solve the technical problem that the specified position of the kernel code cannot be detected in the prior art.

Description

Kernel code testing method and device, storage medium and processor
Technical Field
The present application relates to the field of software testing, and in particular, to a method and an apparatus for testing kernel codes, a storage medium, and a processor.
Background
The kernel is the most essential part of the operating system, and is software that can provide applications with secure access to computer hardware, and therefore, the quality of kernel code must be guaranteed. Currently, the quality of kernel code is generally guaranteed by performing defect detection on the kernel of an operating system.
The fuzzy testing technology is widely applied to the detection of the kernel defects due to the high automation degree of the testing process. In practical application, after the kernel fuzzy test is started, the fuzzy test tool first reads the initial corpus, the operating system executes the seeds (i.e., test cases) in the initial corpus, and collects kernel positions covered during the execution of the seeds. Then, whether the kernel position which is not covered by the seed in the current corpus is covered in the seed execution process is judged. If so, adding the seeds into the whole coverage corpus, otherwise, discarding the seeds. And finally, judging whether a test ending instruction is received. If yes, ending the test and outputting the corpus maintained and updated in the current test process. Otherwise, performing mutation operation on the current whole coverage corpus, and executing the steps again in a circulating manner.
It can be seen from the above fuzzy test process that the current test tool uses whether the seed covers the kernel position that the seed did not cover in the current corpus as a main evaluation index, and the seed quality evaluation method aims to maximize the coverage rate of the whole kernel code in the test process. Because the existing test method only emphasizes the maximization of the overall coverage rate, the fuzzy test lacks the test pertinence, the important priority test aiming at the preset to-be-tested position (such as a certain kernel subsystem, a certain file and a certain function) cannot be carried out, the detection capability of the target coverage speed and the target related defects is limited, and the kernel defects related to the to-be-tested position cannot be found in time.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a test method, a test device, a storage medium and a processor of kernel codes, and at least solves the technical problem that the specified position of the kernel codes cannot be detected in the prior art.
According to an aspect of an embodiment of the present application, there is provided a method for testing kernel code, including: acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in an initial corpus; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
According to another aspect of the embodiments of the present application, there is also provided a method for testing kernel code, including: displaying an initial corpus and a target position set to be detected corresponding to the kernel code to be detected in an interactive interface, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; under the condition that a test instruction is received, displaying a target kernel code position covered in the process of executing a target test case in the initial corpus in an interactive interface; displaying a first coincidence state and a second coincidence state in the interactive interface, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; displaying an updated whole coverage corpus and/or an updated target coverage corpus in the interactive interface, wherein the updated whole coverage corpus is obtained by updating the whole coverage corpus based on a first superposition state and a target test case, and the updated target coverage corpus is obtained by updating the target coverage corpus based on the first superposition state, a second superposition state and the target test case; and displaying a test result of testing the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus in the interactive interface.
According to another aspect of the embodiments of the present application, there is also provided a device for testing kernel code, including: the acquisition module is used for acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; the determining module is used for determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in the initial corpus; the updating module is used for updating the target test case to the whole coverage corpus and/or the target coverage corpus according to a first coincidence state and a second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and the testing module is used for carrying out defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the above-mentioned test method for kernel code.
According to another aspect of the embodiments of the present application, there is also provided a processor, configured to execute a program, where the program executes the method for testing the kernel code.
According to another aspect of the embodiments of the present application, there is also provided a computing device, including: a processor; and a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in an initial corpus; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
In the embodiment of the application, after an initial corpus including a whole coverage corpus and a target position set to be tested corresponding to a kernel code to be tested are obtained by adopting a fuzzy test mode based on a target position set to be tested, the target kernel code position covered in the execution process of a target test case is determined, the target test case is updated to the whole coverage corpus and/or the target coverage corpus according to a first superposition state and a second superposition state, and finally, the kernel code to be tested is subjected to defect test based on the updated whole coverage corpus and/or the updated target coverage corpus. The first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus or not, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested or not.
In the process, the target position set to be tested including at least one target position to be tested is used as the input of the fuzzy test to guide the fuzzy test, the perception capability of the target position to be tested in the fuzzy test process is established, and the test pertinence of the fuzzy test is improved. In addition, in the application, the initial corpus (including the whole coverage corpus and the target coverage corpus) is subjected to test variation according to the coincidence state of the target kernel code position covered by the target test case, the first kernel code position covered by other test cases in the whole coverage corpus, and the second kernel code position stored in the target position set to be tested, so that the number of times of coverage execution of the target position to be tested in the target position set to be tested in the fuzzy test process is increased, and the important priority test of the target position to be tested in the target position set to be tested is realized.
Therefore, the purpose of testing the designated position in the kernel code is achieved by the scheme provided by the application, so that the technical effect of improving the test pertinence of the fuzzy test is achieved, and the technical problem that the designated position of the kernel code cannot be detected in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a block diagram of an alternative computing device hardware architecture according to embodiments of the present application;
FIG. 2 is a flow chart of a method for testing kernel code according to an embodiment of the present application;
FIG. 3 is a flow chart of an alternative method of testing kernel code according to an embodiment of the present application;
FIG. 4 is a flow chart of a method for testing kernel code according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a kernel code testing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
(1) the method executes the test by generating a large number of random system call sequences for the operating system to execute, so as to trigger the abnormal state of the operating system and discover the defects of the operating system.
(2) And seeds refer to test cases in the fuzzy test process, and each seed consists of a system call sequence provided by an operating system and input parameters required by each operating system call.
(3) And (4) evaluating the quality of the seeds, namely judging whether each seed is favorable for finding an evaluation standard of defects in the fuzzy test process.
(4) The corpus refers to a set of high-quality seeds generated during the running of the test process, wherein the corpus can be read by the fuzzy test tool at the beginning of the test running and updated by the fuzzy test tool in the test process.
(5) The seed mutation refers to an operation of randomly changing the sequence, the kind, the parameter, and the like of the system call sequence included in the seed in the test process.
(6) The seed integral covering refers to a set of covered kernel positions in the process of executing the seed by an operating system.
Example 1
There is also provided, in accordance with an embodiment of the present application, an embodiment of a method for testing kernel code, to note that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions, and that although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computing device, or a similar computing device. Fig. 1 shows a hardware configuration block diagram of a computing device (or mobile device) for implementing a test method of kernel code. As shown in fig. 1, computing device 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), memory 104 for storing data, and transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, computing device 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computing device 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the testing method of kernel code in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the testing method of kernel code described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to computing device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by a communications provider of computing device 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computing device 10 (or mobile device).
Here, it should be noted that in some alternative embodiments, the computer device (or mobile device) shown in fig. 1 described above may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a particular specific example and is intended to illustrate the types of components that may be present in the computer device (or mobile device) described above.
In addition, an execution main body for executing the testing method of the kernel code provided in this embodiment may be a fuzz testing tool capable of performing fuzz testing, which may be a software application running in a terminal device (e.g., a computer, a smart phone, a smart tablet, etc.) or a server.
Optionally, under the above operating environment, the present application provides a method for testing kernel code as shown in fig. 2. Fig. 2 is a flowchart of a method for testing kernel code according to a first embodiment of the present application, and as can be seen from fig. 2, the method includes the following steps:
step S202, an initial corpus and a target to-be-tested position set corresponding to the to-be-tested kernel code are obtained.
In step S202, the initial corpus at least includes a whole coverage corpus and a target coverage corpus, the whole coverage corpus is the same as the corpus used in the existing fuzzy test method, and the target coverage corpus is a set of test cases capable of covering the target to-be-tested location in the kernel code to be tested. In addition, the target positions to be measured may be stored in a list form, which includes at least one target position to be measured. For example, in the process of testing the kernel code to be tested, a user can store the function a, the module B and the file C to be tested in the target position set to be tested, so that the fuzzy testing tool can perform targeted testing on the target position to be tested in the target position set.
In addition, the initial corpus can be stored in a server, and in practical application, when the fuzzy test tool tests the kernel code to be tested, the initial corpus can be obtained from the server, and the kernel code to be tested is tested based on the test case stored in the initial corpus.
It should be noted that the target position to be tested is used as an input to guide the fuzzy test process, so that the perception capability of the fuzzy test process on the target position to be tested is established, and a basis is provided for quality evaluation of the test case.
Step S204, determining the target kernel code position covered in the target test case executing process, wherein the target test case is the test case in the initial corpus.
It should be noted that the initial corpus may include a plurality of test cases, and in the process of the fuzzy test of the present application, the target test cases are read from the initial corpus according to a certain order, and the target test cases are used to test the kernel code to be tested, and then the position of the target kernel code covered by the target test cases in the process of testing the kernel code to be tested is obtained. For example, the target kernel code position covered by the target test case 1 can test functions A, B and C in the kernel code to be tested, and the target kernel code position covered by the target test case 1 includes functions A, B and C.
Step S206, updating the target test case into the whole coverage corpus and/or the target coverage corpus according to the first and second overlapping states.
In step S206, the first coincidence state represents whether the target kernel code position includes a first kernel code position covered by other test cases in the entire coverage corpus, for example, the entire coverage corpus includes test case 1 and test case 2, where during the process of executing test case 1 (i.e., the target test case), the covered kernel code positions (i.e., the target kernel code positions) are A, B and C, and during the process of executing test case 2 (i.e., other test cases in the entire coverage corpus), the covered kernel code positions (i.e., the first kernel code positions) are a and C, and since the target kernel code position includes the first kernel code position, it is determined that the target kernel code position includes the first kernel code position covered by other test cases in the entire coverage corpus.
In addition, the second coincidence state represents whether the target kernel code position includes a second kernel code position stored in the target position set to be tested. For example, the entire coverage corpus includes test case 1 and test case 2, where in the process of executing test case 1 (i.e., a target test case), covered kernel code positions (i.e., target kernel code positions) are A, B and C, and the target to-be-tested position set includes positions a and C (i.e., second kernel code positions), and since the target kernel code position includes the second kernel code position, it is determined that the target kernel code position includes the second kernel code position stored in the target to-be-tested position set.
In an optional embodiment, the fuzzy test tool determines whether to update the entire coverage corpus and/or the target coverage corpus according to whether the target kernel code position includes a first kernel code position covered by other test cases in the entire coverage corpus and whether the target kernel code position includes a second kernel code position stored in the target position set to be tested. In this embodiment, the whole coverage corpus and/or the target coverage corpus are updated, and the target test case may be added to the whole coverage corpus and/or the target coverage corpus.
And step S208, performing defect test on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
In step S208, after the updated entire coverage corpus and/or the updated target coverage corpus are obtained, the fuzzy test tool may perform a defect test on the kernel code to be tested by using the updated entire coverage corpus and/or the updated target coverage corpus to obtain a test result. The fuzzy test tool can also continuously update the whole coverage corpus and/or the target coverage corpus according to the test result, so that a closed-loop flow is formed.
Based on the solutions defined in the foregoing steps S202 to S208, it can be known that, in the embodiment of the present application, after the initial corpus including the entire coverage corpus and the target position set to be tested corresponding to the kernel code to be tested are obtained by using a fuzzy test method based on the target position set to be tested, the target kernel code position covered in the execution process of the target test case is determined, the target test case is updated to the entire coverage corpus and/or the target coverage corpus according to the first overlapping state and the second overlapping state, and finally, the kernel code to be tested is subjected to a defect test based on the updated entire coverage corpus and/or the updated target coverage corpus. The first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus or not, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested or not.
It is easy to note that, in the above process, the target position to be tested set including at least one target position to be tested is used as the input of the fuzzy test to guide the fuzzy test, so that the perception capability of the target position to be tested in the fuzzy test process is established, and the test pertinence of the fuzzy test is improved. In addition, in the application, the initial corpus (including the whole coverage corpus and the target coverage corpus) is subjected to test variation according to the coincidence state of the target kernel code position covered by the target test case, the first kernel code position covered by other test cases in the whole coverage corpus, and the second kernel code position stored in the target position set to be tested, so that the number of times of coverage execution of the target position to be tested in the target position set to be tested in the fuzzy test process is increased, and the important priority test of the target position to be tested in the target position set to be tested is realized.
Therefore, the purpose of testing the designated position in the kernel code is achieved by the scheme provided by the application, so that the technical effect of improving the test pertinence of the fuzzy test is achieved, and the technical problem that the designated position of the kernel code cannot be detected in the prior art is solved.
In an optional embodiment, before determining the kernel code position covered in the target test case execution process, the fuzzy test tool obtains all test cases contained in the initial corpus, and determines the currently executed test case from all the test cases according to a preset sequence to obtain the target test case.
It should be noted that the preset sequence may be, but is not limited to, a name sequence of the test cases, a creation date sequence of the test cases, a preset priority sequence of the test cases, and the like. The preset sequence can be a pre-stored and unalterable sequence, and can also be set by a user.
Optionally, the fuzzy test tool first detects the number of all test cases contained in the initial corpus, and acquires all test cases from the initial corpus when the number is greater than zero; in the case where the number is zero, a test case is generated.
It should be noted that, when the fuzzy test tool tests the kernel code to be tested for the first time, the initial corpus is an empty set, that is, the number of all test cases contained in the initial corpus is zero, at this time, the fuzzy test tool automatically generates a test case, and the test case is used to test the kernel code to be tested. And when the initial corpus is not an empty set, the fuzzy test tool acquires the test cases from the initial corpus according to a preset sequence.
For example, the fuzzy test tool first detects whether a test case exists in the entire coverage corpus, and if so, reads the test case from the entire coverage corpus according to a preset sequence (for example, name sequencing, creation date sequencing, etc.); after executing all the test cases of the whole body coverage corpus, the fuzzy test tool detects whether the test cases exist in the target coverage corpus, and if the test cases exist, the test cases are read from the target coverage corpus according to a preset sequence (for example, name sequencing, creation date sequencing and the like). Optionally, if the test case does not exist in the entire coverage corpus, the fuzzy test tool detects whether the test case exists in the target coverage corpus.
The above method of reading the test cases in the initial corpus is only an example, and in practical applications, the method is not limited to the above reading method.
Further, the fuzzy test tool reads the target test case from the initial corpus, executes the target test case, then obtains a target kernel code position covered in the process of executing the target test case, and updates the whole coverage corpus and/or the target coverage corpus according to whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus and whether the target kernel code position contains a second kernel code position stored in the target position set to be tested.
Specifically, the target test case is updated to the entire coverage corpus when the target kernel code position includes the first kernel code position. And under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position contains the second kernel code position, updating the target test case into the target coverage corpus. And deleting the target test case from the initial corpus under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position does not contain the second kernel code position.
In an alternative embodiment, the fuzzy test tool first detects whether the first superposition state satisfies a first preset condition, and if the first superposition state satisfies the first preset condition (that is, the target kernel code position includes the first kernel code position), the entire coverage corpus is updated; if the first superposition state does not meet the first preset condition, continuously detecting that the second superposition state meets the second preset condition (namely the target kernel code position contains the second kernel code position); and if the second overlapping state meets a second preset condition, updating the target coverage corpus.
Optionally, fig. 3 shows a flowchart of the kernel code testing method, in fig. 3, after the start of the fuzz test, the fuzz test tool first reads the initial corpus and the target position set to be tested, executes the test case in the initial corpus, and collects the target kernel code position covered in the process of executing the target test case. Then, it is determined whether kernel entire coverage is newly added in the process of executing the target kernel code position, that is, it is determined whether kernel code positions (i.e., first kernel code positions) that are not covered by other test cases in the entire coverage corpus exist in the target kernel code position covered by the target test case. If the target test case exists, adding the target test case into the whole coverage corpus, wherein the target kernel code positions covered by the target test case are A, B and C, the first kernel code position comprises A and D, and the target kernel code position does not cover the first kernel code position; and if not, entering next target position coverage judgment, namely judging whether the target to-be-tested position in the target to-be-tested position set is covered in the process of executing the target test case, namely judging whether a kernel code position (namely a second kernel code position) stored in the target to-be-tested position set exists in the target kernel code position covered by the target test case, if so, adding the target test case into the target coverage corpus, otherwise, discarding the target test case. For example, target kernel code positions covered by the target test case are A, B and C, the first kernel code position includes a and C, since the target kernel code position completely covers the first kernel code position, whether the target kernel code position covers the second kernel code position is continuously detected, and if the second kernel code position is B, the target test case is added into the target coverage corpus; if the second kernel code location includes D, the target test case is discarded.
It should be noted that, according to the position of the test case covering the kernel, the test cases which do not increase the kernel code position in the whole covering corpus but cover the target position to be tested are added into the target covering corpus, so that the test cases can participate in the subsequent fuzzy test variation and execution process, the covering execution times of the fuzzy test process on the target position to be tested are increased, and the key priority test on the target position to be tested is realized.
Furthermore, after the kernel code to be tested is subjected to the defect test based on the updated whole coverage corpus and/or the updated target coverage corpus, the fuzzy test tool detects whether the ending instruction is received, and under the condition that the receiving instruction is not detected, test information of test cases contained in the whole coverage corpus and the target coverage corpus is subjected to randomization processing, namely, the initial corpus is subjected to mutation operation. Wherein the test information at least comprises one of the following: test sequence, test type, test parameters.
Optionally, as shown in fig. 3, after receiving an end instruction for ending the test, the test is ended and the updated whole coverage corpus and the updated target coverage corpus are output in the current test process. Otherwise, performing mutation operation on the current whole coverage corpus and the target coverage corpus, and recycling the above process.
According to the method, the target position to be tested is introduced as the test input, the quality of the test case is evaluated by combining the overall coverage position of the test case and the target coverage position of the test case, and the target test capability of the kernel fuzzy test on the target position to be tested is established, so that the problem that the target position cannot be sensed by the fuzzy test to perform the targeted test due to the lack of the target position as the test input in the prior art is solved. In addition, compared with the prior art that the overall kernel coverage position of the test case in the maximized corpus is used as an evaluation index, the number of the overall coverage positions is simply emphasized, the important priority test cannot be performed on a specific position, and the test efficiency of the fuzzy test on the preset target position to be tested is influenced, the quality of the test case in the corpus is evaluated by comprehensively utilizing the overall coverage condition of the test case and the coverage condition of the target position, the test case capable of covering the target position is reserved to participate in the subsequent fuzzy test process, and the coverage times of the target position to be tested are improved.
In a contrast test, compared with the current kernel fuzzy test tool, the test coverage rate of the target position is improved by more than 20%, and 4.75 times of target position related defects can be triggered on average. By the aid of the method and the device, key priority testing can be realized for the preset position to be tested through kernel fuzzy testing, and testing capacity and testing efficiency for the target position are improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the test method of kernel code according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
Example 2
According to an embodiment of the present application, there is also provided a method for testing kernel code, as shown in fig. 4, the method includes the following steps:
step S402, displaying the initial corpus and a target to-be-tested position set corresponding to the to-be-tested kernel code in the interactive interface.
In step S402, the fuzz testing tool has a display screen that can display an interactive interface. The initial corpus comprises at least a whole covering corpus and a target covering corpus, the whole covering corpus is the same as a corpus used in the existing fuzzy test method, and the target covering corpus is a set of test cases capable of covering a target to-be-tested position in the kernel code to be tested. In addition, the target positions to be measured may be stored in a list form, which includes at least one target position to be measured. The target position to be measured can be composed of a target module name, a file name, a function name and the like.
In addition, the initial corpus can be stored in a server, and in practical application, when the fuzzy test tool tests the kernel code to be tested, the initial corpus can be obtained from the server, and the kernel code to be tested is tested based on the test case stored in the initial corpus.
In an optional embodiment, the fuzzy test tool obtains all test cases contained in the initial corpus, and determines the currently executed test case from all the test cases according to a preset sequence to obtain the target test case. The fuzzy test tool firstly detects the number of all test cases contained in the initial corpus, and acquires all test cases from the initial corpus under the condition that the number is larger than zero; in the case where the number is zero, a test case is generated.
It should be noted that the target position to be tested is used as an input to guide the fuzzy test process, so that the perception capability of the fuzzy test process on the target position to be tested is established, and a basis is provided for quality evaluation of the test case.
Step S404, in a case that the test instruction is received, displaying a target kernel code position covered in the process of executing the target test case in the initial corpus in the interactive interface.
It should be noted that the initial corpus may include a plurality of test cases, and in the process of the fuzzy test of the present application, the target test cases are read from the initial corpus according to a certain order, and the target test cases are used to test the kernel code to be tested, and then the position of the target kernel code covered by the target test cases in the process of testing the kernel code to be tested is obtained.
Step S406, displaying the first overlapping state and the second overlapping state in the interactive interface.
In step S406, the first coincidence state indicates whether the target kernel code position includes a first kernel code position covered by another test case in the entire coverage corpus, and the second coincidence state indicates whether the target kernel code position includes a second kernel code position stored in the target position set to be tested.
Step S408 is to display the updated whole coverage corpus and/or the updated target coverage corpus in the interactive interface.
In step S408, the updated whole coverage corpus is obtained by updating the whole coverage corpus based on the first superposition state and the target test case, and the updated target coverage corpus is obtained by updating the target coverage corpus based on the first superposition state, the second superposition state and the target test case.
Optionally, under the condition that the target kernel code position includes the first kernel code position, updating the target test case into the whole coverage corpus; under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position contains the second kernel code position, updating the target test case into the target coverage corpus; and deleting the target test case from the initial corpus under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position does not contain the second kernel code position.
Step S410, displaying a test result of testing the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus in the interactive interface.
In step S410, after the updated whole coverage corpus and/or the updated target coverage corpus are obtained, the fuzzy test tool may perform a defect test on the kernel code to be tested by using the updated whole coverage corpus and/or the updated target coverage corpus to obtain a test result. The fuzzy test tool can also continuously update the whole coverage corpus and/or the target coverage corpus according to the test result, so that a closed-loop flow is formed.
Based on the solutions defined in the foregoing steps S402 to S410, it can be known that, in the embodiment of the present application, after an initial corpus including an entire coverage corpus and a target position set to be tested corresponding to a kernel code to be tested are obtained by using a fuzzy test method based on the target position set to be tested, a target kernel code position covered in an execution process of a target test case is determined, the target test case is updated to the entire coverage corpus and/or the target coverage corpus according to a first overlapping state and a second overlapping state, and finally, a defect test is performed on the kernel code to be tested based on the updated entire coverage corpus and/or the updated target coverage corpus. The first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus or not, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested or not.
It is easy to note that, in the above process, the target position to be tested set including at least one target position to be tested is used as the input of the fuzzy test to guide the fuzzy test, so that the perception capability of the target position to be tested in the fuzzy test process is established, and the test pertinence of the fuzzy test is improved. In addition, in the application, the initial corpus (including the whole coverage corpus and the target coverage corpus) is subjected to test variation according to the coincidence state of the target kernel code position covered by the target test case, the first kernel code position covered by other test cases in the whole coverage corpus, and the second kernel code position stored in the target position set to be tested, so that the number of times of coverage execution of the target position to be tested in the target position set to be tested in the fuzzy test process is increased, and the important priority test of the target position to be tested in the target position set to be tested is realized.
Therefore, the purpose of testing the designated position in the kernel code is achieved by the scheme provided by the application, so that the technical effect of improving the test pertinence of the fuzzy test is achieved, and the technical problem that the designated position of the kernel code cannot be detected in the prior art is solved.
It should be noted that the method for testing kernel codes in this embodiment is substantially the same as the method provided in embodiment 1, and specific technical details have been described in embodiment 1 and are not described herein again.
Example 3
According to an embodiment of the present application, there is also provided an apparatus for implementing the above test method for kernel code, as shown in fig. 5, the apparatus 50 includes: an acquisition module 501, a determination module 503, an update module 505, and a test module 507.
The acquiring module 501 is configured to acquire an initial corpus and a target position set to be detected corresponding to a kernel code to be detected, where the initial corpus at least includes an entire coverage corpus and a target coverage corpus, and the target position set to be detected includes at least one target position to be detected; a determining module 503, configured to determine a target kernel code position covered by a target test case in an execution process, where the target test case is a test case in an initial corpus; an updating module 505, configured to update the target test case to the entire coverage corpus and/or the target coverage corpus according to a first coincidence state and a second coincidence state, where the first coincidence state represents whether the target kernel code position includes a first kernel code position covered by another test case in the entire coverage corpus, and the second coincidence state represents whether the target kernel code position includes a second kernel code position stored in the target position set to be tested; the testing module 507 is configured to perform a defect test on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
It should be noted here that the acquiring module 501, the determining module 503, the updating module 505, and the testing module 507 correspond to steps S202 to S208 in embodiment 1, and the four modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computing device 10 provided in the first embodiment.
Example 4
Embodiments of the present application may provide a computing device that may be any one of a group of computing devices. Optionally, in this embodiment, the computing device may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computing device may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the above-mentioned computing device may execute program codes of the following steps in the kernel code testing method: acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in an initial corpus; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
Optionally, fig. 6 is a block diagram of a computing device according to an embodiment of the present application. As shown in fig. 6, the computing device 6 may include: one or more (only one of which is shown) processors 602, memory 604, and a peripherals interface 606.
The memory may be configured to store software programs and modules, such as program instructions/modules corresponding to the kernel code testing method and apparatus in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the kernel code testing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memories may further include a memory located remotely from the processor, which may be connected to computing device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in an initial corpus; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
Optionally, the processor may further execute the program code of the following steps: and updating the target test case into the whole coverage corpus under the condition that the target kernel code position comprises the first kernel code position.
Optionally, the processor may further execute the program code of the following steps: and under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position contains the second kernel code position, updating the target test case into the target coverage corpus.
Optionally, the processor may further execute the program code of the following steps: and deleting the target test case from the initial corpus under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position does not contain the second kernel code position.
Optionally, the processor may further execute the program code of the following steps: after defect testing is carried out on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus, whether an ending instruction is received or not is detected; and under the condition that the receiving instruction is not detected, randomizing the test information of the test cases contained in the whole coverage corpus and the target coverage corpus, wherein the test information at least comprises one of the following items: test sequence, test type, test parameters.
Optionally, the processor may further execute the program code of the following steps: before determining the kernel code position covered in the target test case execution process, acquiring all test cases contained in an initial corpus; and determining the currently executed test case from all the test cases according to a preset sequence to obtain a target test case.
Optionally, the processor may further execute the program code of the following steps: detecting the number of all test cases contained in the initial corpus; and acquiring all test cases from the initial corpus under the condition that the number is larger than zero.
It can be understood by those skilled in the art that the structure shown in fig. 6 is only an illustration, and the computing device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 6 is a diagram illustrating a structure of the electronic device. For example, computing device 10 may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 5
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the kernel code testing method provided in the first embodiment.
Optionally, in this embodiment, the storage medium may be located in any one of computing devices in a computing device group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: acquiring an initial corpus and a target position set to be detected corresponding to the kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected; determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in an initial corpus; updating the target test case to the whole coverage corpus and/or the target coverage corpus according to the first coincidence state and the second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested; and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and updating the target test case into the whole coverage corpus under the condition that the target kernel code position comprises the first kernel code position.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position contains the second kernel code position, updating the target test case into the target coverage corpus.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and deleting the target test case from the initial corpus under the condition that the target kernel code position does not contain the first kernel code position and the target kernel code position does not contain the second kernel code position.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: after defect testing is carried out on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus, whether an ending instruction is received or not is detected; and under the condition that the receiving instruction is not detected, randomizing the test information of the test cases contained in the whole coverage corpus and the target coverage corpus, wherein the test information at least comprises one of the following items: test sequence, test type, test parameters.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: before determining the kernel code position covered in the target test case execution process, acquiring all test cases contained in an initial corpus; and determining the currently executed test case from all the test cases according to a preset sequence to obtain a target test case.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: detecting the number of all test cases contained in the initial corpus; and acquiring all test cases from the initial corpus under the condition that the number is larger than zero.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (12)

1. A method for testing kernel code, comprising:
acquiring an initial corpus and a target position set to be detected corresponding to a kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected;
determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in the initial corpus;
updating the target test case to the whole coverage corpus and/or the target coverage corpus according to a first coincidence state and a second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested;
and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
2. The method of claim 1, wherein updating the target test case into the entire coverage corpus according to a first coincidence state comprises:
and updating the target test case into the whole coverage corpus under the condition that the target kernel code position comprises the first kernel code position.
3. The method of claim 2, wherein updating the target test case into the target coverage corpus according to the first coincidence state and the second coincidence state comprises:
and updating the target test case into the target coverage corpus if the target kernel code position does not contain the first kernel code position and the target kernel code position contains the second kernel code position.
4. The method of claim 3, further comprising:
deleting the target test case from the initial corpus if the target kernel code location does not include the first kernel code location and the target kernel code location does not include the second kernel code location.
5. The method according to claim 1, wherein after performing defect testing on the kernel code under test based on the updated global coverage corpus and/or the updated target coverage corpus, the method further comprises:
detecting whether an ending instruction is received;
and when the ending instruction is not detected, randomizing test information of the test cases contained in the whole coverage corpus and the target coverage corpus, wherein the test information at least comprises one of the following items: test sequence, test type, test parameters.
6. The method of claim 1, wherein prior to determining the kernel code locations covered in the target test case execution process, the method further comprises:
acquiring all test cases contained in the initial corpus;
and determining the currently executed test case from all the test cases according to a preset sequence to obtain the target test case.
7. The method according to claim 6, wherein obtaining all test cases contained in the initial corpus comprises:
detecting the number of all test cases contained in the initial corpus;
and under the condition that the number is larger than zero, acquiring all the test cases from the initial corpus.
8. A method for testing kernel code, comprising:
displaying an initial corpus and a target position set to be detected corresponding to a kernel code to be detected in an interactive interface, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected;
under the condition that a test instruction is received, displaying a target kernel code position covered in the process of executing a target test case in the initial corpus in the interactive interface;
displaying a first coincidence state and a second coincidence state in the interactive interface, wherein the first coincidence state represents whether the target kernel code position includes a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position includes a second kernel code position stored in the target position set to be tested;
displaying an updated whole coverage corpus and/or an updated target coverage corpus in the interactive interface, wherein the updated whole coverage corpus is obtained by updating the whole coverage corpus based on the first superposition state and the target test case, and the updated target coverage corpus is obtained by updating the target coverage corpus based on the first superposition state, the second superposition state and the target test case;
and displaying a test result of testing the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus in the interactive interface.
9. An apparatus for testing kernel code, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an initial corpus and a target position set to be detected corresponding to a kernel code to be detected, the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected;
the determining module is used for determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in the initial corpus;
an updating module, configured to update the target test case to the entire coverage corpus and/or the target coverage corpus according to a first coincidence state and a second coincidence state, where the first coincidence state indicates whether the target kernel code position includes a first kernel code position covered by another test case in the entire coverage corpus, and the second coincidence state indicates whether the target kernel code position includes a second kernel code position stored in the target position set to be tested;
and the testing module is used for carrying out defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the test method of the kernel code according to any one of claims 1 to 8.
11. A processor, characterized in that the processor is configured to run a program, wherein the program runs to execute a method for testing kernel code according to any one of claims 1 to 8.
12. A computing device, comprising:
a processor; and a memory coupled to the processor for providing instructions to the processor for processing the following processing steps:
acquiring an initial corpus and a target position set to be detected corresponding to a kernel code to be detected, wherein the initial corpus at least comprises an overall coverage corpus and a target coverage corpus, and the target position set to be detected comprises at least one target position to be detected;
determining a target kernel code position covered in the execution process of a target test case, wherein the target test case is a test case in the initial corpus;
updating the target test case to the whole coverage corpus and/or the target coverage corpus according to a first coincidence state and a second coincidence state, wherein the first coincidence state represents whether the target kernel code position contains a first kernel code position covered by other test cases in the whole coverage corpus, and the second coincidence state represents whether the target kernel code position contains a second kernel code position stored in the target position set to be tested;
and performing defect testing on the kernel code to be tested based on the updated whole coverage corpus and/or the updated target coverage corpus.
CN202110333205.1A 2021-03-29 2021-03-29 Kernel code testing method and device, storage medium and processor Pending CN113312254A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110333205.1A CN113312254A (en) 2021-03-29 2021-03-29 Kernel code testing method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110333205.1A CN113312254A (en) 2021-03-29 2021-03-29 Kernel code testing method and device, storage medium and processor

Publications (1)

Publication Number Publication Date
CN113312254A true CN113312254A (en) 2021-08-27

Family

ID=77371930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110333205.1A Pending CN113312254A (en) 2021-03-29 2021-03-29 Kernel code testing method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN113312254A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033497A (en) * 2022-08-11 2022-09-09 北京登临科技有限公司 Kernel function testing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100058295A1 (en) * 2008-09-02 2010-03-04 International Business Machines Corporation Dynamic Test Coverage
CN110135165A (en) * 2019-04-12 2019-08-16 江苏大学 A kind of more granularity fuzz testing bug excavation methods of the classification of mobilism
CN112286823A (en) * 2020-11-18 2021-01-29 山石网科通信技术股份有限公司 Method and device for testing kernel of operating system
CN112328505A (en) * 2021-01-04 2021-02-05 中国人民解放军国防科技大学 Method and system for improving coverage rate of fuzz test

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100058295A1 (en) * 2008-09-02 2010-03-04 International Business Machines Corporation Dynamic Test Coverage
CN110135165A (en) * 2019-04-12 2019-08-16 江苏大学 A kind of more granularity fuzz testing bug excavation methods of the classification of mobilism
CN112286823A (en) * 2020-11-18 2021-01-29 山石网科通信技术股份有限公司 Method and device for testing kernel of operating system
CN112328505A (en) * 2021-01-04 2021-02-05 中国人民解放军国防科技大学 Method and system for improving coverage rate of fuzz test

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
戴渭;陆余良;朱凯龙;: "结合混合符号执行的导向式灰盒模糊测试技术", 计算机工程 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033497A (en) * 2022-08-11 2022-09-09 北京登临科技有限公司 Kernel function testing method, device, equipment and storage medium
CN115033497B (en) * 2022-08-11 2022-11-25 北京登临科技有限公司 Kernel function testing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108039921B (en) Calibration method of mobile terminal, terminal equipment and storage medium
CN109347938B (en) Traffic monitoring method, telephone watch, mobile terminal and server
CN107153605B (en) Test sample generation method and device
CN105975323A (en) Application management method and device and terminal
CN113225760B (en) Network testing method and equipment
CN113312254A (en) Kernel code testing method and device, storage medium and processor
CN113965904B (en) Device registration method, device and storage medium
CN111694703A (en) Cache region management method and device and computer equipment
CN107608923B (en) Test processing method and related product
CN112416706A (en) Power consumption testing method, device and system, storage medium and electronic device
CN111049717A (en) Variable acquisition method and equipment
CN108647139B (en) System test method, device, storage medium and electronic device
CN111369270A (en) Method, device and system for distributing reward resources
CN105208094A (en) Message notification method and message notifications system
CN113434421A (en) Virtual equipment testing method and device
CN109309748B (en) Cloud mobile phone hardware quality batch test method and system
CN113901852A (en) Detection method and device for electronic equipment
CN110858201B (en) Data processing method and system, processor and storage medium
CN113110991A (en) Page element positioning method and device, storage medium and electronic device
CN109583453B (en) Image identification method and device, data identification method and terminal
CN112767615B (en) Amusement equipment starting method and device
CN114301840B (en) Method and device for loading geographic information base and electronic equipment
CN110609781A (en) Interface test method, device and storage medium
CN110096255B (en) Rule degradation processing method, device and system and data processing method
CN113434839A (en) Front-end page access method and device, storage medium and electronic device

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40069592

Country of ref document: HK

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240319

Address after: # 03-06, Lai Zan Da Building 1, 51 Belarusian Road, Singapore

Applicant after: Alibaba Innovation Co.

Country or region after: Singapore

Address before: Room 01, 45th Floor, AXA Building, 8 Shanton Road, Singapore

Applicant before: Alibaba Singapore Holdings Ltd.

Country or region before: Singapore