Test method and platform of target capture square wave signal frequency calculation module
By formulating targets to capture square wave signal waveform templates and generating single-cycle adjustable signals, the problem that existing testing technologies cannot simulate the dynamic changes of the seeker output signal is solved, and a large number of tests are achieved more accurate and comprehensive, improving the efficiency and quality of software testing.
Patent Information
- Application Number
- CN202510288054.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-05-09
AI Technical Summary
Existing testing technologies cannot fully and accurately simulate the dynamic changes of the target capture square wave signal output by the seeker, resulting in insufficient software test results and it is difficult to reflect the software's true performance in complex signal environments.
By analyzing the target capture square wave signal frequency calculation module, we formulate the target capture square waveform template required for the test, and generate a single-cycle adjustable target capture square wave signal to achieve more accurate frequency calculation functional testing and boundary testing.
It improves the adequacy and reliability of the test, ensures the comprehensiveness and accuracy of the test results, and improves the efficiency and quality of software testing.
Smart Images

Figure CN119959896A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a testing method and platform for a target capture square wave signal frequency calculation module. Background Art
[0002] In the contemporary advanced electronic system architecture, the seeker undoubtedly occupies a core position. As a key component for target detection and tracking, its performance is directly related to the performance of the entire system. During the mission of the seeker, once the target is successfully locked, it will output a very characteristic target acquisition signal in the form of a square wave. It is worth noting that the frequency of this signal is not constant, but is closely related to the scanning and processing cycle of the seeker itself, and continues to fluctuate within a given frequency range. This dynamic change characteristic precisely reflects the working strategy adopted by the seeker in a complex and changing environment to achieve continuous and accurate monitoring and stable tracking of the target. The software under test plays an extremely important role in the operation of the entire electronic system. It mainly uses the interrupt mechanism to accurately collect the time difference between the rising edge and the falling edge of the target capture square wave signal, and then obtains the frequency value of the signal through complex and accurate algorithm calculations. Based on this frequency calculation result, the software will further perform key operations, that is, according to the frequency judgment result, flexibly set or clear the target capture flag, so as to accurately feedback the real-time status information of the target capture to other related modules in the system. In the process of dynamic testing of the software, in order to ensure the comprehensiveness and accuracy of the test results, it is necessary to highly simulate the signal input conditions in real scenarios, aiming to comprehensively test the reliability of the frequency calculation function and the stability of the performance of the software when it continuously receives the target capture signal whose frequency changes randomly within a specific range. However, looking back at the test methods used in the past, many disadvantages have gradually emerged. In traditional practices, it is more common to use a signal generator to output a set of square wave signals with a fixed period for testing. Although this method is relatively simple in operation, due to the significant difference in frequency characteristics between the square wave signal with a fixed period and the actual target capture signal, it is impossible to truly reproduce the dynamic change process of the signal in the actual working scenario, resulting in the test process being unable to fully cover the functional performance of the software in a complex signal environment, and ultimately making it difficult for the test results to fully reflect the true performance of the software. Another test strategy that was often used in the past is to send a square wave signal that changes according to a specific rule. However, in actual operation, this method encountered serious technical difficulties. Since it is difficult to accurately control the frequency value of the square wave signal in each software processing cycle, it is impossible to obtain effective theoretical expected results conveniently and accurately during the test process. This makes it difficult to conduct a scientific and reasonable comparison and analysis between the actual measured results and the expected results in the subsequent data comparison link, which greatly increases the difficulty of the test work and makes it difficult for the test work to achieve the expected results and goals. In summary, in order to significantly improve the accuracy and integrity of software testing, it is urgent to develop a target acquisition square wave signal generation scheme that can flexibly achieve single-cycle adjustable frequency. This scheme aims to simulate the target acquisition signal actually output by the seeker with high fidelity, thereby overcoming this key technical problem in the field of electronic system testing and promoting the level of electronic system performance testing to a new level. Summary of the invention
[0003] In view of the above problems, the purpose of the present invention is to provide a test method and platform for a target capture square wave signal frequency calculation module. By analyzing the target capture square wave signal frequency calculation module, a target capture square wave signal waveform template required for the test is formulated; a single-cycle adjustable target capture square wave signal that meets the requirements is generated, so as to more accurately perform target capture square wave signal frequency calculation function testing, boundary testing, etc., thereby improving the adequacy and reliability of the test.
[0004] The above-mentioned object of the present invention is achieved through the following technical solutions: A method for testing a target capture square wave signal frequency calculation module, comprising: S1: Analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test; S2: generating a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template according to the target capture square wave signal waveform template; S3: Select a target capture square wave signal waveform template, and input the matched target capture square wave signal into the module under test through the IO port; S4: Execute the module under test to determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
[0005] Furthermore, in step S1, the target capture square wave signal waveform template formulated includes: Signal initial state, signal end state, signal frequency / period and change pattern; Among them, the initial state of the signal determines the starting conditions of the test, the end state of the signal provides a clear mark for the termination of the test, the signal frequency / period is set in a reasonable range according to the actual application scenario, and the change law reflects the changing trend of the frequency over time.
[0006] Furthermore, the signal frequency / period range covers special cases specified in the requirements, including valid values, invalid values and boundary values, as well as multiples of conventional frequencies / periods.
[0007] Furthermore, in step S2, it includes: The signal frequency / period of the target capture square wave signal is converted into a set of 1-0 sequences, 1 is a high level, and 0 is a low level. In each processing cycle, whether the high and low levels are switched is determined according to the target capture square wave signal waveform template. When the waveform is generated, the value of the processing cycle meets the requirement of single-cycle adjustable.
[0008] Furthermore, in step S4, it also includes: According to the calculation principle of the signal frequency / period, the expected value of the signal frequency / period of the target captured square wave signal is correctly calculated, and then compared with the actual measured value output by the module under test. If they are consistent, the test passes, otherwise it fails.
[0009] Furthermore, the selected target captured square wave signal is saved and associated with the test case for direct loading during regression testing.
[0010] A test system for executing the test method of the target capture square wave signal frequency calculation module as described above, comprising: A waveform template formulation unit is used to analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test; A square wave signal generating unit, configured to generate a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template according to the target capture square wave signal waveform template; A square wave signal input unit selects a target capture square wave signal waveform template and inputs the matching target capture square wave signal into the module under test through an IO port; The module under test execution unit is used to execute the module under test and determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
[0011] A test platform for executing the test method of the target capture square wave signal frequency calculation module as described above, comprising: Display interface, used for waveform display of target capture square wave signal, display of expected value / measured value of frequency calculation, and display of test results; The waveform generation unit is used to load the signal template, generate a single-cycle adjustable target capture square wave signal that meets the requirements, and set the output IO port to output the waveform signal to the module under test; The result judgment unit is used to obtain the actual measured value output by the tested device and compare it with the expected value. If they are consistent, the test result is judged as passed; if they are inconsistent, the test result is judged as failed, and the result is sent to the display interface.
[0012] A computer device comprises a memory and one or more processors, wherein the memory stores computer codes, and when the computer codes are executed by the one or more processors, the one or more processors execute the above method.
[0013] A computer-readable storage medium stores computer codes. When the computer codes are executed, the above method is executed.
[0014] Compared with the prior art, the present invention has at least one of the following beneficial effects: (1) It solves the problem that the target capture square wave signal is in a single form under the existing test technology, and the square wave signal period / frequency value of each software processing cycle cannot be fully and accurately controlled, resulting in incomplete test scenarios and insufficient testing, thereby improving test reliability; (2) It has the function of automatically judging expected results and actual measured results, which improves the test efficiency; (3) Using the target capture square wave signal template can effectively ensure the standardization of this type of software testing and guarantee the test quality; (4) The present invention can be applied to test scenarios that have special requirements on the state of an IO port at a specific moment, such as a situation where a 1-beat glitch occurs on an IO port at a specific moment. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flow chart of a test method for a target capture square wave signal frequency calculation module of the present invention; Figure 2 The present invention is a schematic structural diagram of a target capture square wave signal frequency calculation module test platform. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments 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 this field without creative work are within the scope of protection of this application.
[0017] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0018] First embodiment like Figure 1 As shown, this embodiment provides a test method for a target capture square wave signal frequency calculation module, including: S1: Analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test.
[0019] The target capture square wave signal waveform template includes: signal initial state, signal end state, signal frequency / period and change law; wherein, the signal initial state determines the starting condition of the test, the signal end state provides a clear mark for the termination of the test, the signal frequency / period is set within a reasonable range according to the actual application scenario, and the change law reflects the changing trend of the frequency over time.
[0020] In this embodiment, the target capture square wave signal waveform template n: signal initial state (0 low level); signal frequency / period and change rule: 2 cycles of 50Hz, 2 cycles of 5Hz, 2 cycles of 50Hz, 1 cycle of 5Hz, 2 cycles of 50Hz; signal end state (continuous 1 high level).
[0021] In the set of target capture square wave signal waveform templates, the signal frequency / period range covers special cases specified in the requirements, including valid values, invalid values and boundary values, as well as multiple values of regular frequencies / periods.
[0022] S2: According to the target capture square wave signal waveform template, a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template is generated.
[0023] The signal frequency / period of the target capture square wave signal is converted into a set of 1-0 sequences, 1 is a high level, and 0 is a low level. In each processing cycle, whether the high and low levels are switched is determined according to the target capture square wave signal waveform template. When the waveform is generated, the value of the processing cycle meets the requirement of single-cycle adjustable.
[0024] In this embodiment, taking the target capture square wave signal waveform template n as an example, the value of the processing cycle is set to 10ms when the template is generated, and the target capture square wave signal waveform template is converted into a set of 1-0 sequence values: In each processing cycle, it is determined whether the high and low levels are switched according to the waveform template, and a single-cycle adjustable target capture square wave signal that meets the requirements is generated.
[0025] S3: Select a target capture square wave signal waveform template, and input the matching target capture square wave signal into the module under test through the IO port.
[0026] S4: Execute the module under test to determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
[0027] According to the calculation principle of the signal frequency / period, the expected value of the signal frequency / period of the target captured square wave signal is correctly calculated, and then compared with the actual measured value output by the module under test. If they are consistent, the test passes, otherwise it fails.
[0028] In addition, the selected target captured square wave signal is saved and associated with the test case for direct loading during regression testing.
[0029] Second embodiment This embodiment provides a test system for executing the test method of the target capture square wave signal frequency calculation module in the first embodiment, including: A waveform template formulation unit is used to analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test; A square wave signal generating unit, configured to generate a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template according to the target capture square wave signal waveform template; A square wave signal input unit selects a target capture square wave signal waveform template and inputs the matching target capture square wave signal into the module under test through an IO port; The module under test execution unit is used to execute the module under test and determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
[0030] Third embodiment like Figure 2 As shown, this embodiment provides a test platform for executing the test method of the target capture square wave signal frequency calculation module in the first embodiment, including: Display interface, used for waveform display of target capture square wave signal, display of expected value / measured value of frequency calculation, and display of test results; The waveform generation unit is used to load the signal template, generate a single-cycle adjustable target capture square wave signal that meets the requirements, and set the output IO port to output the waveform signal to the module under test; The result judgment unit is used to obtain the actual measured value output by the tested device and compare it with the expected value. If they are consistent, the test result is judged as passed; if they are inconsistent, the test result is judged as failed, and the result is sent to the display interface.
[0031] A computer-readable storage medium stores computer code. When the computer code is executed, the above method is executed. A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium can include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0032] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
[0033] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0034] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
Claims
1. A test method for a target capture square wave signal frequency calculation module, characterized in that: include: S1: Analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test; S2: generating a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template according to the target capture square wave signal waveform template; S3: Select a target capture square wave signal waveform template, and input the matched target capture square wave signal into the module under test through the IO port; S4: Execute the module under test to determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
2. The test method of the target capture square wave signal frequency calculation module according to claim 1, characterized in that: In step S1, the target capture square wave signal waveform template is formulated including: Signal initial state, signal end state, signal frequency / period and change pattern; Among them, the initial state of the signal determines the starting conditions of the test, the end state of the signal provides a clear mark for the termination of the test, the signal frequency / period is set in a reasonable range according to the actual application scenario, and the change law reflects the changing trend of the frequency over time.
3. The test method of the target capture square wave signal frequency calculation module according to claim 2, characterized in that: The signal frequency / period range covers special cases specified in the requirements, including valid values, invalid values and boundary values, as well as multiples of regular frequencies / periods.
4. The test method of the target capture square wave signal frequency calculation module according to claim 1, characterized in that: In step S2, it includes: The signal frequency / period of the target capture square wave signal is converted into a set of 1-0 sequences, 1 is a high level, and 0 is a low level. In each processing cycle, whether the high and low levels are switched is determined according to the target capture square wave signal waveform template. When the waveform is generated, the value of the processing cycle meets the requirement of single-cycle adjustable.
5. The test method of the target capture square wave signal frequency calculation module according to claim 2, characterized in that: In step S4, it also includes: According to the calculation principle of the signal frequency / period, the expected value of the signal frequency / period of the target captured square wave signal is correctly calculated, and then compared with the actual measured value output by the module under test. If they are consistent, the test passes, otherwise it fails.
6. The test method of the target capture square wave signal frequency calculation module according to claim 1, characterized in that: Also includes: The selected target captured square wave signal is saved and associated with the test case for direct loading during regression testing.
7. A test system for executing the test method of the target capture square wave signal frequency calculation module according to any one of claims 1 to 6, characterized in that: include: A waveform template formulation unit is used to analyze the target capture square wave signal frequency calculation module and formulate the target capture square wave signal waveform template required for the test; A square wave signal generating unit, configured to generate a single-cycle adjustable target capture square wave signal matching the target capture square wave signal waveform template according to the target capture square wave signal waveform template; A square wave signal input unit selects a target capture square wave signal waveform template and inputs the matched target capture square wave signal into the module under test through an IO port; The module under test execution unit is used to execute the module under test and determine whether the measured value is consistent with the expected value. If they are consistent, the test passes; otherwise, it fails.
8. A test platform for executing the test method of the target capture square wave signal frequency calculation module according to any one of claims 1 to 6, characterized in that: include: Display interface, used for waveform display of target capture square wave signal, display of expected value / measured value of frequency calculation, and display of test results; The waveform generation unit is used to load the signal template, generate a single-cycle adjustable target capture square wave signal that meets the requirements, and set the output IO port to output the waveform signal to the module under test; The result judgment unit is used to obtain the actual measured value output by the tested device and compare it with the expected value. If they are consistent, the test result is judged as passed; if they are inconsistent, the test result is judged as failed, and the result is sent to the display interface.
9. A computer device comprising a memory and one or more processors, wherein the memory stores computer codes, and when the computer codes are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 6. 10 . A computer-readable storage medium storing a computer code, wherein when the computer code is executed, the method according to claim 1 is executed.