CN113778841A - Detection method, device and equipment for file to be tested and storage medium - Google Patents
Detection method, device and equipment for file to be tested and storage medium Download PDFInfo
- Publication number
- CN113778841A CN113778841A CN202010526978.7A CN202010526978A CN113778841A CN 113778841 A CN113778841 A CN 113778841A CN 202010526978 A CN202010526978 A CN 202010526978A CN 113778841 A CN113778841 A CN 113778841A
- Authority
- CN
- China
- Prior art keywords
- file
- code
- detected
- detection
- preset
- 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
- 238000001514 detection method Methods 0.000 title claims abstract description 256
- 238000012360 testing method Methods 0.000 claims abstract description 200
- 238000000034 method Methods 0.000 claims abstract description 112
- 238000010998 test method Methods 0.000 claims abstract description 3
- 238000012552 review Methods 0.000 claims description 13
- 238000011161 development Methods 0.000 abstract description 57
- 238000000605 extraction Methods 0.000 abstract description 29
- 238000004891 communication Methods 0.000 abstract description 27
- 238000007689 inspection Methods 0.000 abstract description 8
- 241000700605 Viruses Species 0.000 description 87
- 230000001419 dependent effect Effects 0.000 description 24
- 238000012544 monitoring process Methods 0.000 description 24
- 230000006399 behavior Effects 0.000 description 23
- 230000008569 process Effects 0.000 description 21
- 238000013101 initial test Methods 0.000 description 12
- 238000012795 verification Methods 0.000 description 12
- 238000004458 analytical method Methods 0.000 description 4
- 238000012550 audit Methods 0.000 description 4
- 230000007123 defense Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000000779 smoke Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3612—Software analysis for verifying properties of programs by runtime analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3616—Software analysis for verifying properties of programs using software metrics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/566—Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/194—Calculation of difference between files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Virology (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention relates to the technical field of development and test, and discloses a test method, a device, equipment and a storage medium for test files, wherein the method comprises the following steps: obtaining a file to be detected; carrying out file rule detection on the file to be detected and extracted according to a preset file rule strategy; and when the file to be detected passes the file rule detection, the file to be detected is detected. In the invention, during development and lifting, file rule detection is carried out on a file to be detected and lifted and tested according to a preset file rule strategy, file rule pre-inspection is carried out before lifting and testing, the file detected by the file rule is tested, and the file not detected by the file rule needs to be developed, revised and lifted and tested again, so that the workload and the communication cost of development and lifting and testing are reduced, and the quality of the lifted and tested file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Description
Technical Field
The invention relates to the technical field of development and test, in particular to a test method, a test device, test equipment and a storage medium for a test file.
Background
During development and test, once the quality of the test file is poor, the test file is required to be developed, revised and tested again if the quality of the test file is not met, the later execution of the test is not smooth easily, and the workload and the communication cost of the development and test are greatly increased.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a detection method, a device, equipment and a storage medium for a test file, and aims to solve the technical problem that in the prior art, when development and extraction are carried out, the test file has quality problems, so that the later execution of the test is not smooth, and the communication cost of the test and the development is increased.
In order to achieve the above object, the present invention provides a method for detecting a test file, including the following steps:
acquiring a to-be-detected file;
carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and when the file to be detected passes the file rule detection, the file to be detected is detected.
Optionally, the preset file rule policy includes: presetting a difference strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
Optionally, the step of performing file rule detection on the file to be detected according to a preset difference policy of a preset file rule policy specifically includes:
extracting a source code file and a code identifier from the file to be detected;
searching a historical code file belonging to the same software as the source code file according to the code identifier;
and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection.
Optionally, the step of performing difference detection on the source code file and the historical code file specifically includes:
carrying out full-text difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
performing feature difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
carrying out size difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
and performing type difference detection on the source code file and the historical code file.
Optionally, the preset file rule policy includes: presetting a code strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
Optionally, the step of performing file rule detection on the file to be detected according to a preset code policy of a preset file rule policy specifically includes:
extracting a code to be detected from the file to be detected;
code examination is carried out on the code to be detected;
and performing task test on the code to be detected to realize file rule detection.
Optionally, the step of performing code review on the code to be detected specifically includes:
acquiring a current code identifier of the code to be detected, and determining a target branch code corresponding to the code to be detected according to the current code identifier;
obtaining a reference version code corresponding to the target branch code based on the version tree corresponding to the target branch code, wherein the code to be detected and the reference version code belong to the same branch corresponding to the target branch code;
and determining a difference code line of the code to be detected compared with the reference version code, and performing preset code normative review on the difference code line to realize code review.
Optionally, the step of performing task testing on the code to be detected to implement file rule detection specifically includes:
acquiring a dependent code of the code to be detected, and compiling the dependent code;
when the dependent code is compiled, performing task testing of a first preset task on the code to be detected;
and after the dependent code is compiled, performing task test of a second preset task on the code to be detected to realize file rule detection.
Optionally, the preset file rule policy includes: presetting a signature strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset signature strategy of a preset file rule strategy.
Optionally, the step of performing file rule detection on the to-be-detected file according to a preset signature policy of a preset file rule policy specifically includes:
extracting current signature information from the file to be detected;
searching a verification key corresponding to the file to be detected;
and carrying out signature verification detection on the current signature information according to the verification secret key so as to realize file rule detection.
Optionally, the preset file rule policy includes: presetting a virus strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset virus strategy of a preset file rule strategy.
Optionally, the step of performing file rule detection on the to-be-detected file according to a preset virus policy of a preset file rule policy specifically includes:
acquiring a preset virus set according to a preset virus strategy of a preset file rule strategy;
running the file to be detected, monitoring the running behavior of the file to be detected, and generating a log file;
and performing virus detection on the log file based on the preset virus set so as to realize file rule detection.
Optionally, the step of operating the file to be detected, monitoring an operation behavior of the file to be detected, and generating a log file specifically includes:
carrying out environment initialization operation on the virtual machine running the file to be detected;
copying the file to be detected to a fixed directory of a virtual machine;
running the file to be detected in the virtual machine;
and monitoring the operation behavior of the file to be detected in the operation process through a monitoring tool to generate a log file, and copying the log file from the virtual machine to a fixed directory of a physical machine.
Optionally, the step of performing virus detection on the log file based on the preset virus set to implement file rule detection specifically includes:
acquiring the log file from a fixed directory of the physical machine;
analyzing the running behavior of the log file;
and virus detection is carried out on the operation behavior of the log file through the preset virus set so as to realize file rule detection.
Optionally, after the step of obtaining the test file to be detected, the method for detecting the test file further includes:
taking the file to be detected as an initial file, and storing the initial file to a preset storage area;
after the step of extracting and testing the file to be tested when the file to be tested passes the file rule detection, the method for detecting the file to be tested further comprises the following steps:
when the file to be detected passes the extraction, acquiring the initial extraction file from the preset storage area;
and distributing the initial test file to corresponding application equipment according to a preset distribution rule.
Optionally, the step of acquiring the file to be detected specifically includes:
acquiring a compilation file of a compilation platform, and taking the acquired compilation file as a to-be-detected file;
or the like, or, alternatively,
acquiring a file uploaded by the terminal equipment, and taking the file uploaded by the terminal equipment as a file to be detected;
or the like, or, alternatively,
and acquiring the file uploaded by the web page, and taking the file uploaded by the web page as a file to be detected.
In addition, in order to achieve the above object, the present invention further provides a device for detecting a test document, including:
the acquisition module is used for acquiring the file to be detected;
the detection module is used for carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and the extracting and testing module is used for extracting and testing the extracting and testing file to be tested when the extracting and testing file to be tested passes the file rule detection.
Optionally, the preset file rule policy includes: presetting a difference strategy;
the detection module is further used for carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
In addition, in order to achieve the above object, the present invention further provides a device for detecting a test file, where the device for detecting a test file includes a memory, a processor, and a test program of a test file stored in the memory and executable on the processor, and the test program of a test file is configured to implement the steps of the method for detecting a test file as described above.
In addition, in order to achieve the above object, the present invention further provides a storage medium, on which a detection program of the test file is stored, and the detection program of the test file realizes the steps of the test file detection method as described above when being executed by a processor.
In the invention, a file to be detected is obtained; carrying out file rule detection on the file to be detected according to a preset file rule strategy; and when the file to be detected passes the file rule detection, the file to be detected is detected. By the method, during development and lifting, the file rule detection is carried out on the file to be detected and lifted according to the preset file rule strategy, the file rule is subjected to prepositive inspection before lifting, the file detected by the file rule is tested, and the file not detected by the file rule needs to be developed, revised and lifted again for lifting, so that the workload and the communication cost of development and lifting are reduced, and the quality of the lifted and tested file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Drawings
FIG. 1 is a schematic structural diagram of a device for detecting a file under test in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart of a first embodiment of a method for detecting a document according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for detecting a document according to the present invention;
FIG. 4 is a flowchart illustrating a third exemplary embodiment of a method for detecting a document according to the present invention;
FIG. 5 is a flowchart illustrating a fourth exemplary embodiment of a method for detecting a document according to the present invention;
FIG. 6 is a flowchart illustrating a fifth exemplary embodiment of a method for detecting a document according to the present invention;
FIG. 7 is a flowchart illustrating a sixth embodiment of a method for detecting a document according to the present invention;
FIG. 8 is a flowchart illustrating a seventh exemplary embodiment of a method for detecting a document according to the present invention;
FIG. 9 is a block diagram of a first embodiment of an apparatus for detecting documents according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a detection device for a file under test in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus for detecting a test document may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), and the optional user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 does not constitute a limitation of the detection apparatus that provides the test document, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a detection program of a test file.
In the detection apparatus for extracting a file shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting user equipment; the device for detecting a test file calls a test program of the test file stored in the memory 1005 through the processor 1001, and executes the method for detecting a test file according to the embodiment of the present invention.
Based on the hardware structure, the embodiment of the detection method for the test file is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for detecting a test file according to the present invention.
In a first embodiment, the method for detecting the test file includes the following steps:
step S10: and acquiring the file to be detected.
It should be noted that the execution subject of this embodiment is the detection device of the test file, and the detection device of the test file may be an electronic device such as a personal computer or a server, which is not limited in this embodiment. When acquiring the file to be detected, various methods may be adopted, and the following three methods are taken as examples for description, and of course, at least two methods may also be adopted for combination. In addition, the manner of acquiring the file to be detected may also be other manners according to actual needs, which is not limited in this embodiment.
The first mode is as follows: and acquiring a compilation file of the compilation platform, and taking the acquired compilation file as an extraction file to be detected.
The second way is: and acquiring the file uploaded by the terminal equipment, and taking the file uploaded by the terminal equipment as a to-be-detected file.
The third mode is as follows: and acquiring the file uploaded by the web page, and taking the file uploaded by the web page as a file to be detected.
Step S20: and carrying out file rule detection on the file to be detected according to a preset file rule strategy.
It should be noted that the preset file rule policy may include: presetting a difference strategy; the step S20 may include: and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
It is easy to understand that the preset file rule policy may include: presetting a code strategy; the step S20 may include: and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
It is easy to understand that the preset file rule policy may include: presetting a signature strategy; the step S20 may include: according to a preset signature strategy of a preset file rule strategy, file rule detection is carried out on the file to be detected, namely, current signature information is extracted from the file to be detected; searching a verification key corresponding to the file to be detected; and carrying out signature verification detection on the current signature information according to the verification secret key so as to realize file rule detection.
It is easy to understand that the preset file rule policy may include: presetting a virus strategy; the step S20 may include: and carrying out file rule detection on the file to be detected according to a preset virus strategy of a preset file rule strategy.
It should be understood that the preset file rule policy may include: a preset difference policy, a preset code policy, a preset signature policy, and a preset virus policy. The preset file rule policy may also be any combination of the preset difference policy, the preset code policy, the preset signature policy, and the preset virus policy, and the preset file rule policy may also include other test file detection policies that need to be adopted according to actual situations, which is not limited in this embodiment.
Step S30: and when the file to be detected passes the file rule detection, the file to be detected is detected.
It should be noted that, during development and extraction, if the preset file rule policy includes: a preset difference policy, a preset code policy, a preset signature policy, and a preset virus policy. And performing file rule detection on the file to be detected according to a preset file rule strategy, if the file to be detected passes all the file rule detections, determining that the file rule detection is passed, and if the file to be detected does not pass any file rule detection, determining that the file rule detection is not passed.
In this embodiment, after step S10, the method for detecting the test file further includes: and taking the file to be detected as an initial file, and storing the initial file to a preset storage area.
Correspondingly, after the step S30, the method for detecting a test file further includes: when the file to be detected passes the extraction, acquiring the initial extraction file from the preset storage area; and distributing the initial test file to corresponding application equipment according to a preset distribution rule.
Specifically, the initial test files of the audit class can be automatically pushed to the audit application device according to the preset distribution rule, the initial test files of the distribution class can be automatically pushed to the distribution application device according to the preset distribution rule, and the initial test files of the bale class can be automatically pushed to the bale application device according to the preset distribution rule. The initial test file is stored in the preset storage area, so that the files are prevented from falling to the ground in the whole detection and test process, the consistency between the files distributed according to the preset distribution rule and the test files to be detected is ensured, and the test quality is improved.
In the embodiment, the file to be detected is acquired; carrying out file rule detection on the file to be detected according to a preset file rule strategy; and when the file to be detected passes the file rule detection, the file to be detected is detected. By the method, during development and lifting, the file rule detection is carried out on the file to be detected and lifted according to the preset file rule strategy, the file rule is subjected to prepositive inspection before lifting, the file detected by the file rule is tested, and the file not detected by the file rule needs to be developed, revised and lifted again for lifting, so that the workload and the communication cost of development and lifting are reduced, and the quality of the lifted and tested file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 3, fig. 3 is a schematic flow chart of a second embodiment of the method for detecting a test file according to the present invention, and the second embodiment of the method for detecting a test file according to the present invention is proposed based on the first embodiment shown in fig. 2. This embodiment is explained based on the first embodiment.
In the second embodiment, the step S20 specifically includes:
step S21: and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
It should be noted that, the step of performing file rule detection on the file to be detected according to a preset difference policy of a preset file rule policy specifically includes: extracting a source code file and a code identifier from the file to be detected; searching a historical code file belonging to the same software as the source code file according to the code identifier; and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection.
It is easy to understand that, the source code file is extracted from the file to be detected, and the source code file and the code identifier can be obtained from the version server; or acquiring the source code file and the code identification from the development equipment. And searching a historical code file belonging to the same software as the source code file according to the code identifier, wherein the historical code file and the source code file can be different development versions of the same software, and specifically, the historical code file can be a previous development version of the source code file. The difference detection of the source code file and the history code file may include at least one of full-text difference detection, feature difference detection, size difference detection, and type difference detection, and the difference detection of the source code file and the history code file may also include other difference detection required according to an actual situation, which is not limited in this embodiment.
In this embodiment, the file rule detection is performed on the file to be detected according to a preset difference policy of a preset file rule policy. By the method, the difference detection is carried out on the file to be detected and detected through the preset difference strategy, and the abnormal conditions such as missing, carrying codes and the like can be found before the file is detected, so that the workload and the communication cost for developing and detecting are reduced, and the quality of the detected file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 4, fig. 4 is a schematic flow chart of a third embodiment of the method for detecting a document according to the present invention, and the third embodiment of the method for detecting a document according to the present invention is proposed based on the first embodiment shown in fig. 2 and the second embodiment shown in fig. 3. This embodiment is explained based on the second embodiment.
In the third embodiment, the step S21 specifically includes:
step S210: and extracting a source code file and a code identifier from the file to be detected.
It should be noted that, the source code file is extracted from the file to be detected, and the source code file and the code identifier may be obtained from a version server of a centralized file version management System (SVN); or acquiring the source code file and the code identification from the development equipment.
Step S211: and searching a historical code file belonging to the same software as the source code file according to the code identifier.
It should be understood that, according to the code identifier, a history code file belonging to the same software as the source code file is searched, and the history code file and the source code file may be different development versions of the same software, and specifically, the history code file may be a previous development version of the source code file.
Step S212: and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection.
It should be noted that, when performing difference detection on the source code file and the history code file, multiple implementations may be adopted, and four implementations are described below as examples, and of course, at least two implementations may also be adopted in combination. In addition, the difference detection method for the source code file and the history code file may further include other difference detection methods required according to actual situations, which is not limited in this embodiment.
The first mode is as follows: a full text difference detection mode; namely, the full-text difference detection is carried out on the source code file and the historical code file, namely, for the source code file obtained from the development equipment, full-text comparison is realized through difflib of a diffscript, namely python, and for the source code file obtained based on the SVN, the full-text comparison of the SVN mode can be directly given. In order to obtain the contrast effect graph more effectively, the change content of the source code file relative to the history code file can be marked by adopting the highlighted marks with different colors in the contrast effect graph for full-text difference detection, so that the change content can be displayed more intuitively, and a tester can know the change content more quickly and accurately.
The second way is: a feature difference detection mode; namely, feature difference detection is performed on the source code file and the history code file, that is, feature difference detection is performed on feature values of the source code file and feature values of the history code file. The characteristic value of the source code file may specifically refer to a fifth version Message Digest Algorithm (md 5) value of the source code file, and the md5 value refers to a value calculated from the fifth version Message Digest Algorithm; correspondingly, the characteristic value of the history code file refers to the md5 value of the history code file. For details of the calculation of the md5 value of the source code file and the md5 value of the history code file, reference may be made to the prior art, and details thereof are not repeated herein.
The third mode is as follows: a size difference detection mode; i.e. the size difference detection is performed on the source code file and the history code file, i.e. the difference between the size of the source code file and the size of the history code file.
The fourth mode is as follows: a type difference detection mode; i.e. a type difference detection is performed on the source code file and the history code file, i.e. a difference detection is performed between the type of the source code file and the type of the history code file.
Specifically, the file types of the source code file and the history code file may be text types, where a file name column specifically further includes path information of the source code file and path information of the history code file. The file size, the file type and the md5 value may be obtained and recorded by the development device side, and the detection device for detecting the file may be obtained directly when the source code file is obtained from the development device or the version server.
It is easy to understand that the difference detection is performed on the source code file and the historical code file to obtain a difference detection result, and if the difference detection result meets the preset difference information, the file to be detected is marked as the file to be detected which passes the difference detection; otherwise, marking the file to be detected as the file to be detected which does not pass the difference detection.
The file difference information can be obtained according to the difference detection result of the file to be detected which does not pass the difference detection, and an email carrying the file difference information is sent to an account of a tester according to a preset notification mode so as to publish the file difference information. The file difference information may further include a difference contrast effect map. Optionally, the file difference information may be displayed in an Extensible Markup Language (XML) format for visual presentation to the tester.
In this embodiment, a source code file and a code identifier are extracted from the file to be detected; searching a historical code file belonging to the same software as the source code file according to the code identifier; and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection. By the method, the source code files and the historical code files are subjected to difference detection, file difference information of each source code file and the corresponding historical code file can be obtained, abnormal conditions such as missing, carrying codes and the like can be found before file extraction, and therefore the new version of the extraction file to be detected can be tested in a targeted mode, workload and communication cost of development and extraction are reduced, and quality of the extraction file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 5, fig. 5 is a schematic flow chart of a fourth embodiment of the method for detecting a test file according to the present invention, and the fourth embodiment of the method for detecting a test file according to the present invention is proposed based on the first embodiment shown in fig. 2. This embodiment is explained based on the first embodiment.
In the fourth embodiment, the step S20 specifically includes:
step S22: and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
It should be noted that, the step of performing file rule detection on the file to be detected according to a preset code policy of a preset file rule policy specifically includes: extracting a code to be detected from the file to be detected; code examination is carried out on the code to be detected; and performing task test on the code to be detected to realize file rule detection.
It should be understood that, for example, based on the management concept of a CCRC (Clear Case Remote Client software) version tree, a version tree may be created for each code branch of a project, in which, each time a code is successfully submitted (the code submitted each time refers to the latest full code from the branch to the submission time), a node is generated for the code successfully submitted this time in the version tree as a new version, and a version identifier is generated for the node, such as a version identifier (the version identifier is also equivalent to a node identifier), and meanwhile, information such as submission time, a submitter ID, and the content of the submitted code may also be included in the node attribute. Optionally, the code to be detected is extracted from the file to be detected, and the code normative check is automatically completed based on the version tree.
In this embodiment, the file rule detection is performed on the file to be detected according to a preset code policy of a preset file rule policy. By the method, when development and test are carried out, code detection is carried out on the file to be detected and tested according to the preset code strategy, the code rule is subjected to prepositive inspection before test, the file subjected to code detection is tested, and the file not subjected to code detection needs to be developed, revised and re-tested, so that the workload and communication cost of development and test are reduced, and the quality of the file to be tested is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 6, fig. 6 is a schematic flow chart of a fifth embodiment of the method for detecting a test file according to the present invention, and a third embodiment of the method for detecting a test file according to the present invention is proposed based on the first embodiment shown in fig. 2 and the fourth embodiment shown in fig. 5. This embodiment is explained based on the fourth embodiment.
In the fifth embodiment, the step S22 specifically includes:
step S220: and extracting the code to be detected from the file to be detected.
It should be noted that, a complete software project code is often composed of multiple branch codes, and in the development process of the software code, a technician can complete the development of the whole project by continuously developing codes for each branch. The method can manage a plurality of different versions of code files submitted by each branch code in the development process based on the management concept of the version tree, and automatically complete code normative check based on the version tree on the basis.
Optionally, the code to be detected is extracted from the file to be detected, and the code normative check is automatically completed based on the version tree.
Step S221: and code examination is carried out on the codes to be detected.
It is easy to understand that the step of performing code review on the code to be detected specifically includes: acquiring a current code identifier of the code to be detected, and determining a target branch code corresponding to the code to be detected according to the current code identifier; obtaining a reference version code corresponding to the target branch code based on the version tree corresponding to the target branch code, wherein the code to be detected and the reference version code belong to the same branch corresponding to the target branch code; and determining a difference code line of the code to be detected compared with the reference version code, and performing preset code normative review on the difference code line to realize code review.
Specifically, the process of determining a difference code line of the code to be detected compared with the reference version code and performing a preset code normative review on the difference code line to implement code review may be: and carrying out UTF-8 encoding format check, format check of method name and attribute name, logical nesting layer number check of codes on the difference code line, and carrying out format check on the file name of the file to be detected where the difference code line is located.
Illustratively, it is specifically checked whether the UTF-8 encoding format is compliant, whether the file name is required all lowercase, whether the method name and attribute name in the code are required all lowercase, whether the logical nesting of the code is not more than three layers at most, and the like.
Step S222: and performing task test on the code to be detected to realize file rule detection.
It is easy to understand that the step of performing task test on the code to be detected to realize file rule detection specifically includes: acquiring a dependent code of the code to be detected, and compiling the dependent code; when the dependent code is compiled, performing task testing of a first preset task on the code to be detected; and after the dependent code is compiled, performing task test of a second preset task on the code to be detected to realize file rule detection.
Specifically, compiling the dependent code of the code to be detected; when the dependent code is compiled, a first preset task, namely a task test of a specified task is carried out; after the dependent code is compiled, a second preset task, namely a task test of the preset task is carried out; acquiring task test results of a specified task and a preset task; and if the task test result is that all the codes pass, determining that the task test on the codes to be detected passes. The first preset task, namely the designated task, needs to perform task testing during compiling, such as Unit Testing (UT), the second preset task, namely the preset task, needs to perform task testing after compiling is completed, such as smoke Test (BVT), the corresponding time is specifically selected according to the characteristics of the Test task to perform task testing, and no repeated description is given here, and all results of the task testing, which are required by the code to be detected to pass the task testing, pass the task testing.
It should be further noted that the process of performing compilation on the dependent code of the code to be detected may include: monitoring whether the dependent code of the code to be detected changes; compiling the changed dependent code; and extracting the library file corresponding to the unchanged dependent code to a specified position so as to directly refer to the library file when compiling the code to be detected. The specific compiling does not need to compile the whole code, because the code to be detected can quote some codes to realize corresponding functions, the quoted code is the dependent code of the code to be detected, therefore, when compiling is carried out, only the changed dependent code needs to be compiled, and for the unchanged dependent code, the library file of the dependent code can be directly extracted to a specified position without executing the process of compiling the dependent code of the code to be detected, so that the realization of the functions is ensured, the resource consumption is reduced, and the efficiency is improved.
It should be understood that the process of task testing the code to be detected may include: searching a task configuration file at a specified position in a configuration library based on the storage path address of the code to be detected, wherein the task configuration file comprises a first preset task, namely the specified task, and a second preset task, namely the preset task; if the task configuration file is not found at the specified position, finding the task configuration file at the position of the father directory at the specified position, and performing task test by using the found task configuration file; if the task configuration file is found at the position of the father path, extracting the found latest task configuration file, and performing task test by using the extracted latest task configuration file; and if the task configuration file is not found at the position of the father path, performing task test based on the preset general configuration.
Specifically, since the task test is required to be performed according to the task configuration file, and the task to be tested may have been performed before, the task configuration file may exist, in this case, the task test may be performed by using the previous task configuration file, and if the task test is performed before, the task configuration file may have an appointed location (which may be found based on the storage path address of the code to be detected), or a location of a parent directory of the appointed location, so that the task test is performed at the appointed location, and if the task test is found, the task test is performed according to the task configuration file; if the task configuration file is not found, searching the position of the father directory, namely searching the position of the upper layer of the specified position, and if the task configuration file is found, performing task test based on the found latest task configuration file; if the task test is not performed before, that is, the task configuration file does not exist, in this case, the task test can be performed based on the general configuration.
And when the code examination passes and the task test passes, determining that the code detection of the code to be detected passes. The file to be detected which passes the code detection can be detected in the next step, the file to be detected which does not pass the code detection can obtain the code detection information according to the code detection result, and an email carrying the code detection information is sent to an account of a tester according to a preset notification mode so as to publish the code detection information.
In the embodiment, the code to be detected is extracted from the file to be detected; code examination is carried out on the code to be detected; and performing task test on the code to be detected to realize file rule detection. By the method, when development and test are carried out, code detection is carried out on the file to be detected and tested according to the preset code strategy, the code rule is subjected to prepositive inspection before test, the file subjected to code detection is tested, and the file not subjected to code detection needs to be developed, revised and re-tested, so that the workload and communication cost of development and test are reduced, and the quality of the file to be tested is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 7, fig. 7 is a flowchart illustrating a sixth embodiment of the method for detecting a test file according to the present invention, and the sixth embodiment of the method for detecting a test file according to the present invention is proposed based on the first embodiment shown in fig. 2. This embodiment is explained based on the first embodiment.
In the sixth embodiment, the step S20 specifically includes:
step S23: and carrying out file rule detection on the file to be detected according to a preset virus strategy of a preset file rule strategy.
It should be noted that, the step of performing file rule detection on the file to be detected according to a preset virus policy of a preset file rule policy specifically includes: acquiring a preset virus set according to a preset virus strategy of a preset file rule strategy; running the file to be detected, monitoring the running behavior of the file to be detected, and generating a log file; and performing virus detection on the log file based on the preset virus set so as to realize file rule detection.
It is easy to understand that, in this embodiment, in addition to the virus detection on the to-be-detected file based on the preset virus set, the virus detection on the to-be-detected file may also be performed by using a heuristic virus analysis technique, an anti-static virus analysis technique, a virtual machine virus detection technique, an active defense (real-time defense) detection technique, and the like, so as to implement the file rule detection.
In this embodiment, the file rule detection is performed on the file to be detected according to a preset virus policy of a preset file rule policy. By the method, when development and test are carried out, virus detection is carried out on the file to be detected and tested according to the preset virus strategy, virus pre-inspection is carried out before test, the file subjected to virus detection is tested, and the file not subjected to virus detection needs to be developed, modified and re-tested, so that the workload and the communication cost of development and test are reduced, and the quality of the file to be tested is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Referring to fig. 8, fig. 8 is a schematic flow chart of a seventh embodiment of the method for detecting a test file according to the present invention, and a fourth embodiment of the method for detecting a test file according to the present invention is proposed based on the first embodiment shown in fig. 2 and the sixth embodiment shown in fig. 7. This embodiment is explained based on the sixth embodiment.
In the seventh embodiment, the step S23 specifically includes:
step S230: and acquiring a preset virus set according to a preset virus strategy of the preset file rule strategy.
It should be noted that, a preset virus set is obtained according to a preset virus policy of a preset file rule policy, where the preset virus set may include a general virus set, and virus detection may have been performed before, so that a detected virus set may exist, in this case, virus detection may be performed using the previously detected virus set, and the preset virus set may also be updated according to an actual situation when a newly added virus occurs.
Step S231: and operating the file to be detected, monitoring the operation behavior of the file to be detected, and generating a log file.
It is easy to understand that the step of operating the file to be detected, monitoring the operation behavior of the file to be detected, and generating the log file specifically includes: carrying out environment initialization operation on the virtual machine running the file to be detected; copying the file to be detected to a fixed directory of a virtual machine; running the file to be detected in the virtual machine; and monitoring the operation behavior of the file to be detected in the operation process through a monitoring tool to generate a log file, and copying the log file from the virtual machine to a fixed directory of a physical machine.
Specifically, the file to be detected is input to the automatic monitoring system, and the automatic monitoring system operates the file to be detected and monitors the operation behavior of the file to be detected to obtain a log file for an analyst to check, so as to quickly know the behavior of malicious files such as viruses. In this embodiment, a virtual software VMware and a monitoring tool Process Monitor tool may be used in the automatic monitoring system, the operation of the virtual machine may be controlled by an auto it script program, and the file output by the automatic control system is a log file (log file obtained by monitoring the Process Monitor) of each file to be detected.
The operation behavior of the file to be detected may include: related operations on files, registries, processes, and network information, such as what files were created, accessed, deleted; setting, creating and deleting which registry keys are deleted; which processes are started and closed; which IP addresses are connected, etc.
Step S232: and performing virus detection on the log file based on the preset virus set so as to realize file rule detection.
It should be noted that the step of performing virus detection on the log file based on the preset virus set to implement file rule detection specifically includes: acquiring the log file from a fixed directory of the physical machine; analyzing the running behavior of the log file; and virus detection is carried out on the operation behavior of the log file through the preset virus set so as to realize file rule detection.
Specifically, a log file of a Process Monitor is generated after each file to be detected runs, the behavior of the file to be detected during running can be known by analyzing the log file, the log file generated after the file to be detected runs is matched with the preset virus set, and if the virus attribute of the log file of the file to be detected matches the virus in the preset virus set, the file to be detected is a file carrying the virus.
Specifically, environment initialization operation is carried out on a virtual machine running a file to be detected; when a file to be detected is operated in an automatic monitoring system and the operation behavior of the file to be detected is monitored, environment initialization operation needs to be performed on a virtual machine in the automatic monitoring system for operating the file to be detected, namely, a virtual machine snapshot is recovered, wherein the snapshot is a previously configured virtual machine environment, a control program, a bat file and the like are arranged in the virtual machine environment, and environment initialization operation is performed on the virtual machine, namely, the virtual machine is made to prepare for operating the file to be detected. Copying the file to be detected to a fixed directory of a virtual machine; and running the file to be detected in the virtual machine, monitoring the running behavior of the file to be detected in the running process through a monitoring tool, and generating a log file. In this embodiment, the file to be tested needs to be copied to the virtual machine for running.
It should be understood that, in this embodiment, the to-be-detected file may also be subjected to virus detection by using a heuristic virus analysis technique, an anti-static virus analysis technique, a virtual machine virus detection technique, an active defense (real-time defense) detection technique, and the like, so as to implement file rule detection.
In this embodiment, a preset virus set is obtained according to a preset virus policy of a preset file rule policy; running the file to be detected, monitoring the running behavior of the file to be detected, and generating a log file; and performing virus detection on the log file based on the preset virus set so as to realize file rule detection. By the method, when development and test are carried out, virus detection is carried out on the file to be detected and tested according to the preset virus strategy, virus pre-inspection is carried out before test, the file subjected to virus detection is tested, and the file not subjected to virus detection needs to be developed, modified and re-tested, so that the workload and the communication cost of development and test are reduced, and the quality of the file to be tested is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
In addition, an embodiment of the present invention further provides a storage medium, where a detection program of a test file is stored on the storage medium, and when the detection program of the test file is executed by a processor, the steps of the detection method of the test file as described above are implemented.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
In addition, referring to fig. 9, an embodiment of the present invention further provides a device for detecting a test file, where the device for detecting a test file includes:
the obtaining module 10 is configured to obtain an extracted file to be detected.
It should be noted that the execution subject of this embodiment is the detection device of the test file, and the detection device of the test file may be an electronic device such as a personal computer or a server, which is not limited in this embodiment. When acquiring the file to be detected, various methods may be adopted, and the following three methods are taken as examples for description, and of course, at least two methods may also be adopted for combination. In addition, the manner of acquiring the file to be detected may also be other manners according to actual needs, which is not limited in this embodiment.
The first mode is as follows: and acquiring a compilation file of the compilation platform, and taking the acquired compilation file as an extraction file to be detected.
The second way is: and acquiring the file uploaded by the terminal equipment, and taking the file uploaded by the terminal equipment as a to-be-detected file.
The third mode is as follows: and acquiring the file uploaded by the web page, and taking the file uploaded by the web page as a file to be detected.
And the detection module 20 is configured to perform file rule detection on the file to be detected according to a preset file rule policy.
It should be noted that the preset file rule policy may include: presetting a difference strategy; the file rule detection of the file to be detected according to the preset file rule strategy comprises the following steps: and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
It is easy to understand that the preset file rule policy may include: presetting a code strategy; the file rule detection of the file to be detected according to the preset file rule strategy comprises the following steps: and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
It is easy to understand that the preset file rule policy may include: presetting a signature strategy; the file rule detection of the file to be detected according to the preset file rule strategy comprises the following steps: according to a preset signature strategy of a preset file rule strategy, file rule detection is carried out on the file to be detected, namely, current signature information is extracted from the file to be detected; searching a verification key corresponding to the file to be detected; and carrying out signature verification detection on the current signature information according to the verification secret key so as to realize file rule detection.
It is easy to understand that the preset file rule policy may include: presetting a virus strategy; the file rule detection of the file to be detected according to the preset file rule strategy comprises the following steps: and carrying out file rule detection on the file to be detected according to a preset virus strategy of a preset file rule strategy.
It should be understood that the preset file rule policy may include: a preset difference policy, a preset code policy, a preset signature policy, and a preset virus policy. The preset file rule policy may also be any combination of the preset difference policy, the preset code policy, the preset signature policy, and the preset virus policy, and the preset file rule policy may also include other test file detection policies that need to be adopted according to actual situations, which is not limited in this embodiment.
And the extracting and testing module 30 is configured to extract and test the to-be-detected extraction file when the to-be-detected extraction file passes the file rule detection.
It should be noted that, during development and extraction, if the preset file rule policy includes: a preset difference policy, a preset code policy, a preset signature policy, and a preset virus policy. And performing file rule detection on the file to be detected according to a preset file rule strategy, if the file to be detected passes all the file rule detections, determining that the file rule detection is passed, and if the file to be detected does not pass any file rule detection, determining that the file rule detection is not passed.
In this embodiment, after step S10, the method for detecting the test file further includes: and taking the file to be detected as an initial file, and storing the initial file to a preset storage area.
Correspondingly, after the step S30, the method for detecting a test file further includes: when the file to be detected passes the extraction, acquiring the initial extraction file from the preset storage area; and distributing the initial test file to corresponding application equipment according to a preset distribution rule.
Specifically, the initial test files of the audit class can be automatically pushed to the audit application device according to the preset distribution rule, the initial test files of the distribution class can be automatically pushed to the distribution application device according to the preset distribution rule, and the initial test files of the bale class can be automatically pushed to the bale application device according to the preset distribution rule. The initial test file is stored in the preset storage area, so that the files are prevented from falling to the ground in the whole detection and test process, the consistency between the files distributed according to the preset distribution rule and the test files to be detected is ensured, and the test quality is improved.
In the embodiment, the file to be detected is acquired; carrying out file rule detection on the file to be detected according to a preset file rule strategy; and when the file to be detected passes the file rule detection, the file to be detected is detected. During development and lifting, file rule detection is carried out on a file to be detected and lifted and tested according to a preset file rule strategy, file rule pre-inspection is carried out before lifting and testing, the file detected through the file rule is tested, and the file not detected through the file rule needs to be developed, revised and lifted and tested again, so that the workload and the communication cost of development and lifting and testing are reduced, and the quality of the lifted and tested file is improved. The method solves the technical problems that in the prior art, the quality problem of the test file exists during development and extraction, so that the later execution of the test is not smooth, and the test and development communication cost is increased.
Other embodiments or specific implementation manners of the detection apparatus for detecting a file according to the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third and the like do not denote any order, but rather the words first, second and the like may be interpreted as indicating any order.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a Read Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, an optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
The invention discloses A1 and a detection method of a test file, which comprises the following steps:
acquiring a to-be-detected file;
carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and when the file to be detected passes the file rule detection, the file to be detected is detected.
A2, the method of A1, the preset file rule policy comprising: presetting a difference strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
The method of A3, as described in a2, the step of performing file rule detection on the file to be detected according to a preset difference policy of a preset file rule policy specifically includes:
extracting a source code file and a code identifier from the file to be detected;
searching a historical code file belonging to the same software as the source code file according to the code identifier;
and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection.
A4, the method as in A3, wherein the step of detecting the difference between the source code file and the history code file specifically includes:
carrying out full-text difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
performing feature difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
carrying out size difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
and performing type difference detection on the source code file and the historical code file.
A5, the method of A1, the preset file rule policy comprising: presetting a code strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
A6, the method as in a5, wherein the step of performing file rule detection on the file to be detected according to a preset code policy of a preset file rule policy specifically includes:
extracting a code to be detected from the file to be detected;
code examination is carried out on the code to be detected;
and performing task test on the code to be detected to realize file rule detection.
A7, the method as in a6, wherein the code review step for the code to be detected specifically includes:
acquiring a current code identifier of the code to be detected, and determining a target branch code corresponding to the code to be detected according to the current code identifier;
obtaining a reference version code corresponding to the target branch code based on the version tree corresponding to the target branch code, wherein the code to be detected and the reference version code belong to the same branch corresponding to the target branch code;
and determining a difference code line of the code to be detected compared with the reference version code, and performing preset code normative review on the difference code line to realize code review.
A8, the method as in A6, wherein the step of performing task test on the code to be detected to realize file rule detection specifically comprises:
acquiring a dependent code of the code to be detected, and compiling the dependent code;
when the dependent code is compiled, performing task testing of a first preset task on the code to be detected;
and after the dependent code is compiled, performing task test of a second preset task on the code to be detected to realize file rule detection.
A9, the method of A1, the preset file rule policy comprising: presetting a signature strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset signature strategy of a preset file rule strategy.
A10, the method as in a9, wherein the step of performing file rule detection on the file to be detected according to a preset signature policy of a preset file rule policy specifically includes:
extracting current signature information from the file to be detected;
searching a verification key corresponding to the file to be detected;
and carrying out signature verification detection on the current signature information according to the verification secret key so as to realize file rule detection.
A11, the method of A1, the preset file rule policy comprising: presetting a virus strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset virus strategy of a preset file rule strategy.
The method of a12, as described in a11, the step of performing file rule detection on the file to be detected according to a preset virus policy of a preset file rule policy specifically includes:
acquiring a preset virus set according to a preset virus strategy of a preset file rule strategy;
running the file to be detected, monitoring the running behavior of the file to be detected, and generating a log file;
and performing virus detection on the log file based on the preset virus set so as to realize file rule detection.
The method of a13, as described in a12, the step of running the file to be tested, monitoring the running behavior of the file to be tested, and generating a log file specifically includes:
carrying out environment initialization operation on the virtual machine running the file to be detected;
copying the file to be detected to a fixed directory of a virtual machine;
running the file to be detected in the virtual machine;
and monitoring the operation behavior of the file to be detected in the operation process through a monitoring tool to generate a log file, and copying the log file from the virtual machine to a fixed directory of a physical machine.
A14, the method as in a13, wherein the step of performing virus detection on the log file based on the preset virus set to realize file rule detection specifically includes:
acquiring the log file from a fixed directory of the physical machine;
analyzing the running behavior of the log file;
and virus detection is carried out on the operation behavior of the log file through the preset virus set so as to realize file rule detection.
A15, the method as in a 1-a 14, wherein after the step of obtaining the test file to be detected, the method for detecting the test file further comprises:
taking the file to be detected as an initial file, and storing the initial file to a preset storage area;
after the step of extracting and testing the file to be tested when the file to be tested passes the file rule detection, the method for detecting the file to be tested further comprises the following steps:
when the file to be detected passes the extraction, acquiring the initial extraction file from the preset storage area;
and distributing the initial test file to corresponding application equipment according to a preset distribution rule.
The method A16 as described in A1-A15, wherein the step of obtaining the test document to be tested specifically includes:
acquiring a compilation file of a compilation platform, and taking the acquired compilation file as a to-be-detected file;
or the like, or, alternatively,
acquiring a file uploaded by the terminal equipment, and taking the file uploaded by the terminal equipment as a file to be detected;
or the like, or, alternatively,
and acquiring the file uploaded by the web page, and taking the file uploaded by the web page as a file to be detected.
The invention also discloses a detection device of the B17 test file, which comprises:
the acquisition module is used for acquiring the file to be detected;
the detection module is used for carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and the extracting and testing module is used for extracting and testing the extracting and testing file to be tested when the extracting and testing file to be tested passes the file rule detection.
B18, the apparatus for detecting files according to B17, wherein the preset file rule policy comprises: presetting a difference strategy;
the detection module is further used for carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
The invention also discloses C19 and the detection equipment of the test file, which comprises: the detection method comprises the steps of a memory, a processor and a detection program of the test file, wherein the detection program of the test file is stored on the memory and can run on the processor, and the detection program of the test file is configured with the steps of realizing the detection method of the test file.
The invention also discloses D20 and a storage medium, wherein the storage medium is stored with the detection program of the test file, and the detection program of the test file realizes the steps of the test file detection method when being executed by a processor.
Claims (10)
1. A detection method for a test file is characterized by comprising the following steps:
acquiring a to-be-detected file;
carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and when the file to be detected passes the file rule detection, the file to be detected is detected.
2. The method for detecting a file under test according to claim 1, wherein the predetermined file rule policy comprises: presetting a difference strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset difference strategy of a preset file rule strategy.
3. The method for detecting the file to be detected according to claim 2, wherein the step of performing the file rule detection on the file to be detected according to the preset difference policy of the preset file rule policy specifically includes:
extracting a source code file and a code identifier from the file to be detected;
searching a historical code file belonging to the same software as the source code file according to the code identifier;
and carrying out difference detection on the source code file and the historical code file so as to realize file rule detection.
4. The method for detecting a test file according to claim 3, wherein the step of performing difference detection on the source code file and the history code file specifically comprises:
carrying out full-text difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
performing feature difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
carrying out size difference detection on the source code file and the historical code file;
and/or the presence of a gas in the gas,
and performing type difference detection on the source code file and the historical code file.
5. The method for detecting a file under test according to claim 1, wherein the predetermined file rule policy comprises: presetting a code strategy;
the step of performing file rule detection on the file to be detected according to a preset file rule strategy specifically comprises the following steps:
and carrying out file rule detection on the file to be detected according to a preset code strategy of a preset file rule strategy.
6. The method for detecting the file to be detected according to claim 5, wherein the step of performing the file rule detection on the file to be detected according to a preset code policy of a preset file rule policy specifically includes:
extracting a code to be detected from the file to be detected;
code examination is carried out on the code to be detected;
and performing task test on the code to be detected to realize file rule detection.
7. The method for detecting a test file according to claim 6, wherein the step of code examining the code to be detected specifically comprises:
acquiring a current code identifier of the code to be detected, and determining a target branch code corresponding to the code to be detected according to the current code identifier;
obtaining a reference version code corresponding to the target branch code based on the version tree corresponding to the target branch code, wherein the code to be detected and the reference version code belong to the same branch corresponding to the target branch code;
and determining a difference code line of the code to be detected compared with the reference version code, and performing preset code normative review on the difference code line to realize code review.
8. A detection device for a test document, comprising:
the acquisition module is used for acquiring the file to be detected;
the detection module is used for carrying out file rule detection on the file to be detected according to a preset file rule strategy;
and the extracting and testing module is used for extracting and testing the extracting and testing file to be tested when the extracting and testing file to be tested passes the file rule detection.
9. A detection device for a test document, comprising: a memory, a processor and a test program of a test file stored on the memory and executable on the processor, the test program of a test file being configured with steps to implement the test method of a test file according to any one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium stores thereon a detection program of a test file, which when executed by a processor implements the steps of the detection method of the test file according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010526978.7A CN113778841A (en) | 2020-06-10 | 2020-06-10 | Detection method, device and equipment for file to be tested and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010526978.7A CN113778841A (en) | 2020-06-10 | 2020-06-10 | Detection method, device and equipment for file to be tested and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113778841A true CN113778841A (en) | 2021-12-10 |
Family
ID=78835209
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010526978.7A Pending CN113778841A (en) | 2020-06-10 | 2020-06-10 | Detection method, device and equipment for file to be tested and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113778841A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116303106A (en) * | 2023-05-26 | 2023-06-23 | 江苏博云科技股份有限公司 | GitFlow software version-based quick rollback method and system suitable for financial industry |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102681835A (en) * | 2010-12-20 | 2012-09-19 | 微软公司 | Code clone notification and architectural change visualization |
CN103559449A (en) * | 2013-11-15 | 2014-02-05 | 华为技术有限公司 | Detection method and device for code change |
CN108920960A (en) * | 2018-07-26 | 2018-11-30 | 北京盘石信用管理有限公司 | A kind of APP safe verification method and system |
US20190114330A1 (en) * | 2017-10-16 | 2019-04-18 | Dropbox, Inc. | Workflow functions of content management system enforced by client device |
CN110134595A (en) * | 2019-04-19 | 2019-08-16 | 平安科技(深圳)有限公司 | Analysis method, device, computer equipment before SVN resource library test |
-
2020
- 2020-06-10 CN CN202010526978.7A patent/CN113778841A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102681835A (en) * | 2010-12-20 | 2012-09-19 | 微软公司 | Code clone notification and architectural change visualization |
CN103559449A (en) * | 2013-11-15 | 2014-02-05 | 华为技术有限公司 | Detection method and device for code change |
US20190114330A1 (en) * | 2017-10-16 | 2019-04-18 | Dropbox, Inc. | Workflow functions of content management system enforced by client device |
CN108920960A (en) * | 2018-07-26 | 2018-11-30 | 北京盘石信用管理有限公司 | A kind of APP safe verification method and system |
CN110134595A (en) * | 2019-04-19 | 2019-08-16 | 平安科技(深圳)有限公司 | Analysis method, device, computer equipment before SVN resource library test |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116303106A (en) * | 2023-05-26 | 2023-06-23 | 江苏博云科技股份有限公司 | GitFlow software version-based quick rollback method and system suitable for financial industry |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9639702B1 (en) | Partial risk score calculation for a data object | |
US8930930B2 (en) | Updating a computer system | |
AU2007329468B2 (en) | Program modification and loading times in computing devices | |
Crussell et al. | Andarwin: Scalable detection of android application clones based on semantics | |
CN108667855B (en) | Network flow abnormity monitoring method and device, electronic equipment and storage medium | |
US8875303B2 (en) | Detecting pirated applications | |
US10289536B2 (en) | Distinguishing public and private code in testing environments | |
KR20110084693A (en) | Method of examining malicious codes and dangerous files in android terminal platform | |
CN112668010B (en) | Method, system and computing device for scanning loopholes of industrial control system | |
CN110569159A (en) | Baffle generation method, device, equipment and computer storage medium | |
US11853422B2 (en) | Detecting malicious components using commit histories | |
CN112580047B (en) | Industrial malicious code marking method, equipment, storage medium and device | |
CN110232279A (en) | A kind of leak detection method and device | |
CN114386032A (en) | Firmware detection system and method for power Internet of things equipment | |
US9336025B2 (en) | Systems and methods of analyzing a software component | |
CN112612502A (en) | Patch generation method, device, equipment and storage medium | |
CN113254577A (en) | Sensitive file detection method, device, equipment and storage medium | |
CN115033894A (en) | Software component supply chain safety detection method and device based on knowledge graph | |
KR101228902B1 (en) | Cloud Computing-Based System for Supporting Analysis of Malicious Code | |
CN113778841A (en) | Detection method, device and equipment for file to be tested and storage medium | |
CN112579330B (en) | Processing method, device and equipment for abnormal data of operating system | |
JP5967225B2 (en) | Data update omission inspection device, data update omission inspection method, data update omission inspection program | |
US20170132413A1 (en) | File clustering using filters working over file attributes | |
CN117272308A (en) | Software security test method, device, equipment, storage medium and program product | |
WO2020230241A1 (en) | Testing device, testing method, and program |
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 |