Software system testing method and device, electronic equipment and storage medium
Through automated testing methods, script programs and sample screening technology are used to solve the problems of low testing efficiency and low accuracy in the existing technology, and more efficient and accurate software system testing is achieved.
Patent Information
- Application Number
- CN202411768327.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
AI Technical Summary
The existing manual testing methods have problems with low testing efficiency and low accuracy, and are prone to manual operation errors.
By determining the sampling data based on the type to be tested, the information generated by the system to be tested is obtained, the sample screening and calculation is performed, and the pre-configured script program is called to generate operation instructions to realize automated testing of the system to be tested.
Improves test efficiency and accuracy, reduces manual intervention, and avoids the tedious process of testers manually executing test cases.
Smart Images

Figure CN119690833A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a testing method, device, electronic device and storage medium for a software system. Background Art
[0002] In today's digital age, software systems have been widely used in various fields, from daily mobile applications and office software to complex industrial control systems and financial trading platforms. The quality and reliability of software systems are directly related to user experience, business operations and even the stable development of social economy. Therefore, comprehensive and effective testing of software systems has become a key link in ensuring software quality.
[0003] At present, manual testing still dominates the testing phase of many software projects. Manual testing mainly relies on professional testers. In actual operation, testers need to operate on the software system step by step according to the pre-designed test plan. For example, for a mobile application, testers may need to manually click on various menu options, enter different types of text data, simulate operation behaviors in various user scenarios, and carefully observe the response of the software, and record any abnormal phenomena that occur, such as interface freezes, functional failures, data display errors, etc.
[0004] However, software systems usually include many functions and the testing process is complicated. At present, the existing manual testing methods have the problem of low testing efficiency, and manual operations are prone to errors, resulting in low test accuracy. Summary of the invention
[0005] The present application provides a software system testing method, device, electronic device and storage medium, which can improve testing efficiency and testing accuracy.
[0006] In a first aspect, the present application provides a method for testing a software system, comprising:
[0007] Determine sampling data based on the type to be tested, obtain information generated by the system to be tested in the current time period according to the sampling data, and obtain a sample to be tested;
[0008] Performing a screening calculation on the sample to be tested based on the screening method corresponding to the type to be tested to obtain a sample screening result;
[0009] A preconfigured script program is called, and the script program is operated according to the sample identification result to generate an operation instruction, so as to implement the test of the samples to be tested generated by the system to be tested within the current time period based on the operation instruction.
[0010] In a second aspect, the present application provides a testing device for a software system, the device comprising:
[0011] An information acquisition module determines sampling data based on the type to be tested, acquires information generated by the system to be tested in the current time period according to the sampling data, and obtains a sample to be tested;
[0012] A sample calculation module, used to perform a discrimination calculation on the sample to be tested based on the discrimination method corresponding to the type to be tested, and obtain a sample discrimination result;
[0013] The instruction generation module is used to call a preconfigured script program, operate the script program according to the sample screening result, and generate an operation instruction to implement the test of the samples to be tested generated by the system to be tested within the current time period based on the operation instruction.
[0014] In a third aspect, the present application further provides an electronic device, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the testing method of the software system described in any embodiment of the present application.
[0018] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the testing method of the software system described in any embodiment of the present application when executed.
[0019] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the testing method of the software system described in any embodiment of the present application.
[0020] The test scheme of the software system provided by the embodiment of the present application first determines the sampling data by the type to be tested, and obtains the information generated by the system to be tested in the current time period through the sampling data to obtain the sample to be tested. This method of obtaining the sample to be tested by defining the sampling data is helpful for the accurate collection of the sample to be tested; then the sample to be tested is screened and calculated by the identification method corresponding to the type to be tested to obtain the sample identification result, which is helpful for the identification of multiple types of samples generated by the system to be tested, and improves the universality of the scheme; finally, by calling the pre-configured script program, the script program is operated according to the sample identification result, and the operation instruction is generated to implement the test method of the sample to be tested generated by the system to be tested in the current time period based on the operation instruction. The pre-configured script program can be adjusted and modified according to the specific test requirements and different systems to be tested. The test scheme provided by this embodiment is that the entire test process is automatically performed based on pre-set rules and procedures, which greatly reduces manual intervention. Compared with traditional manual testing, there is no need for testers to manually execute test cases one by one, which has the beneficial effect of improving test efficiency and test accuracy.
[0021] It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer-readable storage medium may be packaged together with the processor of the test device of the software system, or may be packaged separately from the processor of the test device of the software system, and this application does not limit this.
[0022] The description of the second, third, fourth and fifth aspects of the present application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
[0024] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, and usage scenarios of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a flowchart of a method for testing a software system provided in an embodiment of the present application;
[0027] Figure 2 is a structural diagram of a testing device for a software system provided in an embodiment of the present application;
[0028] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the present application will be clearly and completely described below in conjunction with the drawings in the present embodiment. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0032] Figure 1A flowchart of a method for testing a software system provided in an embodiment of the present application is provided. This embodiment is applicable to the case of performing automated testing on a software system to be tested. The method can be executed by a testing device for the software system, which can be implemented in the form of hardware and / or software and integrated in an electronic device that executes the method. Preferably, the electronic device in the embodiment of the present application can be a server, or a computer device, etc.
[0033] refer to Figure 1 The testing method of the software system of this embodiment includes but is not limited to the following steps:
[0034] S110 . Determine sampling data based on the type to be tested, obtain information generated by the system to be tested in the current time period according to the sampling data, and obtain a sample to be tested.
[0035] The test type indicates the sample type corresponding to the sampling sample. Generally, the test type may include various types, such as testing business functions, testing response time, testing system compatibility, and data security, depending on the different business functions implemented by the system under test.
[0036] The sampling data represents the corresponding configuration data when obtaining the sample to be tested. When the type to be tested is different, the sampling data of the sample to be tested has certain differences. For example, when the type to be tested is audio, the sampling data may include the sampling source (such as microphone, audio playback device, etc.), sampling frequency (such as 8kHz, 44.1kHz, etc., depending on specific needs), sampling duration, etc.; if the type to be tested is an image, the sampling data may involve the acquisition type (such as screenshot, camera shooting, etc.), acquisition area (a specific area on the screen or a specific range of camera shooting), relative displacement (relative movement rules of the acquisition area), and the storage location of the acquired image. Different types to be tested need to collect information of different characteristics, so it is necessary to determine the various configuration parameters of the sampling data according to the characteristics of the type to be tested to ensure that suitable and useful samples to be tested can be obtained. The sampling data defined under different specific sampling types is not limited here.
[0037] Furthermore, by running the system to be tested, the input information, output information, etc. of the system to be tested in the current time period are captured based on the sampling data, so that the captured information that meets the sampling data is used as the sample to be tested, and subsequent analysis steps are performed. For example, when testing a game software, the screen display information, the status information of the character in the game, etc. can be automatically intercepted according to the sampling data. The method provided by this embodiment can automatically obtain the sample to be tested from the system to be tested, and the sample content to be obtained is determined by defining the sampling data, without manual operation.
[0038] In the application scenario provided in this embodiment, the application to mixed multimedia identification is taken as an example for explanation. In multimedia identification technology, the signal type includes two types: audio type and image type. Among them, the video type is also a process of analyzing by dividing the video stream into frame images. Therefore, when testing the video type, it can be analyzed by separately collecting the audio and image in the current video. Optionally, in the actual system architecture, a dual-channel thread can be set for data processing, such as including an image recognition thread and a speech recognition thread; to start the corresponding thread operation according to the current type to be tested, so as to achieve the purpose of improving thread utilization and processing speed.
[0039] In a preferred embodiment, when the type to be tested includes an audio type, the sample to be tested includes the audio to be tested; accordingly, the sampling data includes a sampling source, a sampling frequency, and a sampling duration. Among them, the sampling source refers to the specific source or origin of the acquired signal when collecting signals (such as audio, video, etc.), such as a microphone, a pickup of a musical instrument, an output end of an audio playback device, etc.; the sampling frequency refers to the number of samples taken per unit time when the analog signal is digitally sampled, usually in Hertz (Hz). The higher the sampling frequency, the more accurately the obtained digital signal can reflect the characteristics of the original analog signal; the sampling channel refers to the number of independent sound channels involved in the process of collecting, processing, and playing audio signals, which reflects the spatial distribution of the audio signal. Different channel configurations can create different auditory effects. For example, it can include mono, stereo, or multi-channel (such as 5.1 channels, 7.1 channels, etc.).
[0040] Correspondingly, when the sampling type is an audio type, the implementation of the above step S110 is as follows: determine the audio input device from the system to be tested based on the sampling source; intercept the signal generated by the audio input device in the current time period based on the sampling frequency and sampling duration to obtain the audio to be tested.
[0041] In a computer system, if the sampling source is specified as a microphone, it is first necessary to identify the microphone devices available in the system. Optionally, when a microphone array is included in the actual application scenario, the sampling source can also be located to a specific microphone identifier, thereby achieving the purpose of determining the audio input device based on the sampling source.
[0042] After the sampling data is determined based on the type of audio to be tested, for example, the sampling source is determined to be a microphone, the sampling frequency is 44.1kHz, and the sampling duration is 30 seconds, the signal can be intercepted through audio settings and related audio recording software. First, make sure that the microphone is correctly identified and enabled in the audio settings, and then set the sampling frequency and sampling duration in the recording software. The software will collect audio signals from the microphone at the set frequency within the specified time, and finally obtain the audio to be tested.
[0043] In another preferred embodiment, when the type to be tested includes an image type, the sample to be tested includes the image to be tested; accordingly, the sampling data includes an acquisition area and acquisition coordinates; wherein the acquisition area defines a specific range for obtaining image information from the system to be tested, and the current range can be limited based on a rectangular frame or a circle; the acquisition coordinates are used to accurately specify the position information of a certain point on the screen, and are usually determined based on a coordinate system with the upper left corner of the screen as the origin (0,0). The role of the acquisition coordinates is to provide a more accurate positioning reference for the acquisition area. For example, setting the acquisition area to a 2cm*2cm rectangle, and further positioning the rectangle based on the acquisition coordinates, can clarify that the image to be tested is a rectangle in a specific position on the screen, which helps to accurately capture the image.
[0044] Correspondingly, when the sampling type is an image type, the implementation of the above step S110 is as follows: a screen image generated by the system to be tested is obtained, and a collection area is intercepted from the screen image based on the collection coordinates in the current time period to obtain the image to be tested.
[0045] In the actual screen image acquisition operation, once the acquisition area and acquisition coordinates are set, the program will capture images from the screen image based on the current parameters to obtain the image to be tested that meets the requirements. Optionally, the screen capture and window capture of the image acquisition in this embodiment can be implemented based on the image interception technology. In terms of system architecture design, in order to improve the processing efficiency of graphics and reduce memory loss, the system can first process the acquired graphics by region, and then perform sub-image cutting operations on the regions to avoid operating on the entire screen / or window graphics every time.
[0046] S120, performing identification calculation on the sample to be tested based on the identification method corresponding to the type to be tested, and obtaining a sample identification result.
[0047] The purpose of identifying the samples to be tested is to extract the corresponding sample features from the samples to be tested obtained at the current moment, so that the subsequent steps can determine the corresponding control instructions based on the current sample features. For example, for audio samples, the similarity value with the sample voice, the voice content recognition result, etc. are extracted; for image samples, the text information, digital information, color features, texture features, shape features, pixel brightness and pixel mean in the image are extracted. The identification results obtained for different types of tests are not limited here.
[0048] In a preferred embodiment, when the sample type is an image type, the corresponding identification method includes an audio fingerprint comparison algorithm. Specifically, the implementation method of the above step S120 is as follows: obtain the sample audio generated by the sampling source, the frequency and duration corresponding to the sample audio are the same as the frequency and sampling duration corresponding to the audio to be tested; perform speech vector processing on the sample audio and the audio to be tested respectively to obtain a sample vector and a vector to be tested; determine the similarity result of the sample vector and the vector to be tested based on the audio fingerprint comparison algorithm, and determine the similarity result and the audio identifier corresponding to the audio to be tested as the sample identification result.
[0049] Specifically, when the sample audio and the audio to be tested are processed by speech vector respectively, preprocessing can be performed in advance, such as removing noise, performing audio normalization and other operations to improve the audio quality and make it more suitable for subsequent analysis. Then, a specific speech feature extraction algorithm is used to convert the sample audio and the audio to be tested into vector forms that can represent their speech features, that is, to obtain the sample vector and the vector to be tested; finally, the audio fingerprint comparison algorithm determines the similarity result, and the similarity result can be output as a score. If the difference is large, no score will be obtained, and the identification result of the audio to be tested cannot be obtained; in the case of a score, the larger the score, the higher the similarity. Because audio recognition consumes a lot of energy, it requires continuous audio collection, segmentation and comparison. The speech recognition thread can be set to a maximum length of 30 seconds. If there is no audio input within 30 seconds or there is no similar result in the comparison, the thread enters a waiting state. The audio acquisition and identification module currently supports data input from multiple sound cards and multiple microphones.
[0050] The sample audio is pre-stored audio that comes from the same sampling source as the audio to be tested and has the same sampling frequency and duration.
[0051] For the current audio to be tested, the corresponding identification result can be output as: audio a, the similarity result is 95%, so that the current identification result can be output to step S130 for subsequent analysis.
[0052] In another preferred embodiment, when the sample type is an image type, the corresponding identification method includes at least one of image comparison, pixel calculation, and / or character information recognition. The identification method used for the specific image to be tested can be defined in advance in the sampling data according to the actual test requirements. The algorithm corresponding to the identification identifier is used for calculation in the current step to obtain the sample identification result.
[0053] Specifically, the implementation of the above step S120 is as follows: when the identification method includes image comparison, image identification calculation is performed on each pixel in the image to be tested to obtain the similarity result between the image to be tested and the sample image; specifically, when the current test requirement includes similarity identification, first obtain the sample image from the disk, and the sample image is an image generated at the same position on the screen as the image to be tested, that is, the acquisition area and acquisition coordinates are the same. Then, based on calculating the RBG difference for each pixel in the sample image and the image to be tested, the RBG difference corresponding to each pixel is squared to obtain a positive integer, and finally all are added to obtain the similarity result. The smaller the result obtained, the more similar the sample image and the image to be tested are.
[0054] Optionally, when the discrimination method includes pixel calculation, pixel average calculation is performed for each pixel point in the image to be tested to obtain the pixel mean and pixel brightness of the image to be tested; specifically, the average values of R, G, and B are calculated for the RGB values of the pixels within the region based on the image average pixel algorithm, and the brightness value is calculated according to the brightness algorithm (grayLevel=R*0.299+G*0.587+B*0.114), and then transmitted to the instruction system, and the instruction system makes the final judgment. Usually, the instruction system can judge what color the current image is biased towards based on the range of each (R, G, B) color, and make a judgment. The brightness can tell whether the current area is brighter or darker. Generally speaking, grayLevel>=192 can determine that the area is darker. This discrimination operation is less than the above picture comparison operation and is more efficient.
[0055] Optionally, when the identification method includes character information recognition, character information in the image to be tested is obtained based on an optical character recognition algorithm; this embodiment integrates a text recognition algorithm to obtain text information and character information contained in the image to be tested, so as to clarify the text content and digital content contained in the image to be tested.
[0056] Finally, the image identification and similarity result, pixel mean, pixel brightness, and / or character information of the image to be tested are determined as the sample identification result of the image to be tested. For example, the sample identification result of the current image to be tested may be: image a, similarity is 90%, pixel mean is A1, pixel brightness is A2, character information is 123456, etc.
[0057] S130, calling a pre-configured script program, operating the script program according to the sample screening result, generating an operation instruction, so as to implement the test of the samples to be tested generated by the system to be tested in the current time period based on the operation instruction.
[0058] The preconfigured script program is written according to the test requirements. The script is operated according to the identification result parameters to generate operation instructions, which allows the entire test process to be carried out according to the predetermined logic. For example, multiple instruction logics related to audio similarity are pre-defined in the script program. When the current audio similarity is 95%, one of the instruction logics is that when the audio similarity is detected to be greater than 90%, operation A is triggered. At this time, the script program is run based on the current audio identification result, and the generated operation instruction is A.
[0059] During the running test of the system to be tested, the current time period can be 1 second or 2 seconds. Multiple samples to be tested will be collected within one time period based on the sampling data. Then, for the identification results corresponding to each sample to be tested, the above-mentioned step S130 can be used to perform calculations based on the script program to obtain the test results of the samples to be tested captured within the current time period.
[0060] Another preferred embodiment, in this embodiment, the script program includes multiple pre-configured instruction logics, and the instruction logics are related to the sample identification results; the sample identification results include at least one; specifically, the above step S130 can be implemented in the following manner: based on the time sequence, the corresponding target instruction logic is matched from multiple instruction logics for each sample identification result in turn; the target instruction logic corresponding to each sample identification result is run to generate an operation instruction.
[0061] Specifically, in the script program including multiple pre-configured instruction logics, if-elif-else statements can be used for conditional judgment to execute corresponding instruction logic according to different identification results to obtain target instructions. For example, if the identification result parameter indicates that the volume of the audio is lower than a certain threshold, the script program may generate an operation instruction through calculation to increase the volume setting of the audio input device, etc.; and then after each identification result is matched to the corresponding instruction logic, the operation instruction of the sample to be tested in the current time period can be obtained. For example, in case A, type with the mouse; in case B, click the space bar, etc.
[0062] In another preferred embodiment, the solution provided in this embodiment, after the script program is operated according to the sample screening result to generate the operation instruction, also includes: packaging the operation instruction and sending it to the target device.
[0063] The purpose of encapsulating the generated operation instructions is mainly to facilitate accurate transmission and identification between different system environments, network environments or devices. The encapsulation process can add necessary protocol headers, verification information, etc. to the operation instructions to ensure that the instructions will not be lost, wrong or tampered with during transmission, and at the same time enable the target device to correctly parse and execute these instructions. The target device in this embodiment can be a physical device, such as a printer, keyboard or mouse, so that the control of the target device can be achieved through operation instructions to achieve the effect of closed-loop testing.
[0064] Furthermore, after the operation instruction is sent to the target device, the solution provided in this embodiment further includes: monitoring the operation result of the target device executing the operation instruction, and using the operation result as the input of the script program to optimize the script program. By monitoring the operation result of the target device executing the operation instruction, this solution can understand whether the target device executes the operation instruction as expected, and obtain the corresponding execution result, which is helpful to timely discover problems, such as whether the instruction fails to execute on the target device, whether the execution result is inconsistent with expectations, etc., so that corresponding measures can be taken to correct or optimize.
[0065] In this embodiment, the operation result is used as the input of the script program, so that the script program can perform subsequent operations and decisions according to the actual execution situation. For example, if the operation result shows that the target device fails to execute a certain operation instruction, the script program can regenerate a new operation instruction based on this input and try to take a different operation method to achieve the expected purpose; or if the operation result shows that the target device obtains a result that partially meets the expectations but is still insufficient after executing the instruction, the script program can adjust the subsequent instruction generation logic based on this input to optimize the operation process.
[0066] The testing method of the software system provided in this embodiment first determines the sampling data by the type to be tested, and obtains the information generated by the system to be tested in the current time period through the sampling data to obtain the sample to be tested. This method of obtaining the sample to be tested by defining the sampling data is helpful for the accurate collection of the sample to be tested; then the sample to be tested is screened and calculated by the identification method corresponding to the type to be tested to obtain the sample identification result, which is helpful for the identification of multiple types of samples generated by the system to be tested and improves the universality of the scheme; finally, by calling the pre-configured script program, the script program is operated according to the sample identification result, and the operation instruction is generated to implement the test method of the sample to be tested generated by the system to be tested in the current time period based on the operation instruction. The pre-configured script program can be adjusted and modified according to the specific test requirements and different systems to be tested. In the test scheme provided in this embodiment, the entire test process is automatically performed based on pre-set rules and procedures, which greatly reduces manual intervention. Compared with traditional manual testing, there is no need for testers to manually execute test cases one by one, which has the beneficial effect of improving test efficiency and test accuracy.
[0067] Figure 2 1 is a schematic diagram of a structure of a testing device for a software system provided in an embodiment of the present application, and the device is suitable for executing a testing method for a software system provided in an embodiment of the present application. Figure 2 As shown, the device may specifically include:
[0068] The information acquisition module 210 determines sampling data based on the type to be tested, and acquires information generated by the system to be tested in the current time period according to the sampling data to obtain a sample to be tested;
[0069] The sample calculation module 220 is used to perform a discrimination calculation on the sample to be tested based on the discrimination method corresponding to the type to be tested, and obtain a sample discrimination result;
[0070] The instruction generation module 230 is used to call a preconfigured script program, operate the script program according to the sample screening result, and generate an operation instruction to implement the test of the samples to be tested generated by the system to be tested in the current time period based on the operation instruction.
[0071] The testing device for the software system provided in this embodiment first determines the sampling data by the type to be tested, and obtains the information generated by the system to be tested in the current time period through the sampling data to obtain the sample to be tested. This method of obtaining the sample to be tested by defining the sampling data is helpful for the accurate collection of the sample to be tested; then the sample to be tested is screened and calculated by the identification method corresponding to the type to be tested to obtain the sample identification result, which is helpful for the identification of multiple types of samples generated by the system to be tested and improves the universality of the scheme; finally, by calling the pre-configured script program, the script program is operated according to the sample identification result, and the operation instruction is generated to implement the test method of the sample to be tested generated by the system to be tested in the current time period based on the operation instruction. The pre-configured script program can be adjusted and modified according to the specific test requirements and different systems to be tested. In the test scheme provided in this embodiment, the entire test process is automatically performed based on pre-set rules and procedures, which greatly reduces manual intervention. Compared with traditional manual testing, there is no need for testers to manually execute test cases one by one, which has the beneficial effect of improving test efficiency and test accuracy.
[0072] In one embodiment, when the type to be tested includes an audio type, the sample to be tested includes the audio to be tested; accordingly, the sampling data includes a sampling source, a sampling frequency, and a sampling duration;
[0073] The information acquisition module 210 is specifically used to determine the audio input device from the system to be tested based on the sampling source; intercept the signal generated by the audio input device in the current time period based on the sampling frequency and the sampling duration to obtain the audio to be tested.
[0074] In one embodiment, the identification method includes an audio fingerprint comparison algorithm;
[0075] The sample calculation module 220 is specifically used to obtain the sample audio generated by the sampling source, the corresponding frequency and duration of the sample audio are the same as the sampling frequency and sampling duration corresponding to the audio to be tested; perform speech vector processing on the sample audio and the audio to be tested respectively to obtain a sample vector and a vector to be tested; determine the similarity result between the sample vector and the vector to be tested based on the audio fingerprint comparison algorithm, and determine the similarity result and the audio identifier corresponding to the audio to be tested as the sample identification result.
[0076] In one embodiment, when the type to be tested includes an image type, the sample to be tested includes an image to be tested; accordingly, the sampling data includes a collection area and a collection coordinate;
[0077] The information acquisition module 210 is specifically used to acquire the screen image generated by the system to be tested, and to capture the acquisition area from the screen image based on the acquisition coordinates in the current time period to obtain the image to be tested.
[0078] In one embodiment, the identification method includes at least one of image comparison, pixel calculation, and / or character information recognition;
[0079] The sample calculation module 220 is specifically used to perform image recognition calculation on each pixel point in the image to be tested to obtain a similarity result between the image to be tested and the sample image when the recognition method includes the image comparison; to perform pixel average calculation on each pixel point in the image to be tested to obtain a pixel mean and pixel brightness of the image to be tested when the recognition method includes pixel calculation; to obtain character information in the image to be tested based on an optical character recognition algorithm when the recognition method includes character information recognition; and to determine the image identification of the image to be tested and the similarity result, the pixel mean, the pixel brightness, and / or the character information as a sample recognition result of the image to be tested.
[0080] In one embodiment, the script program includes a plurality of preconfigured instruction logics, wherein the instruction logics are related to the sample identification results; the sample identification results include at least one;
[0081] The instruction generation module 230 is specifically used to match the corresponding target instruction logic from the multiple instruction logics for each sample identification result in turn based on the time sequence; run the target instruction logic corresponding to each sample identification result to generate the operation instruction.
[0082] In one embodiment, the device further includes an instruction sending module and a program optimization module, wherein:
[0083] An instruction sending module, used for packaging the operation instruction and sending it to the target device;
[0084] The program optimization module is used to monitor the operation result of the target device executing the operation instruction, and use the operation result as the input of the script program to optimize the script program.
[0085] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0086] An embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the testing method of the software system described in any embodiment of the present application.
[0087] An embodiment of the present application further provides a computer-readable medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the software system testing method described in any embodiment of the present application when executed.
[0088] Reference below Figure 3 , Figure 3 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and shows a schematic diagram of the structure of a computer system 500 suitable for implementing the electronic device in an embodiment of the present application. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0089] like Figure 3 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0090] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0091] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.
[0092] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, etc., or any suitable combination of the above.
[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] The modules and / or units involved in the embodiments described in the present application may be implemented by software or hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as: a processor includes an information acquisition module, a sample calculation module, and an instruction generation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0095] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: determining sampling data based on the type to be tested, obtaining information generated by the system to be tested in the current time period according to the sampling data, and obtaining the sample to be tested; performing discrimination calculations on the sample to be tested based on the discrimination method corresponding to the type to be tested, and obtaining the sample discrimination result; calling a preconfigured script program, operating the script program according to the sample discrimination result, and generating an operation instruction, so as to implement the test of the sample to be tested generated by the system to be tested in the current time period based on the operation instruction.
[0096] According to the technical solution of this embodiment, the entire test process is automatically performed based on pre-set rules and procedures, greatly reducing manual intervention. Compared with traditional manual testing, testers do not need to manually execute test cases one by one, achieving the beneficial effect of improving test efficiency and test accuracy.
[0097] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A software system testing method, characterized in that: include: Determine sampling data based on the type to be tested, obtain information generated by the system to be tested in the current time period according to the sampling data, and obtain a sample to be tested; Performing a screening calculation on the sample to be tested based on the screening method corresponding to the type to be tested to obtain a sample screening result; A preconfigured script program is called, and the script program is operated according to the sample identification result to generate an operation instruction, so as to implement the test of the samples to be tested generated by the system to be tested within the current time period based on the operation instruction.
2. The software system testing method according to claim 1, characterized in that: When the type to be tested includes an audio type, the sample to be tested includes the audio to be tested; accordingly, the sampling data includes a sampling source, a sampling frequency and a sampling duration; The step of acquiring information generated by the system to be tested in the current time period according to the sampling data to obtain the sample to be tested includes: Determine an audio input device from the system under test based on the sampling source; The signal generated by the audio input device in the current time period is intercepted based on the sampling frequency and the sampling duration to obtain the audio to be tested.
3. The software system testing method according to claim 2, characterized in that: The identification method includes an audio fingerprint comparison algorithm; The performing discrimination calculation on the sample to be tested based on the discrimination method corresponding to the type to be tested to obtain the sample discrimination result includes: Acquire a sample audio generated by the sampling source, wherein the frequency and duration of the sample audio are the same as the sampling frequency and duration of the audio to be tested; Performing speech vector processing on the sample audio and the audio to be tested respectively to obtain a sample vector and a vector to be tested; A similarity result between the sample vector and the vector to be tested is determined based on the audio fingerprint comparison algorithm, and the similarity result and an audio identifier corresponding to the audio to be tested are determined as the sample identification result.
4. The software system testing method according to claim 1, characterized in that: When the type to be tested includes an image type, the sample to be tested includes an image to be tested; accordingly, the sampling data includes a collection area and a collection coordinate; The step of acquiring information generated by the system to be tested in the current time period according to the sampling data to obtain the sample to be tested includes: A screen image generated by the system to be tested is acquired, and the acquisition area is intercepted from the screen image based on the acquisition coordinates in a current time period to obtain the image to be tested.
5. The software system testing method according to claim 4, characterized in that: The identification method includes at least one of image comparison, pixel calculation, and / or character information recognition; The performing discrimination calculation on the sample to be tested based on the discrimination method corresponding to the type to be tested to obtain the sample discrimination result includes: When the identification method includes the image comparison, performing image identification calculation on each pixel point in the image to be tested to obtain a similarity result between the image to be tested and the sample image; When the identification method includes pixel calculation, pixel average calculation is performed on each pixel point in the image to be tested to obtain the pixel mean and pixel brightness of the image to be tested; When the identification method includes character information recognition, obtaining character information in the image to be tested based on an optical character recognition algorithm; The image identification of the image to be tested and the similarity result, the pixel mean, the pixel brightness, and / or the character information are determined as the sample identification result of the image to be tested.
6. The software system testing method according to claim 1, characterized in that: The script program includes a plurality of pre-configured instruction logics, wherein the instruction logics are related to the sample identification results; The sample screening results include at least one; The step of operating the script program according to the sample identification result to generate an operation instruction includes: Matching corresponding target instruction logic from the plurality of instruction logics for each sample identification result in turn based on a time sequence; Run the target instruction logic corresponding to each of the sample identification results to generate the operation instruction.
7. The software system testing method according to claim 1, characterized in that: After the script program is operated according to the sample identification result to generate an operation instruction, the method further includes: Encapsulating the operation instruction and sending it to the target device; Accordingly, the method further comprises: The operation result of the target device executing the operation instruction is monitored, and the operation result is used as the input of the script program to optimize the script program.
8. A testing device for a software system, characterized in that: include: An information acquisition module determines sampling data based on the type to be tested, acquires information generated by the system to be tested in the current time period according to the sampling data, and obtains a sample to be tested; A sample calculation module, used to perform a discrimination calculation on the sample to be tested based on the discrimination method corresponding to the type to be tested, and obtain a sample discrimination result; The instruction generation module is used to call a preconfigured script program, operate the script program according to the sample screening result, and generate an operation instruction to implement the test of the samples to be tested generated by the system to be tested within the current time period based on the operation instruction.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the software system testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the software system testing method according to any one of claims 1 to 7 is implemented.