De-jitter function test method and test device based on time series scenario

By designing the debounce function test method based on time series scenarios in the flight control system and using vector and matrix expressions to generate test cases, the problem of insufficient pertinence of the debounce function test in the traditional test method is solved and the test efficiency and accuracy are improved. , enhancing software quality and reliability.

CN114138658BActive Publication Date: 2024-10-29XIAN FLIGHT SELF CONTROL INST OF AVIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111487471.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2024-10-29
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

Traditional software testing methods fail to effectively consider the completeness and adequacy of the flight control system's debounce function in time series scenarios, resulting in testing that is not targeted enough, consumes a lot of manpower, and is inefficient.

Method used

A debounce function testing method based on time series scenarios is designed. By writing the debounce function and generating test case vectors, using vector and matrix expressions, the expected output is generated for the debounce function software of the flight control system and compared with the actual output. Compare and improve test accuracy and efficiency.

Benefits of technology

It significantly reduces the workload of testers, improves testing efficiency and accuracy, enhances the quality and reliability of software, and ensures the completeness and adequacy of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114138658B_ABST
    Figure CN114138658B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of software testing in safety-critical fields, and in particular to a debouncing function testing method and testing device for flight control system software based on a time series scenario. The testing method comprises: writing a debouncing function; designing a test case vector based on a time series scenario; injecting the test case vector into the debouncing function, and calculating the expected output of the test case; judging whether the expected output is equal to the actual output of the flight control system software under test, and if not equal, indicating that the test result of the software under test fails.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing in a safety-critical field, and in particular to a de-jittering function testing method and a testing device for flight control system software based on a time series scenario. Background Art

[0002] In the design of flight control system software, the de-jitter function plays a large role. For example, the input signals collected by various sensors or hardware platforms will inevitably contain noise, that is, jitter, which may cause the divergence of system functions. The application of the de-jitter function can effectively avoid this situation.

[0003] Since the de-bouncing function is based on a time sequence rather than a current function, traditional software testing does not take this feature into consideration, and the integrity and adequacy of the test cannot be guaranteed; the flight control system de-bouncing function software will encounter various complex scenarios in the actual environment, and traditional software testing does not specifically consider the actual complex operating scenarios and their characteristics; and each test requires a lot of effort to write the input and expected output of the test vector, which consumes a lot of manpower. Summary of the invention

[0004] The purpose of the present invention is to provide a de-jitter function test method and test device based on a time series scenario, which reduces the workload of testers and increases test efficiency and accuracy.

[0005] The technical solution of the present invention provides a de-jitter function test method and a test device based on a time series scenario, which are applied to the test of the de-jitter function software of the flight control system. First, based on the de-jitter function, a de-jitter function is designed and written so that it can generate the expected output of the test case based on the test case input of the time series scenario; the test vector input is written in the form of vector and matrix expression to fully express the coherence of the de-jitter function software of the flight control system in the time series scenario; based on the characteristics of the de-jitter function in the actual operation scenario, the scenario and its feature points that completely cover the actual operation of the software are extracted, and the test vector is designed according to the scenario and the feature points to make it more targeted and effective. Based on the update rate of the software, the test case vector is injected into the software and the test-specific de-jitter function in sequence in the order of time beats, and the actual output and expected output of the tested software are compared to obtain the test results, and at the same time, a software test coverage report is obtained. The present invention reduces the workload, greatly enhances the flexibility of the test, increases the test efficiency and accuracy; has strong versatility, and improves the quality and reliability of the flight control system software.

[0006] As one of the preferred embodiments of the present invention, a de-jitter function test method based on a time series scenario is provided, which is used to perform a de-jitter function test on the software of a flight control system, and the test method comprises:

[0007] Write a debounce function;

[0008] Design test case vectors based on time series scenarios;

[0009] Injecting the test case vector into the debounce function, and calculating the expected output of the test case;

