CN115840707A - Flash test method, device and medium - Google Patents

Flash test method, device and medium Download PDF

Info

Publication number
CN115840707A
CN115840707A CN202211637662.0A CN202211637662A CN115840707A CN 115840707 A CN115840707 A CN 115840707A CN 202211637662 A CN202211637662 A CN 202211637662A CN 115840707 A CN115840707 A CN 115840707A
Authority
CN
China
Prior art keywords
test
result
flash
testing
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211637662.0A
Other languages
Chinese (zh)
Inventor
马晓雷
罗佳明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Imotion Automotive Technology Suzhou Co Ltd
Original Assignee
Imotion Automotive Technology Suzhou Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Imotion Automotive Technology Suzhou Co Ltd filed Critical Imotion Automotive Technology Suzhou Co Ltd
Priority to CN202211637662.0A priority Critical patent/CN115840707A/en
Publication of CN115840707A publication Critical patent/CN115840707A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Tests Of Electronic Circuits (AREA)

Abstract

The invention discloses a flash test method, a flash test device and a flash test medium, which are suitable for the technical field of software test. The configuration parameters and the flash process are separated, the test process is independent into each test step according to each function program, and the test cases are obtained by combining each function program according to the configuration parameters, so that the test steps get rid of the dependency relationship with the current test project, and the corresponding flash process of the existing test project is prevented from being redeveloped. The method and the device have the advantages that the testers do not need to be familiar with the flash flow, the test points and the flash process realization principle of each test item, the technical level requirements on the testers are reduced, and the test steps can be arranged only according to the configuration parameters to realize the flash test process. In addition, before testing each test step, the test of expected result parameters is carried out, and the test processing is carried out only under the condition that the test result is successful, so that the test time is saved, the universality of the flash test and the efficiency of the whole flash process are improved, and the accuracy of the final test result is improved.

Description

