Test method, test device, electronic equipment and storage medium
By comparing the entries to be translated from standard translation materials and the machine under test, using preset algorithms and regular expressions to identify untranslated entries, the problem of missing translation of entries is solved, the translation accuracy and testing efficiency are improved, and manpower is saved .
Patent Information
- Application Number
- CN202410844834.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the machine is sent abroad, the staff cannot fully grasp the sub-functions of each platform, resulting in the missed translation of some entries, which affects the accuracy of the translation and wastes manpower.
By obtaining the standard translation material and the entries to be translated from the machine under test, comparing them with preset algorithms and regular expressions, determining the untranslated entries and generating a detection report to ensure that all entries are translated correctly.
It improves translation accuracy, saves manpower, shortens testing time, reduces the chance of market problems, and enhances testing efficiency and reliability.
Smart Images

Figure CN118982014A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software testing, and in particular to a testing method, a testing device, an electronic device and a storage medium. Background Art
[0002] At present, most machines in China use Chinese entries. When the machines are shipped abroad, the staff need to confirm that each entry has been correctly translated into a foreign language. However, when the staff cannot fully understand the sub-functions of each platform in the machine and abnormal situations, there is a problem that some entries are omitted from translation. Summary of the invention
[0003] The present application provides a testing method, a testing device, an electronic device and a storage medium, which can ensure that no entries are omitted from translation, improve translation accuracy and save manpower.
[0004] In a first aspect, an embodiment of the present application provides a testing method, the method comprising:
[0005] Obtaining standard translation materials and at least one term to be translated corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; the term to be translated and the preset term are both in the preset language form;
[0006] Comparing the term to be translated with the standard translation material;
[0007] If the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, the term to be translated is determined as an untranslated term.
[0008] In some embodiments, the machine under test includes multiple platforms, and obtaining at least one term to be translated corresponding to the machine under test includes:
[0009] Obtaining a code path for each of the plurality of platforms;
[0010] According to the code path of each platform, the code of each platform is traversed to obtain each term to be translated.
[0011] In some embodiments, the term to be translated is located in the code in a form matched by a regular expression, the preset term in the standard translation material and the corresponding translation result are stored in the form of a key-value pair, and the term to be translated is compared with the standard translation material, including:
[0012] According to a preset algorithm and the regular expression, the term to be translated is compared with the standard translation material to confirm whether the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material.
[0013] In some embodiments, after determining the to-be-translated term as the untranslated term, the method further includes:
[0014] Determining a code path where the untranslated term is located;
[0015] A detection report is generated according to each of the untranslated terms and the corresponding code path.
[0016] In some embodiments, the method further comprises:
[0017] If the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material, the term to be translated is determined as a translated term, and the number of times the translated term is traversed is counted;
[0018] Generating the detection report according to each of the untranslated terms and the corresponding code path, including:
[0019] The detection report is generated according to the untranslated terms and the corresponding code paths, the translated terms and the corresponding traversal times.
[0020] In some embodiments, the preset algorithm is a hash algorithm.
[0021] In some embodiments, after determining the to-be-translated term as the untranslated term, the method further includes:
[0022] Translating the untranslated term to determine at least one translation result corresponding to the untranslated term;
[0023] The standard translation material is updated according to the untranslated term and the corresponding at least one translation result.
[0024] In a second aspect, an embodiment of the present application provides a testing device, the testing device comprising an acquisition unit and a comparison unit; wherein,
[0025] The acquisition unit is configured to acquire standard translation materials and at least one to-be-translated term corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; the to-be-translated term and the preset term are both in the preset language form;
[0026] The comparison unit is configured to compare the term to be translated with the standard translation material; and if the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, determine the term to be translated as an untranslated term.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, wherein:
[0028] The memory is used to store a computer program that can be run on the processor;
[0029] The processor is configured to execute the method as described in any one of the first aspects when running the computer program.
[0030] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by at least one processor, the method as described in any one of the first aspects is implemented.
[0031] The embodiment of the present application provides a test method, a test device, an electronic device and a storage medium, the method comprising: obtaining standard translation materials and at least one to-be-translated term corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; the to-be-translated term and the preset term are both in the preset language form; the to-be-translated term and the standard translation material are compared; if the to-be-translated term and / or the translation result corresponding to the to-be-translated term do not exist in the standard translation material, the to-be-translated term is determined as an untranslated term. In this way, it can be ensured that there is no problem of missing a term in translation, which improves the translation accuracy and saves manpower. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of a testing method provided in the embodiment of the present application Figure 1 ;
[0033] Figure 2 A schematic diagram of a testing method provided in the embodiment of the present application Figure 2 ;
[0034] Figure 3 A schematic diagram of a testing method provided in the embodiment of the present application Figure 3 ;
[0035] Figure 4 A schematic diagram of the structure of a test device provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application Figure 1 ;
[0037] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0040] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0041] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0042] Currently, when testing machines that are shipped abroad, testers need to constantly switch between the various functions and pages of the various platforms in the machine to confirm that each entry has been correctly translated into a foreign language, such as English. In common software usage scenarios, it is usually necessary to actively or passively trigger pop-ups or status switches to fully check whether the entry has been fully translated. However, platform developers cannot fully understand the functions of each module, especially when multiple people are jointly developing the machine. Therefore, when testers cannot fully grasp the sub-functions and abnormal situations of each platform, there are cases where entries are missed, resulting in the problem that some entries are omitted from translation.
[0043] Based on this, the embodiment of the present application provides a testing method, which includes: obtaining standard translation materials and at least one to-be-translated term corresponding to the tested machine; the standard translation materials include at least one preset term, and at least one translation result of a target language corresponding to each preset term; the to-be-translated term and the preset term are both in the preset language form; the to-be-translated term is compared with the standard translation materials; if the to-be-translated term and / or the translation result corresponding to the to-be-translated term does not exist in the standard translation materials, the to-be-translated term is determined as an untranslated term. In this way, it can be ensured that there is no problem of missing a term in translation, which improves the translation accuracy and saves manpower.
[0044] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0045] In one embodiment of the present application, see Figure 1 , which shows a schematic diagram of a test method provided in an embodiment of the present application Figure 1 .like Figure 1 As shown, the method may include:
[0046] S101: Obtain standard translation materials and at least one term to be translated corresponding to the machine under test.
[0047] It should be noted that the present application embodiment provides a test method, specifically a method for quickly testing foreign language translation defects; the method can be developed based on programming language Python, but is not specifically limited to this. Wherein, the method can be applied to a test device (also referred to as a tool for quickly testing foreign language translation defects), or an electronic device integrated with the device. Here, the electronic device can be such as a computer, a smart phone, a tablet computer, a notebook computer, a palmtop computer, a personal digital assistant (Personal Digital Assistant, PDA), etc., and the present application embodiment is not specifically limited.
[0048] Here, the standard translation material includes at least one preset term, and the translation result of at least one target language corresponding to each preset term; the term to be translated and the preset term are both in the preset language form. The standard translation material can also be called a reference table, which is a standardized translation reference material. Among them, the preset terms refer to all the terms that the tested machine has in the initial state, that is, before product updates and iterations; the target language can be English, Japanese, Korean and other foreign languages, and the user can set the language according to actual needs; the preset language form refers to the language form of the terms that the tested machine has in the initial state and need to be translated. Exemplarily, the preset language form is in Chinese and the target language is English.
[0049] In addition, the machine under test is a machine that is sent abroad, each entry needs to be translated into a foreign language, and the tester needs to check whether all entries have been correctly translated.
[0050] It should also be noted that standard translation materials can be obtained by providing preset terms by ourselves and translation results by a third party, but there is no specific limitation on this.
[0051] It should also be noted that after obtaining the to-be-translated terms, the to-be-translated terms may be stored in a cache of the Python development tool, and this is not specifically limited.
[0052] In some embodiments, the machine under test includes multiple platforms, and obtaining at least one to-be-translated term corresponding to the machine under test includes:
[0053] Get the code path for each of multiple platforms;
[0054] According to the code path of each platform, traverse the code of each platform to obtain each term to be translated.
[0055] It should be noted that the code of each of the multiple platforms is different, so it is necessary to crawl the code of each platform in full according to the code paths of different platforms, obtain at least one entry to be translated corresponding to the machine under test, and test the machine under test.
[0056] In addition, the code path can be provided by the user. For example, the above test device can provide an interface for the user to enter the code path on the interface. After the user enters the above content and submits it, the test device can obtain the code path entered by the user and traverse all the codes according to the code path.
[0057] S102, comparing the term to be translated with the standard translation material.
[0058] It should be noted that although the standard translation material includes at least one preset term and at least one target language translation result corresponding to each preset term, the staff will update the code version or modify the Chinese terms during the product update and iteration of the tested machine, so there may still be a problem of missing terms being translated, and the standard translation material is not updated synchronously at this time. In this way, when the user wants to confirm whether there are any missing terms in the tested machine during the product update and iteration process or other situations that may cause the terms to be omitted from translation, the terms to be translated can be compared with the standard translation material to test the tested machine.
[0059] S103: If the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, the term to be translated is determined as an untranslated term.
[0060] That is, when there is no term to be translated in the standard translation material, or there is no translation result corresponding to the term to be translated in the standard translation material, or there is no term to be translated and the translation result corresponding to the term to be translated in the standard translation material, the term to be translated will be determined as an untranslated term.
[0061] In some embodiments, if there are terms to be translated and translation results corresponding to the terms to be translated in the standard translation material, the terms to be translated are determined as translated terms, and the number of times the translated terms are traversed is counted.
[0062] Here, the number of times the translated term is traversed refers to the number of times the translated term appears in all the terms to be translated in the tested machine, that is, the number of terms that are the same as the translated term. In this way, it is possible to understand which terms have a higher probability of appearing in the tested machine.
[0063] In some embodiments, after determining the term to be translated as an untranslated term, the testing method may further include:
[0064] Translating the untranslated terms and determining at least one translation result corresponding to the untranslated terms;
[0065] The standard translation material is updated according to the untranslated terms and the corresponding at least one translation result.
[0066] Specifically, the translation result refers to the translation result of at least one target language. In this way, after the standard translation material is updated, when the tested machine is updated again, the untranslated terms can be determined more accurately, thereby improving the translation accuracy and saving manpower.
[0067] The embodiment of the present application provides a testing method. When the tester detects the machine under test through the testing method, it can ensure that no entries are omitted and thus not translated, thereby improving the translation accuracy and saving manpower; in addition, it can shorten the testing time of the tester, improve the testing efficiency, provide more testing time for reliability testing, and reduce the probability of problems occurring in the machine under test in the market.
[0068] In another embodiment of the present application, see Figure 2 , which shows a schematic diagram of a test method provided in an embodiment of the present application Figure 2 .like Figure 2 As shown, the method may include:
[0069] S201: Obtain standard translation materials and at least one term to be translated corresponding to the machine under test.
[0070] S202: Compare the term to be translated with the standard translation material according to a preset algorithm and regular expression to confirm whether the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material.
[0071] S203: If the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, the term to be translated is determined as an untranslated term.
[0072] S204: Determine the code path where the untranslated terms are located.
[0073] S205: Generate a detection report based on each untranslated term and the corresponding code path.
[0074] It should be noted that, in the embodiment of the present application, step S201 corresponds to step S101 in the aforementioned embodiment, and step S203 corresponds to step S103 in the aforementioned embodiment, which will not be described in detail for the sake of brevity. In addition, step S202 is a specific implementation of step S102, and steps S204 and S205 are specific implementations after step S103 is executed, which will be described in detail below.
[0075] Step S202 is a specific implementation method of comparing the term to be translated with the standard translation material, wherein the term to be translated is located in the code in the form of a regular expression match, and the preset term in the standard translation material and the corresponding translation result are stored in the form of a key-value pair.
[0076] Among them, regular expressions are used to match, search, and replace text that conforms to specific rules. It consists of common characters and special characters (metacharacters), and can describe and match a series of strings that conform to certain syntactic rules. In addition, the preset terms and the translation results corresponding to the preset terms are stored in a hash table (HashMap) in the form of key-value pairs. The hash table is a mapping table that stores the mapping relationship of key-value pairs. Exemplarily, Chinese is the key and English is the value.
[0077] It should be noted that before comparing the terms to be translated with the standard translation materials, it is necessary to first determine whether the code style of each platform in the machine under test is standardized, that is, whether the code logic is unified. When the code logic of each platform is unified, the terms to be translated in the code can be crawled in full. Among them, the unified code logic means that the format of the terms in the preset language form to be translated needs to correspond to the preset language form matched by the regular expression, otherwise they cannot be matched. Exemplarily, taking Chinese as an example, the format of the Chinese to be translated in the code needs to correspond to the Chinese format matched by the regular expression. Exemplarily, the logic will match the following Chinese in the code: "Chinese ^%&%", and it will be matched if there is Chinese inside the quotation marks; <Chinese *&%>, and it will be matched if there is Chinese inside the parentheses, etc.
[0078] In some embodiments, the preset algorithm is a hash algorithm.
[0079] Since the preset terms and the corresponding translation results are stored in the hash table in the form of key-value pairs, preferably, the preset algorithm adopts a hash algorithm. Among them, the hash algorithm is a function that converts data into a unique value of a fixed size.
[0080] For steps S204 and S205, it is a specific implementation manner after determining the terms to be translated as untranslated terms. Specifically, determine the code paths corresponding to the untranslated terms in the multiple code paths of multiple platforms, and then generate a detection report according to the untranslated terms and the corresponding code paths.
[0081] It should be noted that the detection report can be generated through a spreadsheet, such as Excel, or can be automatically generated according to other software, and no specific limitation is made thereto.
[0082] In this way, the detection report can be automatically generated, saving the cumbersome manual operations, shortening the R & D cycle, and greatly improving the test efficiency. In addition, reflecting the untranslated terms and the corresponding code paths in the detection report can not only ensure that no terms are missed and there is no situation where terms are not translated, but also quickly find the specific positions of the untranslated terms, thereby avoiding missed tests by testers and effectively shortening the test time of testers.
[0083] When there are terms to be translated and the corresponding translation results in the standard translation materials, the terms to be translated are determined as translated terms, and the number of times the translated terms are traversed is counted; specifically, when generating a detection report according to each untranslated term and the corresponding code path, in some embodiments, the method further includes:
[0084] Generate a detection report according to the untranslated terms and the corresponding code paths, the translated terms and the corresponding number of times traversed.
[0085] In this way, the number of times the translated terms are traversed and the directory where the untranslated terms are located in the code (i.e., the code path) can be reflected in the detection report, and the untranslated terms that were omitted from translation can be quickly located to ensure that all terms are translated and not omitted.
[0086] To sum up, this embodiment provides a testing method, and the specific implementation of the aforementioned embodiment is elaborated in detail according to the above embodiment. It can be seen that according to the technical scheme of the aforementioned embodiment, by using the standard translation reference materials of different platforms in the tested machine as a reference table (i.e., standard translation materials), and by fully traversing the code of each platform, all the terms to be translated are obtained into the cache of the specified Python development tool, and finally the terms to be translated are quickly compared with the reference table through a preset algorithm, and the untranslated terms are scanned out and imported into the test report.
[0087] In a specific embodiment, see Figure 3 , which shows a schematic diagram of a test method provided in an embodiment of the present application Figure 3 .like Figure 3 As shown, the following steps may be specifically included:
[0088] S301, obtaining Chinese and foreign language reference tables (i.e., standard translation materials).
[0089] S302: Obtain a code path.
[0090] S303, crawling Chinese content (i.e., terms to be translated).
[0091] S304, storing the Chinese content in cache.
[0092] S305: Perform a full comparison between the Chinese and foreign language reference table and the Chinese content to determine whether there is Chinese content in the Chinese and foreign language reference table.
[0093] S306: If the judgment result is no, the storage path (ie, code path) of the untranslated entry is stored in the cache.
[0094] S307: If the judgment result is yes, then count the cache structure of the translated terms (ie, count the number of times the translated terms are traversed).
[0095] S308. Save in Excel.
[0096] S309: Export the scan report (ie, the detection report).
[0097] In an embodiment of the present application, for step S305, it is determined whether there is Chinese content in the Chinese-foreign language reference table, that is, whether the Chinese content has been translated or whether it is an untranslated term; if there is no Chinese content in the Chinese-foreign language reference table, that is, the judgment result is no, the term to be translated is determined as an untranslated term, and the code path where the untranslated term is located is determined and saved in the cache, that is, step S306 is executed; if there is Chinese content in the Chinese-foreign language reference table, that is, the judgment result is yes, the term to be translated is determined as a translated term, and the number of times the translated term is traversed is counted, that is, step S307 is executed.
[0098] It should be noted that, for step S302, the code path of each platform in the tested machine is obtained; after the code path is obtained, in step S303, according to the code path of each platform, the code of each platform is traversed to crawl each entry to be translated.
[0099] It should also be noted that after step S303 and step S306, the crawled Chinese content and the save path can be stored in the cache of the Python development tool, but this is not specifically limited.
[0100] In addition, in this embodiment, after step S306 and step S307, it is also necessary to store the untranslated terms and the corresponding code paths, the translated terms and the corresponding traversal times into a spreadsheet, such as Excel, so as to automatically generate a detection report.
[0101] This embodiment requires code style standardization, crawls all the terms to be translated in the code, and then compares them one by one with the standard translation materials, which can improve the comparison efficiency and accuracy, and reflects the number of translated terms and the directory of untranslated Chinese in the code in the test report to ensure that all Chinese translations are not missed, and the Chinese that is missed can be quickly located. This embodiment uses a computer instead of manual judgment to ensure the accuracy of the translation and save manpower; and can automatically generate test reports, eliminating tedious manual operations, shortening the R&D cycle, and greatly improving test efficiency. In addition, it provides more testing time for reliability testing, reduces the probability of problems occurring in the market, and provides an effective method for standardized translation problem testing.
[0102] In another embodiment of the present application, see Figure 4 , which shows a schematic diagram of the composition structure of a testing device provided in an embodiment of the present application. Figure 4 As shown, the testing device 40 may include an acquisition unit 401 and a comparison unit 402, wherein:
[0103] The acquisition unit 401 is configured to acquire standard translation materials and at least one to-be-translated term corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; both the to-be-translated term and the preset term are in the preset language form;
[0104] The comparison unit 402 is configured to compare the term to be translated with the standard translation material; and if the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, determine the term to be translated as an untranslated term.
[0105] In some embodiments, the machine under test includes multiple platforms, and the acquisition unit 401 is further configured to acquire the code path of each of the multiple platforms; according to the code path of each platform, traverse the code of each platform to acquire each term to be translated.
[0106] In some embodiments, the term to be translated is located in the code in a form matched by a regular expression, and the preset terms in the standard translation material and the corresponding translation results are stored in the form of key-value pairs. The comparison unit 402 is also configured to compare the term to be translated with the standard translation material according to a preset algorithm and a regular expression to confirm whether the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material.
[0107] In some embodiments, Figure 4 As shown, the testing device 40 may further include a generating unit 403 configured to determine the code path where the untranslated terms are located; and generate a detection report according to each untranslated term and the corresponding code path.
[0108] In some embodiments, the comparison unit 402 is further configured to determine the term to be translated as a translated term if there is a term to be translated and a translation result corresponding to the term to be translated in the standard translation material, and count the number of times the translated term is traversed. Correspondingly, the generation unit 403 is further configured to generate a detection report based on the untranslated term and the corresponding code path, the translated term and the corresponding number of times it is traversed.
[0109] In some embodiments, the preset algorithm is a hash algorithm.
[0110] In some embodiments, Figure 4 As shown, the testing device 40 may further include an updating unit 404 configured to translate the untranslated terms, determine at least one translation result corresponding to the untranslated terms, and update the standard translation material according to the untranslated terms and the corresponding at least one translation result.
[0111] It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0112] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0113] Therefore, this embodiment provides a computer storage medium (referred to as storage medium for short), which stores a computer program. When the computer program is executed by at least one processor, the steps of the test method described in any one of the aforementioned embodiments are implemented.
[0114] Based on the composition and storage medium of the above-mentioned testing device 40, see Figure 5 , which shows a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application Figure 1 .like Figure 5 As shown, the electronic device 50 may include: a communication interface 501, a memory 502 and a processor 503; each component is coupled together via a bus system 504. It is understood that the bus system 504 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 504. Among them, the communication interface 501 is used for receiving and sending signals in the process of sending and receiving information between other external network elements;
[0115] A memory 502, used to store a computer program that can be run on the processor 503;
[0116] The processor 503 is configured to execute, when running the computer program:
[0117] Obtaining standard translation materials and at least one term to be translated corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; both the term to be translated and the preset term are in the preset language form;
[0118] Compare the terms to be translated with the standard translation materials;
[0119] If the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, the term to be translated is determined as an untranslated term.
[0120] It can be understood that the memory 502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0121] The processor 503 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 503. The above processor 503 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 503 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0122] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0123] For software implementation, the techniques described herein can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0124] Optionally, as another embodiment, the processor 503 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
[0125] In yet another embodiment of the present application, see Figure 6 , which shows a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application Figure 2 .like Figure 6 As shown, the electronic device 50 at least includes the testing device 40 described in any one of the aforementioned embodiments.
[0126] In the embodiment of the present application, for the electronic device 50, it can be ensured that there is no problem of missing entries in translation, thereby improving translation accuracy and saving manpower.
[0127] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
[0128] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0129] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0130] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0131] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0132] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0133] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A testing method, characterized in that: The method comprises: Obtaining standard translation materials and at least one term to be translated corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; the term to be translated and the preset term are both in the preset language form; Comparing the term to be translated with the standard translation material; If the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, the term to be translated is determined as an untranslated term.
2. The method according to claim 1, characterized in that The machine under test includes multiple platforms, and obtaining at least one term to be translated corresponding to the machine under test includes: Obtaining a code path for each of the plurality of platforms; According to the code path of each platform, the code of each platform is traversed to obtain each term to be translated.
3. The method according to claim 2, characterized in that The term to be translated is located in the code in the form matched by a regular expression, the preset term in the standard translation material and the corresponding translation result are stored in the form of a key-value pair, and the term to be translated is compared with the standard translation material, including: According to a preset algorithm and the regular expression, the term to be translated is compared with the standard translation material to confirm whether the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material.
4. The method according to claim 2, characterized in that: After determining the to-be-translated term as the untranslated term, the method further includes: Determining a code path where the untranslated term is located; A detection report is generated according to each of the untranslated terms and the corresponding code path.
5. The method according to claim 4, characterized in that The method further comprises: If the term to be translated and the translation result corresponding to the term to be translated exist in the standard translation material, the term to be translated is determined as a translated term, and the number of times the translated term is traversed is counted; Generating the detection report according to each of the untranslated terms and the corresponding code path includes: The detection report is generated according to the untranslated terms and the corresponding code paths, the translated terms and the corresponding traversal times.
6. The method according to claim 3, characterized in that The preset algorithm is a hash algorithm.
7. The method according to any one of claims 1 to 6, characterized in that After determining the to-be-translated term as the untranslated term, the method further includes: Translating the untranslated term to determine at least one translation result corresponding to the untranslated term; The standard translation material is updated according to the untranslated term and the corresponding at least one translation result.
8. A testing device, characterized in that: The testing device comprises an acquisition unit and a comparison unit; wherein, The acquisition unit is configured to acquire standard translation materials and at least one to-be-translated term corresponding to the tested machine; the standard translation materials include at least one preset term and at least one translation result of a target language corresponding to each preset term; the to-be-translated term and the preset term are both in the preset language form; The comparison unit is configured to compare the term to be translated with the standard translation material; and if the term to be translated and / or the translation result corresponding to the term to be translated does not exist in the standard translation material, determine the term to be translated as an untranslated term.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is used to store a computer program that can be run on the processor; The processor is configured to execute the method according to any one of claims 1 to 7 when running the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 7 is implemented.