[0010] Determine whether the expected output is equal to the actual output of the flight control system software under test. If they are not equal, it means that the test result of the software under test fails.

[0011] Optionally, the debounce function is written including:

[0012] Determine the input value, debounce time, debounce initial value and return value of the debounce function, where the input value is the debounced signal and the return value is the debounced signal;

[0013] Setting a de-jitter condition of the de-jitter function, wherein the de-jitter condition is to determine whether the counter is full;

[0014] Among them, the first beat output of the de-jitter function is the de-jitter initial value of the de-jitter function, and the second beat and subsequent outputs of the de-jitter function change according to the de-jitter conditions; if the counter overflows, the output of the de-jitter function changes compared with the previous beat; if the counter does not overflow, the output of the de-jitter function remains unchanged compared with the previous beat.

[0015] Optionally, the change in the output of the de-jitter function compared with the previous beat indicates: if the output of the de-jitter function in the previous beat is 0, then the current output is 1; if the output of the de-jitter function in the previous beat is 1, then the current output is 0.

[0016] Optionally, the design of the test case vector includes:

[0017] Establishing a test scenario for the debounce function, wherein the test scenario includes an initialization scenario, a normal counting scenario after initialization, a counter overflow retention and a reset scenario; wherein different scenarios represent different dynamic behaviors of the software function running over a time series;

[0018] Extract the feature points and sub-scenarios corresponding to different test scenarios; feature points represent the characteristic performance corresponding to different dynamic behaviors of software functions running over time series; sub-scenarios represent the dynamic behaviors of software functions running in a specific time series;

[0019] A test case vector corresponding to each scene is established based on the feature points contained in each scene.

[0020] Optionally, the feature points contained in the initialization scene are the initial frame;

[0021] The characteristic points of the normal counting scene after initialization include the initial frame, before the counter overflows, and when the counter overflows;

[0022] The characteristic points of the counter overflow holding and resetting scenario include the initial frame, before the counter overflows, when the counter overflows, after the counter overflows, and resetting the counter.

[0023] Optionally, the initialization scenario includes sub-scenario 1, and the input of feature points, time series, and test case vectors corresponding to sub-scenario 1 are as shown in the following table:

[0024]

[0025] Optionally, the normal counting scenarios after initialization include sub-scenario 1, sub-scenario 2 and sub-scenario 3; the inputs of feature points, time series and test case vectors corresponding to different sub-scenarios are shown in the following table:

[0026]

[0027] Optionally, the counter overflow holding and resetting scenarios include sub-scenario 1, sub-scenario 2, sub-scenario 3, sub-scenario 4 and sub-scenario 5, as shown in the following table

[0028]

[0029] As one of the preferred embodiments of the present invention, a de-jitter function test device based on a time series scenario is provided, the device comprising:

[0030] A debouncing function writing module is used to write a debouncing function, determine the input value, debouncing time, debouncing initial value and return value of the debouncing function, and send them to the test case expected output module;

[0031] The software under test reading module is used to read the software under test in the flight control system, determine the input and output ports of the software under test, and send the software under test to the actual output module of the test case;

[0032] Test vector writing module, used to write test vector input based on time series scenarios according to software requirement documents;

[0033] The test case expected output module is used to receive the test vector input output by the test vector writing module, and obtain the test case expected output through debounce function calculation;

[0034] The test case actual output module is used to receive the test vector input output by the test vector writing module, and obtain the test case actual output through simulation operation of the software under test;

[0035] The comparison module is used to receive the expected output of the test case and the actual output of the test case, and compare them to obtain the test result of the software under test.

[0036] Optionally, the device further comprises a tested software coverage acquisition module, which is used to output the coverage result of the tested software after the comparison module outputs the result.

[0037] Advantages of the present invention:

[0038] 1. The continuous multi-shot test cases adopt vector and matrix expressions, which can fully express the coherence of the flight control system software functions in the time series scenario and ensure the integrity and adequacy of the test;