Flash test method, device and medium
Technical Field
The invention relates to the technical field of software testing, in particular to a flash testing method, a flash testing device and a flash testing medium.
Background
In the development process, a primary supplier of an automotive electronic control unit needs to test the flashing function of a product based on Unified Diagnostic Services (UDS), test points comprise a forward test, a reverse test and a pressure test, parameters related to flashing of each item are different, and a tester needs to redevelop the whole flashing process according to the flashing process of each item.
Because the flash engineering carries out the flash test by putting the flash process and the parameters together, a tester needs to be familiar with not only the refresh flow of the project and the test points to be verified by flash, but also the implementation principle of the flash process of the whole project. This undoubtedly requires higher technical level to the tester, simultaneously because the tester is whole to the redevelopment of different projects, the test point easily appears and miss the detection, the wrong circumstances takes place for the efficiency of whole process of writing with a brush is lower, and the accuracy of test result is lower.
Therefore, it is an urgent need to solve by those skilled in the art to find a flash test method.
Disclosure of Invention
The invention aims to provide a flash test method, a flash test device and a flash test medium, which save test time, improve the universality of flash test and the efficiency of the whole flash process, and simultaneously improve the accuracy of a final test result.
In order to solve the above technical problem, the present invention provides a flash test method, including:
acquiring configuration parameters of a current test project and a file to be flashed;
calling an expected result parameter corresponding to a current testing step from the configuration parameters, wherein a test case of the file to be flashed is executed through a plurality of testing steps under the current testing item, the test case is obtained by combining functional programs corresponding to the testing steps according to the configuration parameters, and the functional programs corresponding to the testing steps are packaged in advance;
checking the current testing step according to the expected result parameter to obtain a checking result, and calling a diagnosis function instruction to test the function corresponding to the current testing step under the condition that the checking result is successful to obtain a testing result;
and under the condition that the test result is successful, taking the next test step as the current test step, and returning to the step of calling the expected result parameter corresponding to the current test step in the configuration parameters until the flash test of the test step in the test case is completed.
Preferably, the checking the current testing step according to the expected result parameter to obtain a checking result includes:
obtaining a return result parameter of the current testing step, wherein the return result parameter is a result parameter of a feedback of a checking instruction sent by calling the current testing step;
comparing the expected result parameter corresponding to the current testing step with the returned result parameter;
when the expected result parameter is the same as the return result parameter, determining that the test result is successful;
and when the expected result parameter is different from the return result parameter, determining that the checking result is failure.
Preferably, executing the test case of the file to be flashed through a plurality of test steps under the current test item includes:
obtaining a test point of the current test item, wherein the test point is a forward test point and/or a reverse test point;
and flashing each test step according to the test points to execute the test case of the file to be flashed.
Preferably, when the test point is the reverse test point, the flashing the test steps according to the test point to execute the test case of the file to be flashed includes:
obtaining a reverse test type of the reverse test point, wherein the test type of the reverse test point comprises a skip flashing step type or a short circuit disconnection type;
when the reverse test type is the type of skipping the flashing step, executing the test case of the file to be flashed according to the skipping test step corresponding to the type of skipping the flashing step without executing the test case of the file to be flashed according to the step of skipping the flashing step, wherein the step of not skipping the testing is a testing step except the step of skipping the flashing step in each testing step;
and when the reverse test type is the short circuit disconnection type, performing protection operation processing according to the test step corresponding to the short circuit disconnection type.
Preferably, the step of calling the diagnostic function instruction to test the function corresponding to the current testing step to obtain a testing result includes:
acquiring the diagnosis function instruction, wherein the diagnosis function instruction is a sending function instruction, a reply function instruction or a check result function instruction;
when the initial test results corresponding to the diagnosis function instruction are successful, determining that the test results are successful;
and when one result fails in the initial test result corresponding to the diagnosis function instruction, determining that the test result is a failure.
Preferably, determining the initial test result corresponding to the diagnostic function instruction comprises:
when the diagnosis function instruction is the sending function instruction, recording the time of the CAN bus for the sending function instruction, if the time for the sending function instruction is within a first preset time, determining that the sending instruction is successful, and if the time for the sending function instruction exceeds the first preset time, determining that the sending instruction is failed;
when the diagnosis function instruction is the reply function instruction, determining the occurrence time of the reply function instruction, if the occurrence time of the reply function instruction is within a second preset time, determining that the receiving instruction is successful, and if the occurrence time of the reply function instruction exceeds the second preset time, determining that the receiving instruction is failed;
and when the diagnosis function instruction is the check result function instruction, receiving a reply instruction, comparing the reply instruction with the expected result parameter of the current test step, if the reply instruction is the same as the expected result parameter, determining that the test result is successful, and if the reply instruction is the same as the expected result parameter, determining that the test result is failed.
Preferably, in the case that the test result fails, the method further comprises:
under the condition that the test result fails, determining that the test result is failed, and finishing the flash test of the test step of the test case in the current test item;
correspondingly, in the case that the test result fails, the method further includes:
and under the condition that the test result fails, ending the flash test of the test step of the test case in the current test item.
Preferably, after completing the flash test of the test step in the test case, the method further includes:
updating the execution result of the test case;
judging whether other test cases exist under the current test item;
if yes, returning to the step of acquiring the configuration parameters of the current test item and the file to be refreshed;
and if the current test item does not exist, ending the flash test of the current test item.
In order to solve the above technical problem, the present invention further provides a writing test apparatus, including:
the acquisition module is used for acquiring configuration parameters of a current test project and a file to be flashed;
the calling module is used for calling an expected result parameter corresponding to a current testing step in the configuration parameters, wherein a test case of the file to be flashed is executed through a plurality of testing steps under the current testing project, the test case is obtained by combining functional programs corresponding to the testing steps according to the configuration parameters, and the functional programs corresponding to the testing steps are packaged in advance;
the testing module is used for testing the current testing step according to the expected result parameter to obtain a testing result, and calling a diagnosis function instruction to test the function corresponding to the current testing step to obtain a testing result under the condition that the testing result is successful;
and the return module is used for taking the next testing step as the current testing step under the condition that the testing result is successful, and returning to the step of calling the expected result parameter corresponding to the current testing step in the configuration parameters until the flash test of the testing step in the test case is completed.
In order to solve the above technical problem, the present invention further provides a writing test apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the flash test method as described above when executing the computer program.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the flash test method are implemented as described above.
The invention provides a flash test method, which comprises the following steps: acquiring configuration parameters of a current test project and a file to be flashed; calling an expected result parameter corresponding to the current testing step from the configuration parameters, wherein a test case of a file to be flashed is executed through a plurality of testing steps under the current testing project, the test case is obtained by combining functional programs corresponding to the plurality of testing steps according to the configuration parameters, and the functional programs corresponding to the plurality of testing steps are packaged in advance; testing the current testing step according to the expected result parameters to obtain a testing result, and calling a diagnosis function instruction to test the function corresponding to the current testing step under the condition that the testing result is successful to obtain the testing result; and under the condition that the test result is successful, taking the next test step as the current test step, and returning to the step of calling the expected result parameter corresponding to the current test step in the configuration parameters until the flash test of the test step in the test case is completed. According to the method, the configuration parameters and the flash process are separated, the test process is independent into each test step according to each function program, and each function program is combined according to the configuration parameters to obtain the test case, so that the test steps get rid of the dependency relationship with the current test project, and the corresponding flash process of the existing test project is prevented from being redeveloped. The method and the device have the advantages that the testers do not need to be familiar with the flash flow, the test points and the flash process realization principle of each test item, the technical level requirements on the testers are reduced, and the test steps can be arranged only according to the configuration parameters to realize the flash test process. In addition, before testing each test step, the test of expected result parameters is firstly carried out, the test processing is carried out only under the condition that the test result is successful, and the test of the next test step is carried out after the test result of the current test step is successful, so that the test time is saved, the universality of the flash test and the efficiency of the whole flash process are improved, and the accuracy of the final test result is improved.
In addition, the invention also provides a brushing test device and a medium, which have the same beneficial effects as the brushing test method.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for flash test according to an embodiment of the present invention;
fig. 2 is a structural diagram of a flash test apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of another apparatus for flash test according to an embodiment of the present invention;
FIG. 4 is a flowchart of another flash test method according to an embodiment of the present invention;
fig. 5 is an application schematic diagram of a flash test method according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
The core of the invention is to provide a flash test method, a flash test device and a flash test medium, which can save test time, improve the efficiency of the whole flash process and improve the accuracy of the final test result.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
It should be noted that the flash test method provided by the invention is suitable for testing in the field of automotive electronics, and the test product thereof is based on the flash function of the UDS service. The UDS service is a standardized standard for diagnostic services, such as what instruction should be given to an Electronic Control Unit (ECU) to read a trouble code, and what instruction should be given to the ECU to read data. The ECU consists of a microcontroller, a memory, an input/output interface, an analog-to-digital converter, a shaping circuit, a driving circuit and other large-scale integrated circuits.
Fig. 1 is a flowchart of a method for performing a flash test according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s11: acquiring configuration parameters of a current test project and a file to be flashed;
s12: calling an expected result parameter corresponding to the current testing step in the configuration parameters;
the method comprises the following steps that a test case of a file to be flashed is executed through a plurality of test steps under a current test project, the test case is obtained by combining functional programs corresponding to the test steps according to configuration parameters, and the functional programs corresponding to the test steps are packaged in advance;
s13: checking the current testing step according to the expected result parameters to obtain a checking result, judging whether the checking result is successful, if so, entering the step S14;
s14: calling a diagnosis function instruction to test the function corresponding to the current test step to obtain a test result, judging whether the test result is successful, if so, entering the step S15;
s15: and taking the next testing step as the current testing step, and returning to the step S12 until the flash test of the testing step in the test case is completed.
Specifically, the software is flashed into the ECU nonvolatile memory through UDS related services, the related services are not limited, and may be a routine control service, a request download service, a data transmission service, a request transmission exit service, and the like, the software flashing is to burn a software program into a specific section of an ECU chip memory, and then the ECU operates the software program to implement its specific function. The configuration parameters of the current test project and the file to be flashed are obtained, the related configuration parameters in the existing test project are extracted to be used as the configuration file, the configuration parameters can have expected results, and the related parameters, the file storage address, the size, the check code and the like in each test step are not limited in the embodiment and can be set according to actual conditions. The file to be flashed is a corresponding ECU flashing file.
In step S12, before the test step is executed, the expected result parameters corresponding to each test step are called in the configuration parameters, it should be noted that, for different test steps, the expected result parameters corresponding to the different test steps may be the same or different, but before the test step is executed each time, the expected result parameters corresponding to the current test step need to be called in the configuration parameters. The test case of the file to be flashed is executed through a plurality of test steps under the current test project, namely the test case of the file to be flashed is executed according to all test steps under the current test project, the test case comprises the test steps formed by combining the flashing test points on the basis of the project flashing flow, and the functional programs corresponding to all test steps under the current test project are packaged in advance. The files corresponding to the functional programs are modularized and independent, so that each testing step in the flashing process has no dependency relationship, and the independent association of logic and projects is realized. For example, in a Flash process, the Flash steps are Flash clearing, data downloading request, data transmission, push-out transmission and the like, each step in the Flash steps is independent, and the functional programs corresponding to the Flash clearing, data downloading request, data transmission and push-out transmission are modularized. The existing flash process needs to strictly follow the current flash sequence, and because the parameters of each test item are different, the test item can be redeveloped and compiled every time the test item is flashed.
In the embodiment, each test step is independent, the configuration parameters of the test items are extracted, and the test step of the current test item executes the current test case according to different test steps corresponding to different test items. The test case is obtained by determining and combining all functional programs according to the configuration parameters of the current test item, for example, the functional programs corresponding to the current flash process are data downloading request, data transmission and transmission pushing, the number of the corresponding test steps is only three, the requirement of each test item is different from the realization function, and the corresponding test steps are formed by combining on the basis of the modularization steps.
In addition, the test points for executing the test case can be a forward test point, a reverse test point and a corresponding pressure test point, and are not limited herein, the forward test point has a different dimension from the existing forward flash, the existing forward flash is flash for file sequence information, the forward test point of the embodiment of the invention is executed for the test steps of the current test case, and each step is sequentially listed to realize the successful flash of the case. The reverse test point comprises a power supply short-circuit disconnection step, a Controller Area Network (CAN) short-circuit disconnection step, a skipping brushing step and the like, the step to be skipped is removed on the basis of the previous complete process if the brushing step is skipped, and the pressure test is carried out for thousands of times on the basis of the forward test point or the reverse test point.
And step S13, detecting the current testing step according to the expected result parameters to obtain a detection result. The detection process may be comparing the actual parameter with the expected result parameter, wherein the corresponding detection result is successful when the comparison is successful, and the corresponding detection result is failed when the comparison is failed.
And under the condition that the detection result is successful, the function of the test step can be detected, and the detection process is to call each function instruction to obtain the test result. And calling each functional instruction as a diagnosis instruction, determining that the test result is successful when the diagnosis results are successful, and determining that the test result is failed if one of the diagnosis results is failed.
After the test of the current test step is completed, under the condition that the test result is successful, the test of the next test step is carried out, namely the next test step is taken as the current test step, and the step S12 is returned until the test of all the test steps is completed. It should be noted that, in the case that the test result fails, the test of the current test step is directly ended, and the test process is not executed in the subsequent test step, so that the test result is determined to fail. And under the condition that the test result fails, directly ending the test of the current test step, and determining that the test result fails without executing the test process in the subsequent test step.
The embodiment of the invention provides a flash test method, which comprises the following steps: acquiring configuration parameters of a current test project and a file to be flashed; calling an expected result parameter corresponding to the current testing step from the configuration parameters, wherein a test case of a file to be flashed is executed through a plurality of testing steps under the current testing project, the test case is obtained by combining functional programs corresponding to the plurality of testing steps according to the configuration parameters, and the functional programs corresponding to the plurality of testing steps are packaged in advance; testing the current testing step according to the expected result parameters to obtain a testing result, and calling a diagnosis function instruction to test the function corresponding to the current testing step under the condition that the testing result is successful to obtain the testing result; and under the condition that the test result is successful, taking the next test step as the current test step, and returning to the step of calling the expected result parameter corresponding to the current test step in the configuration parameters until the flash test of the test step in the test case is completed. According to the method, the configuration parameters and the flash process are separated, the test process is independent into each test step according to each function program, and each function program is combined according to the configuration parameters to obtain the test case, so that the test steps get rid of the dependency relationship with the current test project, and the corresponding flash process of the existing test project is prevented from being redeveloped. The method and the device have the advantages that the testers do not need to be familiar with the flash flow, the test points and the flash process realization principle of each test item, the technical level requirements on the testers are reduced, and the test steps can be arranged only according to the configuration parameters to realize the flash test process. In addition, before testing each test step, the test of expected result parameters is firstly carried out, the test processing is carried out only under the condition that the test result is successful, and the test of the next test step is carried out after the test result of the current test step is successful, so that the test time is saved, the universality of the flash test and the efficiency of the whole flash process are improved, and the accuracy of the final test result is improved.
On the basis of the above embodiment, the step S13 of checking the current testing step according to the expected result parameters to obtain a checking result includes:
obtaining a return result parameter of the current testing step, wherein the return result parameter is a result parameter fed back by calling a checking instruction sent by the current testing step;
comparing an expected result parameter corresponding to the current testing step with a returned result parameter;
when the expected result parameter is the same as the returned result parameter, determining that the test result is successful;
and when the expected result parameter is different from the returned result parameter, determining that the inspection result is failure.
Specifically, a return result parameter of the current testing step is obtained, where the return result parameter is an inspection instruction sent by calling the current testing step, and then a reply instruction, that is, a result parameter, is sent correspondingly according to the received detection instruction. It is understood that the returned result parameter is an actual parameter of the current testing step before the execution, and the expected result parameter corresponding to the current testing step is compared with the returned result parameter. The comparison process is to compare one digit of each character string with one digit, and when the digits are different, the two parameters are different. The comparison process can also be carried out in a regular matching mode to accelerate the comparison time, and other comparison modes can also be adopted, so that limitation is not required, and the comparison process can be set according to actual conditions.
And when the comparison results of the two parameters are the same, determining that the detection result is successful, and when the comparison results are different, determining that the detection result is failed.
In the test process of the expected result provided by this embodiment, the current test result is determined before the function test of the test step is performed, so as to provide a guarantee for the subsequent function test, and if the test result fails, the test of the current test item is ended, so as to save the time for the flash test and improve the efficiency of the flash test.
On the basis of the above embodiment, the step S12 of executing the test case of the file to be flashed through a plurality of test steps under the current test item includes:
obtaining a test point of a current test item, wherein the test point is a forward test point and/or a reverse test point;
and performing flash writing on each test step according to the test points to execute the test cases of the files to be flash written.
Specifically, the test point of the current test item is obtained, and the pressure test is only a test means, and is a repeated test aiming at each test case under the condition of testing the forward test point or the reverse test point. The test points are test function points, mainly comprise functional key points of test requirements, are approximate description or rough test of a test scene, and do not comprise specific test data. The test site may have an indication of test pass or fail.
And performing flash writing on each test step according to the test points to execute the test cases of the files to be flash written. When the test point is a forward test point, the test steps are listed in sequence to realize the successful case flashing, and when the test point is a reverse test point, as an embodiment, when the test point is the reverse test point, the test case flashing according to the test steps of the test point to execute the file to be flashed comprises the following steps:
when the reverse test type is the skip flashing step type, executing the test case of the file to be flashed according to the skip test step corresponding to the skip flashing step type without executing, wherein the skip test step is a test step except the skip flashing step in each test step;
and when the reverse test type is a short circuit disconnection type, carrying out protection operation processing according to the test step corresponding to the short circuit disconnection type. It CAN be understood that the test types of the reverse test point include a power short circuit disconnection, a CAN short circuit disconnection, a type of skipping the flashing step, and the like, and under the abnormal condition of the power short circuit disconnection and the CAN short circuit disconnection, the corresponding operation is the operation for protecting the flashing process, so the power short circuit disconnection and the CAN short circuit disconnection are combined into the short circuit disconnection type.
And when the test type of the reverse test point is the skip flashing step type, executing the test case of the file to be flashed according to the skip test step corresponding to the skip flashing step type without executing the skip test step. With reference to the foregoing example of the embodiment, in a Flash process, the Flash steps are Flash clearing, data downloading request, data transmission, and push-out transmission, and if the Flash clearing step is skipped, the test steps corresponding to the data downloading request, the data transmission, and the push-out transmission are not skipped.
When the flash type is a short-circuit disconnection type, a step of automatic operation is added at a time when access is needed, the step of automatic operation is protection operation such as automatic power off in the embodiment, and the automatic operation is directly powered off as long as the power supply and the CAN line are tested to be abnormal. In the existing flash test, the operation of a power supply and a CAN line needs manual operation, so that the opportunity cannot be accurately grasped, and the test result is influenced. The automatic operation in the embodiment enables the action of the control power supply CAN line in the test case to be automated, and accurate action control and time control are achieved. It should be noted that when the test case performs the short-circuit disconnection type of the reverse test point, RS232 needs to be called to interact with the CAN bus and the power supply voltage, and control the CAN line short-circuit disconnection, the power supply input voltage, and the like.
Correspondingly, the operation test of the power supply and the CAN refers to a specific flash step in a normal flash process, for example, the power supply is disconnected when the set voltage exceeds the limit, or the power supply is short-circuited, or the CAN is short-circuited, disconnected and the like.
The embodiment provides according to the test point to each test step write by brush, when the test point is reverse write by brush test point, write by brush to each test step according to different reverse test types, guarantee the process of writing by brush orderly, short circuit breaking connection type when reverse test point simultaneously can realize accurate action control and time control, improves efficiency of writing by brush.
On the basis of the above embodiment, the step S14 of calling the diagnostic function instruction to test the function corresponding to the current testing step to obtain a testing result includes:
acquiring a diagnosis function instruction, wherein the diagnosis function instruction is a sending function instruction, a reply function instruction or a checking result function instruction;
when the initial test results corresponding to the diagnosis function instruction are successful, determining that the test results are successful;
and when one result fails in the initial test result corresponding to the diagnosis function instruction, determining that the test result is a failure.
Specifically, the diagnosis function instruction is a send function instruction, a reply function instruction, or a check result function instruction, and the present embodiment provides only three types, and the actual diagnosis function instruction includes not only the three types, but also other diagnosis function instructions, which is only an embodiment and can be set according to actual situations.
And when the initial test results corresponding to the diagnosis function instructions are successful, determining that the test results are successful, and when the initial test results corresponding to the diagnosis function instructions are failed, determining that the test results are failed.
As an embodiment, the determining of the initial test result corresponding to the diagnostic function instruction includes:
when the diagnosis function instruction is a sending function instruction, recording the time of the CAN bus for sending the function instruction, if the time for sending the function instruction is within a first preset time, determining that the sending instruction is successful, and if the time for sending the function instruction exceeds the first preset time, determining that the sending instruction is failed;
when the diagnosis function instruction is a reply function instruction, determining the occurrence time of the reply function instruction, if the occurrence time of the reply function instruction is within a second preset time, determining that the receiving instruction is successful, and if the occurrence time of the reply function instruction exceeds the second preset time, determining that the receiving instruction is failed;
and when the diagnosis function instruction is a checking result function instruction, receiving a reply instruction, comparing the reply instruction with the expected result parameter of the current test step, if the reply instruction is the same as the expected result parameter, determining that the test result is successful, and if the reply instruction is the same as the expected result parameter, determining that the test result is failed.
Specifically, when the diagnostic function instruction is a send function instruction, the time when the CAN bus sends the send function instruction needs to be recorded, when the time is within a first preset time, it is determined that the send instruction is successful, and when the time is not within the first preset time, it is determined that the send instruction is failed. And the basic sending function is used for sending out the diagnosis instruction to be sent, and when the sent instruction appears on the CAN bus, the sending indicator is marked as success. If the sent instruction does not appear on the CAN bus within a certain time, the overtime is judged, and the result is marked as failure.
And when the diagnosis function instruction is a reply function instruction, determining the occurrence time of the reply function instruction, if the occurrence time of the reply function instruction is within a second preset time, determining that the receiving instruction is successful, and if the occurrence time of the reply function instruction exceeds the second preset time, determining that the receiving instruction is failed. And the basic receiving function marks the receiving indicator as successful when the ECU replies, and records the reply content. If no reply is received within a certain time, the overtime is judged, and the result is marked as failure.
When the diagnosis function instruction is a check result function instruction, receiving a reply instruction, and comparing the reply instruction with an expected result parameter of the current test step, where the comparison is performed for a function test of the execution test step, and the comparison process may be the same as or different from the above embodiment, and this embodiment is not limited. And a basic reply checking function, namely checking a sending instruction in real time, detecting a receiving instruction in real time after the sending is successful, and comparing the recorded reply content with the given expected result after the receiving is successful. If a reply is expected, the check result is flagged as successful, otherwise the result is flagged as failed.
The process of calling the diagnostic function instruction to test the functions corresponding to the test steps to obtain the final test result is provided in this embodiment, and the sending and receiving functions interact with the CAN bus to realize sending and receiving.
The content of step S14 is developed in case of successful test result, and in case of failed test result, as an embodiment, in case of failed test result, the method further comprises:
under the condition that the test result fails, determining that the test result is failed, and finishing the flash test of the test step of the test case in the current test project;
correspondingly, in the case of a test result failure, the method further comprises:
and under the condition that the test result fails, ending the flash test of the test step of the test case in the current test item.
Specifically, in order to save testing time and accuracy, in the case of a test result failure, a test effect corresponding to the current flashing process fails even if function detection corresponding to the subsequent test step is performed, so that when the current test result fails, it is determined that the test result fails, the flashing test of the current test item is ended, and the execution of the current test step is also ended.
In addition, in the case where the verification result is successful, when the test result is failed, the execution of the current test step is ended.
In the case that the test result fails, the test result is determined to be a failure, and the write-over test of the test step of the test case in the current test item is ended; and under the condition that the test result fails, finishing the flash test of the test step of the test case in the current test project, saving the detection time and improving the test efficiency.
On the basis of the above-described embodiment,
after completing the flash test of the test step in the test case, the method further comprises the following steps:
updating the execution result of the test case;
judging whether other test cases exist under the current test item;
if yes, returning to the step of acquiring the configuration parameters of the current test item and the file to be refreshed;
and if the current test item does not exist, ending the flash test of the current test item.
Specifically, after the test result is obtained, the execution result of the test case is updated, and it is also necessary to determine whether there is a subsequent test case to be executed, if so, the step S12 is returned to continue the execution, and if not, the flash test of the current test item is ended.
The execution result of the updated test case provided by the embodiment is used as the test mark, so that the problem that the test efficiency is low due to repeated updating of the existing unmarked test case is avoided.
On the basis that the embodiments corresponding to the flash test method are described in detail, the invention further discloses a flash test device corresponding to the method, and fig. 2 is a structural diagram of the flash test device provided by the embodiments of the invention. As shown in fig. 2, the flash test apparatus includes:
the acquisition module 11 is used for acquiring configuration parameters of a current test project and a file to be flashed;
a calling module 12, configured to call an expected result parameter corresponding to a current testing step in the configuration parameters, where a test case of the file to be flashed is executed through multiple testing steps under the current testing project, and the test case combines functional programs corresponding to the multiple testing steps according to the configuration parameters, and the functional programs corresponding to the multiple testing steps are packaged in advance;
the checking module 13 is configured to check the current testing step according to the expected result parameter to obtain a checking result, and call a diagnostic function instruction to test a function corresponding to the current testing step to obtain a testing result when the checking result is successful;
and a returning module 14, configured to, when the test result is successful, take the next testing step as the current testing step, and return to the step of calling the expected result parameter corresponding to the current testing step in the configuration parameters until the flash test of the testing step in the test case is completed.
Since the embodiment of the apparatus portion corresponds to the above-mentioned embodiment, the embodiment of the apparatus portion is described with reference to the embodiment of the method portion, and is not described again here.
For the introduction of the flash test apparatus provided by the present invention, please refer to the above method embodiment, which is not described herein again, and has the same beneficial effects as the above flash test method.
Fig. 3 is a structural diagram of another flash test apparatus according to an embodiment of the present invention, and as shown in fig. 3, the apparatus includes:
a memory 21 for storing a computer program;
a processor 22 for implementing the steps of the flash test method when executing the computer program.
The flash test device provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The Processor 22 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 22 may also include a main processor and a coprocessor, the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 22 may be integrated with a Graphics Processing Unit (GPU) that is responsible for rendering and rendering content that the display screen needs to display. In some embodiments, processor 22 may also include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 21 may include one or more computer-readable storage media, which may be non-transitory. Memory 21 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used for storing the following computer program 211, wherein after being loaded and executed by the processor 22, the computer program can implement the relevant steps of the flash test method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212, data 213, and the like, and the storage manner may be a transient storage or a permanent storage. Operating system 212 may include Windows, unix, linux, etc., among others. Data 213 may include, but is not limited to, data involved in a flash test method, and the like.
In some embodiments, the flash test device may further include a display 23, an input/output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.
Those skilled in the art will appreciate that the configuration shown in FIG. 3 is not intended to be limiting of the flash test apparatus and may include more or fewer components than those shown.
The processor 22 implements the flash test method provided by any of the above embodiments by calling instructions stored in the memory 21.
For the introduction of the flash test apparatus provided by the present invention, please refer to the above method embodiment, which is not described herein again, and has the same beneficial effects as the above flash test method.
Further, the present invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by the processor 22, implements the steps of the above-mentioned flash test method.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and performs all or part of the steps of the methods according to the embodiments of the present invention, or all or part of the technical solution. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which is not described herein again, and has the same beneficial effects as the above flash test method.
As an embodiment, fig. 4 is a flowchart of another method for performing a flash test according to an embodiment of the present invention, as shown in fig. 4, including:
s21: reading a project flash configuration file, and reading a flash file;
s22: starting to execute the test case;
s23: calling the function of the current flashing step and transmitting an expected result;
s24: judging whether the current result identification is successful, if so, entering a step S25, and if not, entering a step S30;
s25: calling a diagnosis instruction sending function, a diagnosis reply receiving function and a checking result function;
s26: judging whether the instruction information corresponding to the diagnosis instruction sending function, the diagnosis reply receiving function and the checking result function is successful, if so, entering a step S27, and if not, entering a step S28;
s27: the current result identification is successful;
s28: the current result identification fails;
s29: judging whether a subsequent flash test step exists, if so, returning to the step S23, and if not, entering the step S30;
s30: updating the test result;
s31: and judging whether a subsequent flash test case exists, if so, returning to the step S22, and if not, ending.
Fig. 5 is an application schematic diagram of the flash test method provided by the embodiment of the present invention, and as shown in fig. 5, the project configuration file and the flash process configure and execute the test case, the test case is in the test case module, the test process of the test case needs to interact with the CAN bus, the interaction process is to call the sending function, the receiving function and the short-circuit and open-circuit function of the RS232 module, the test case module calls the RS232 module, the module interacts with the CAN bus and the power supply voltage, and controls the short-circuit and open-circuit of the CAN line, the power supply input voltage, and the like.
For the introduction of the flow chart and the application schematic diagram of another flash test method provided by the present invention, please refer to the above method embodiment, which is not described herein again, and has the same beneficial effects as the above flash test method.
The detailed description of the flash test method, the flash test device and the medium provided by the invention is provided above. The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.