[0039] 2. A debounce function is specially designed for flight control system software testing. Based on the test case input of the time series scenario, this function can automatically generate the expected output of the test case, saving manpower and ensuring the accuracy of the test case;

[0040] 3. Based on the de-jitter function of the flight control system software, its actual operating scenarios and feature points are extracted. The test vectors designed based on the scenarios and feature points ensure the effectiveness and pertinence of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flow chart of a debounce function test method based on a time series scenario.

[0042] Figure 2 This is the first test case vector input and time series diagram;

[0043] Figure 3 This is the schematic diagram of the vector input and time series of the second test case;

[0044] Figure 4 This is the schematic diagram of the vector input and time series of the third test case;

[0045] Figure 5 The present invention is a schematic diagram of the software under test. DETAILED DESCRIPTION

[0046] Example 1

[0047] This embodiment provides a flow chart of a de-jitter function test method based on a time series scenario, combined with Figure 1 As shown, the following steps are included:

[0048] Step 1: Write a debounce function

[0049] The writing of the de-jitter function includes: determining the input value, de-jitter time, de-jitter initial value and return value of the de-jitter function, wherein the input value is the de-jittered signal and the return value is the de-jittered signal; setting the de-jitter condition of the de-jitter function, wherein the de-jitter condition is to determine whether the counter is full.

[0050] Among them, the first beat output of the de-jitter function is the de-jitter initial value of the de-jitter function, and the second beat and subsequent outputs of the de-jitter function change according to the de-jitter conditions; if the counter overflows, the output of the de-jitter function changes compared with the previous beat; if the counter does not overflow, the output of the de-jitter function remains unchanged compared with the previous beat.

[0051] In this embodiment, if the output of the de-jitter function in the previous step is 0, the output this time is 1; if the output of the de-jitter function in the previous step is 1, the output this time is 0.

[0052] The debounce function implements the software debounce function in code form and is rigorously tested to ensure correctness.

[0053] Step 2: Design test case vectors based on time series scenarios

[0054] The design of the test case vector includes:

[0055] (1) Establish a test scenario for the debounce function, wherein the test scenario includes an initialization scenario, a normal counting scenario after initialization, and a counter overflow hold and reset scenario; the physical meaning of the scenario is the dynamic behavior of the software function running along the time series; for example, the initialization scenario represents the dynamic behavior of the software function when it is initialized, the normal counting scenario after initialization represents the dynamic behavior of the software function when it is counting normally along the time series, and the counter overflow hold and reset scenario represents the dynamic behavior of the software function when the counter overflows, holds and resets along the time series.

[0056] (2) Extract the feature points and sub-scenarios corresponding to different test scenarios; the physical meaning of the feature points is the dynamic behavior of the software function running over a time series and its characteristic performance; the physical meaning of the sub-scenarios is the dynamic behavior of the software function running in a specific time series;

[0057] The feature points contained in the initialization scene are the initial frame;

[0058] The characteristic points of the normal counting scene after initialization include the initial frame, before the counter overflows, and when the counter overflows;

[0059] The characteristic points of the counter overflow holding and resetting scenario include the initial frame, before the counter overflows, when the counter overflows, after the counter overflows, and resetting the counter.

[0060] (3) Establish a test case vector corresponding to each scene based on the feature points contained in each scene.

[0061] The initialization scenario expresses the functional scenario of the flight control system software debounce function during system initialization, which includes sub-scenario 1, the feature points corresponding to sub-scenario 1, the time series and the input of the first test case vector, as shown in the following table:

[0062]

[0063] Combination Figure 2 The flight control system software debounce function has a functional scenario when the system is initialized, including the first test case vector input in time series. The initialization scenario includes sub-scenario 1, whose feature point is the initial frame. When the time series (in time frame units) is 1, the first test case vector input is set to a positive value. According to the above steps, it can be constructed Figure 2 The first test case vector input (in Figure 2 , 1 represents a positive value).

[0064] The normal counting scenario after initialization expresses the functional scenario of the flight control system software de-jitter function when the input signal undergoes changes and stabilizes after system initialization. It includes sub-scenario 1, sub-scenario 2 and sub-scenario 3. The feature points, time series and input of the second test case vector corresponding to different sub-scenarios are shown in the following table:

[0065]

[0066] Combination Figure 3 , the functional scenarios of the flight control system software de-jitter function when the input signal undergoes changes and stabilizes after system initialization include the situation where the second test case vector is input in units of time series. The normal counting scenario after initialization includes sub-scenario 1, sub-scenario 2 and sub-scenario 3. The characteristic point of sub-scenario 1 is the initial frame. When the time series (in units of time frames) is 1, the second test case vector input is set to a positive value; sub-scenario 2 is after the sub-scenario 1 time series, and the characteristic point is before the counter overflows. After the sub-scenario 1 time series, the counter threshold * software update rate - 1 frame is maintained, and the second test case vector input is set to a positive value; sub-scenario 3 is after the sub-scenario 2 time series, and the characteristic point is when the counter overflows. After the sub-scenario 2 time series, 1 frame is maintained, and the second test case vector input is set to a positive value; sub-scenario 3 is after the sub-scenario 2 time series, and the characteristic point is when the counter overflows. After the sub-scenario 2 time series, 1 frame is maintained, and the second test case vector input is set to a positive value;

[0067] According to the above steps, we can construct Figure 3 The second test case vector input (in Figure 3 , 1 represents a positive value).

[0068] The counter overflow hold and reset scenario expresses the functional scenarios of the flight control system software de-jitter function when the input signal undergoes changes after system initialization, temporarily stabilizes, and then immediately resets to zero. It includes sub-scenario 1, sub-scenario 2, sub-scenario 3, sub-scenario 4, and sub-scenario 5, as shown in the following table

[0069] Combination Figure 4The flight control system software debounce function has functional scenarios when the input signal undergoes changes after system initialization, temporarily stabilizes and then immediately resets to zero, including the third test case vector input in time series. The counter overflow retention and reset scenarios include sub-scenario 1, sub-scenario 2, sub-scenario 3, sub-scenario 4 and sub-scenario 5. The characteristic point of sub-scenario 1 is the initial frame. When the time sequence (in time frames) is 1, the third test case vector input is set to the reverse value; sub-scenario 2 is after the time sequence of sub-scenario 1, and the characteristic point is before the counter overflows. After the time sequence of sub-scenario 1, the counter threshold * software update rate - 1 frame is maintained, and the third test case vector input is set to the positive value; sub-scenario 3 is after the time sequence of sub-scenario 2, and the characteristic point is when the counter overflows. After the time sequence of sub-scenario 2, 1 frame is maintained, and the third test case vector input is set to the positive value; sub-scenario 4 is after the time sequence of sub-scenario 3, and the characteristic point is after the counter overflows. After the time sequence of sub-scenario 3, 1 frame is maintained, and the third test case vector input is set to the positive value; sub-scenario 5 is after the time sequence of sub-scenario 4, and the characteristic point is resetting the counter. After the time sequence of sub-scenario 4, 1 frame is maintained, and the third test case vector input is set to the reverse value;

[0070] According to the above steps, we can construct Figure 4 The third test case vector input (in Figure 4 In the example, 1 represents a positive value and 0 represents a negative value).

[0071] Step 3, inject the test vector input, debounce time, and output initial value into the debounce function in step 1 to calculate the expected output of the test case;

[0072] Step 4: inject the test input vector into the software with the flight control system debouncing function, run the software to obtain the actual output of the test case, compare the expected output of the test case with the actual output of the running software, and obtain the test result;

[0073] Step 5: Obtain the flight control system debounce function software coverage report.

[0074] Example 2

[0075] This embodiment provides a de-jitter function test device based on a time series scenario, the device comprising:

[0076] A debouncing function writing module is used to write a debouncing function, determine the input value, debouncing time, debouncing initial value and return value of the debouncing function, and send them to the test case expected output module;

[0077] The software under test reading module is used to read the software under test in the flight control system, determine the input and output ports of the software under test, and send the software under test to the actual output module of the test case;

[0078] Test vector writing module, used to write test vector input based on time series scenarios according to software requirement documents;

[0079] The test case expected output module is used to receive the test vector input output by the test vector writing module, and obtain the test case expected output through debounce function calculation;

[0080] The test case actual output module is used to receive the test vector input output by the test vector writing module, and obtain the test case actual output through simulation operation of the software under test;

[0081] The comparison module is used to receive the expected output of the test case and the actual output of the test case, and compare them to obtain the test result of the software under test.

[0082] Furthermore, the device also includes a tested software coverage acquisition module, which is used to output the coverage result of the tested software after the comparison module outputs the result.

[0083] Example 3

[0084] Taking a safety-critical software of a flight control system as an example, combined with Figure 5 , specifically including the following implementation steps:

[0085] Step 1: Identify all input and output signals of the debounce function according to the requirements. Figure 5 The input signals are: In; the output signals are Out.

[0086] Step 2: Since the update rate of the software under test is 40Hz, the test vector should be designed based on this update rate; Figure 2 In the example, after the input signal In is bidirectionally de-jittered, the rising de-jitter time of the output signal Out is 0.075s, i.e. 3 beats. The falling de-jitter time is 0.05s, i.e. 2 beats. The initial value of the software output is 1;

[0087] Step 3: Design test cases 1 and 2 based on scenario 1. Scenario 1 is the initialization scenario:

[0088] Test case 1:

[0089] time = 0.025*[0];

[0090] In = [1];

[0091] Test case 2:

[0092] time = 0.025*[0];

[0093] In = [0];

[0094] Step 4: Design test cases 3 and 4 based on scenario 2. Scenario 2 is the normal counting scenario after initialization:

[0095] Test case 3:

[0096] time = 0.025*[0 1 2 3];

[0097] In = [1 1 1 1];

[0098] Test case 4:

[0099] time = 0.025*[0 1 2];

[0100] In = [0 0 0];

[0101] Step 5: Design test cases 5 and 6 based on scenario 3. Scenario 3 is the counter overflow hold and reset scenario:

[0102] Test case 5:

[0103] time =0.025*[0 1 2 3 4 5];

[0104] In = [0 1 1 1 1 0];

[0105] Test case 6:

[0106] time = 0.025*[0 1 2 3 4];

[0107] In = [1 0 0 0 1];

[0108] Step 6: Inject the above 6 test cases into the test-specific debounce function debounce respectively to obtain the expected output of the test case exp_out = debounce (In, 3, 2, 1);

[0109] Debounce function debounce(in,on_sample,off_sample,init_v) parameter description:

[0110] in: input signal

[0111] on_sample: rise debounce time, in beats

[0112] off_sample: Debounce time, in beats

[0113] init_v: output initial value

[0114] Step 7: Inject the test cases into the software respectively to obtain the value of the actual output port Out of the software;

[0115] Step 8. Automatically compare Out and exp_out. If they are equal, the test result is passed; if they are not equal, the test result is failed; obtain test files such as software coverage report.

Claims

1. A de-jitter function test method based on a time series scenario, used to test the de-jitter function of the software of a flight control system, characterized in that: The test method includes: Write a debounce function; Design test case vectors based on time series scenarios; Injecting the test case vector into the debounce function, and calculating the expected output of the test case; Determine whether the expected output is equal to the actual output of the flight control system software under test. If not, it means that the test result of the software under test fails. The writing of the debounce function includes: Determine the input value, debounce time, debounce initial value and return value of the debounce function, where the input value is the debounced signal and the return value is the debounced signal; Setting a de-jitter condition of the de-jitter function, wherein the de-jitter condition is to determine whether the counter is full; The first beat output of the de-bounce function is the de-bounce initial value of the de-bounce function, and the second beat and subsequent outputs of the de-bounce function change according to the de-bounce condition; if the counter overflows, the output of the de-bounce function changes compared with the previous beat; if the counter does not overflow, the output of the de-bounce function remains unchanged compared with the previous beat; the design of the test case vector includes: Establishing a test scenario for the debounce function, wherein the test scenario includes an initialization scenario, a normal counting scenario after initialization, a counter overflow retention and a reset scenario; wherein different scenarios represent different dynamic behaviors of the software function running over a time series; Extract the feature points and sub-scenarios corresponding to different test scenarios; feature points represent the characteristic performance corresponding to different dynamic behaviors of software functions running over time series; sub-scenarios represent the dynamic behaviors of software functions running over a certain time series; time series include 1, counter threshold * software update rate - 1; A test case vector corresponding to each scene is established based on the feature points contained in each scene.

2. The de-jitter function testing method based on time series scenario according to claim 1 is characterized in that: The change in the output of the de-bounce function compared with the previous beat indicates that: if the output of the de-bounce function in the previous beat is 0, the output this time is 1; if the output of the de-bounce function in the previous beat is 1, the output this time is 0.

3. The de-jitter function testing method based on time series scenario according to claim 1 is characterized in that: The feature points contained in the initialization scene are the initial frame; The characteristic points of the normal counting scene after initialization include the initial frame, before the counter overflows, and when the counter overflows; The characteristic points of the counter overflow holding and resetting scenario include the initial frame, before the counter overflows, when the counter overflows, after the counter overflows, and resetting the counter.

4. The de-jitter function testing method based on time series scenario according to claim 3 is characterized in that: The initialization scenario includes sub-scenario 1. The input of feature points, time series and test case vectors corresponding to sub-scenario 1 are shown in the following table:

5. The de-jitter function testing method based on time series scenario according to claim 3 is characterized in that: After initialization, the normal counting scenarios include sub-scenario 1, sub-scenario 2, and sub-scenario 3. The input of feature points, time series, and test case vectors corresponding to different sub-scenarios are shown in the following table:

6. The de-jitter function testing method based on time series scenario according to claim 3 is characterized in that: The counter overflow hold and reset scenarios include sub-scenario 1, sub-scenario 2, sub-scenario 3, sub-scenario 4 and sub-scenario 5. The input of feature points, time series and test case vectors corresponding to different sub-scenarios are shown in the following table: 。 7. A de-jitter function test device based on a time series scenario, used to implement the de-jitter function test method based on a time series scenario according to any one of claims 1 to 6, characterized in that: The device comprises, A debouncing function writing module is used to write a debouncing function, determine the input value, debouncing time, debouncing initial value and return value of the debouncing function, and send them to the test case expected output module; The software under test reading module is used to read the software under test in the flight control system, determine the input and output ports of the software under test, and send the software under test to the actual output module of the test case; Test vector writing module, used to write test vector input based on time series scenarios according to software requirement documents; The test case expected output module is used to receive the test vector input output by the test vector writing module, and obtain the test case expected output through debounce function calculation; The test case actual output module is used to receive the test vector input output by the test vector writing module, and obtain the test case actual output through simulation operation of the software under test; The comparison module is used to receive the expected output of the test case and the actual output of the test case, and compare them to obtain the test result of the software under test.

8. The de-jitter function test device based on time series scenario according to claim 7, characterized in that: The device further comprises: The tested software coverage acquisition module is used to output the coverage result of the tested software after the comparison module outputs the result.

Citation Information

Patent Citations

  • Scene-based latch test method

    CN106874177A

  • Video jitter removing method based on deep learning

    CN110276739A