Claims (11)

1. A method for flash testing, comprising:
acquiring configuration parameters of a current test project and a file to be flashed;
calling an expected result parameter corresponding to a current testing step from the configuration parameters, wherein a test case of the file to be flashed is executed through a plurality of testing steps under the current testing item, the test case is obtained by combining functional programs corresponding to the testing steps according to the configuration parameters, and the functional programs corresponding to the testing steps are packaged in advance;
checking the current testing step according to the expected result parameter to obtain a checking result, and calling a diagnosis function instruction to test the function corresponding to the current testing step to obtain a testing result under the condition that the checking result is successful;
and under the condition that the test result is successful, taking the next test step as the current test step, and returning to the step of calling the expected result parameter corresponding to the current test step in the configuration parameters until the flash test of the test step in the test case is completed.
2. The flash testing method of claim 1, wherein said verifying said current testing step according to said expected result parameter to obtain a verified result comprises:
obtaining a return result parameter of the current testing step, wherein the return result parameter is a result parameter of a feedback of a checking instruction sent by calling the current testing step;
comparing the expected result parameter corresponding to the current testing step with the returned result parameter;
when the expected result parameter is the same as the return result parameter, determining that the test result is successful;
and when the expected result parameter is different from the return result parameter, determining that the checking result is failure.
3. The flash test method according to claim 2, wherein executing the test case of the file to be flashed through the plurality of test steps under the current test item comprises:
obtaining a test point of the current test item, wherein the test point is a forward test point and/or a reverse test point;
and performing flash writing on each test step according to the test points to execute the test case of the file to be flash written.
4. The flash test method according to claim 3, wherein when the test point is the reverse test point, the flash of each test step according to the test point to execute the test case of the file to be flashed comprises:
obtaining a reverse test type of the reverse test point, wherein the test type of the reverse test point comprises a skip flashing step type or a short circuit disconnection type;
when the reverse test type is the type of skipping the flashing step, executing the test case of the file to be flashed according to the skipping test step corresponding to the type of skipping the flashing step without executing the test case of the file to be flashed according to the step of skipping the flashing step, wherein the step of not skipping the testing is a testing step except the step of skipping the flashing step in each testing step;
and when the reverse test type is the short circuit disconnection type, carrying out protection operation processing according to the test step corresponding to the short circuit disconnection type.
5. The flash test method according to any one of claims 1 to 4, wherein the invoking the diagnosis function instruction to test the function corresponding to the current test step to obtain a test result comprises:
acquiring the diagnosis function instruction, wherein the diagnosis function instruction is a sending function instruction, a reply function instruction or a check result function instruction;
when the initial test results corresponding to the diagnosis function instruction are successful, determining that the test results are successful;
and when one result fails in the initial test result corresponding to the diagnosis function instruction, determining that the test result is a failure.
6. The flash test method of claim 5, wherein determining the initial test result corresponding to the diagnostic function instruction comprises:
when the diagnosis function instruction is the sending function instruction, recording the time of the CAN bus for the sending function instruction, if the time for the sending function instruction is within a first preset time, determining that the sending instruction is successful, and if the time for the sending function instruction exceeds the first preset time, determining that the sending instruction is failed;
when the diagnosis function instruction is the reply function instruction, determining the occurrence time of the reply function instruction, if the occurrence time of the reply function instruction is within a second preset time, determining that the receiving instruction is successful, and if the occurrence time of the reply function instruction exceeds the second preset time, determining that the receiving instruction is failed;
and when the diagnosis function instruction is the check result function instruction, receiving a reply instruction, comparing the reply instruction with the expected result parameter of the current test step, if the reply instruction is the same as the expected result parameter, determining that the test result is successful, and if the reply instruction is the same as the expected result parameter, determining that the test result is failed.
7. The flash test method of claim 6, wherein in the event the verification result fails, the method further comprises:
under the condition that the test result fails, determining that the test result is failed, and finishing the flash test of the test step of the test case in the current test item;
correspondingly, in the case that the test result fails, the method further includes:
and under the condition that the test result fails, ending the flash test of the test step of the test case in the current test item.
8. The method of claim 7, after completing the flash test of the test steps in the test case, further comprising:
updating the execution result of the test case;
judging whether other test cases exist under the current test item;
if yes, returning to the step of acquiring the configuration parameters of the current test item and the file to be refreshed;
and if the current test item does not exist, ending the flash test of the current test item.
9. An apparatus for testing a write-through, comprising:
the acquisition module is used for acquiring configuration parameters of a current test project and a file to be flashed;
the calling module is used for calling an expected result parameter corresponding to a current testing step in the configuration parameters, wherein a test case of the file to be flashed is executed through a plurality of testing steps under the current testing project, the test case is obtained by combining functional programs corresponding to the testing steps according to the configuration parameters, and the functional programs corresponding to the testing steps are packaged in advance;
the test module is used for testing the current test step according to the expected result parameter to obtain a test result, and calling a diagnostic function instruction to test the function corresponding to the current test step under the condition that the test result is successful to obtain a test result;
and the return module is used for taking the next testing step as the current testing step under the condition that the testing result is successful, and returning to the step of calling the expected result parameter corresponding to the current testing step in the configuration parameters until the flash test of the testing step in the test case is completed.
10. An apparatus for testing a write-through, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the flash testing method according to any of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the brush test method according to any one of claims 1 to 8.
CN202211637662.0A 2022-12-16 2022-12-16 Flash test method, device and medium Pending CN115840707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211637662.0A CN115840707A (en) 2022-12-16 2022-12-16 Flash test method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211637662.0A CN115840707A (en) 2022-12-16 2022-12-16 Flash test method, device and medium

Publications (1)

Publication Number Publication Date
CN115840707A true CN115840707A (en) 2023-03-24

Family

ID=85578895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211637662.0A Pending CN115840707A (en) 2022-12-16 2022-12-16 Flash test method, device and medium

Country Status (1)

Country Link
CN (1) CN115840707A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116340191A (en) * 2023-05-31 2023-06-27 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116340191A (en) * 2023-05-31 2023-06-27 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware
CN116340191B (en) * 2023-05-31 2023-08-08 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware

Similar Documents

Publication Publication Date Title
CN110348218B (en) Vulnerability testing method and device based on vehicle-mounted terminal system
CN115840707A (en) Flash test method, device and medium
CN115686961A (en) Processor testing method and device and electronic equipment
CN112948233A (en) Interface testing method, device, terminal equipment and medium
CN112445490A (en) File sequence processing method and device, terminal equipment and storage medium
CN110580220B (en) Method for measuring code segment execution time and terminal equipment
CN115391230A (en) Test script generation method, test script penetration method, test script generation device, test penetration device, test equipment and test medium
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
CN104516817A (en) Memory leak detection method and device
CN110647434A (en) Hardware self-checking method, device, communication equipment and storage medium
CN115495363A (en) Software testing method, electronic equipment and readable storage medium
CN114625106B (en) Method, device, electronic equipment and storage medium for vehicle diagnosis
CN116521405A (en) sd card state detection method, device, equipment and storage medium
CN115373929A (en) Test method, device, equipment, readable storage medium and program product
CN115470141A (en) Fault simulation method, device and related equipment
CN114564903A (en) Chip simulation design verification method, device, equipment and medium
CN111176975B (en) Test method, device, equipment and computer readable storage medium
CN117688564B (en) Detection method, device and storage medium for intelligent contract event log
US20240231347A1 (en) Fault injection test method and apparatus, and fault injection method
CN114116291B (en) Log detection method, log detection device, computer device and storage medium
CN115357458B (en) Method and device for testing TISDM display information
CN117094259A (en) Static time sequence analysis environment configuration method and device for integrated circuit
CN117992350A (en) Method and device for monitoring code test coverage rate and electronic equipment
CN115327953A (en) Simulation test method and device for intelligent driving algorithm, electronic equipment and medium
CN112559370A (en) Front-end-based React project unit testing method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination