File testing method and device, readable medium, electronic equipment and program product

By identifying and using the key (first -click) of the multi -language configuration file referenced in the source program file, test the multi -language configuration files to solve the low test efficiency and configuration problem of multi -language configuration files in existing technologies. The problem that is difficult to detect has achieved fast and comprehensive multi -language configuration file testing.

CN119336626APending Publication Date: 2025-01-21BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411338090.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When developing multilingual applications, it is difficult for the prior art to quickly and comprehensively test multilingual configuration files, resulting in possible configuration redundancy or missing problems, affecting product quality.

Method used

By scanning the source program files of the target application, identifying the source code's references to multi-language packages, extracting multiple first keys (i.e., the keys of the internationalized language packages) referenced in the source program files, and then using these first keys to optimize Test the subsequent multi-language configuration files to verify whether there are redundant or missing configurations.

Benefits of technology

This method can effectively verify whether the multi -language configuration file is suitable for the needs of target applications, improve test efficiency, and avoid product quality problems caused by configuration problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336626A_ABST
    Figure CN119336626A_ABST
Patent Text Reader

Abstract

The invention relates to a file testing method and device, a readable medium, electronic equipment and a program product. A source program file and a multi-language configuration file of a target application can be obtained; a plurality of first keys cited in the source program file are determined, the first keys are text identifiers used by a multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function; and testing the multi-language configuration file according to the plurality of first keys.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a file testing method, device, readable medium, electronic device and program product. Background Art

[0002] With the rapid development of mobile Internet, more and more applications (including applets) have emerged, covering users all over the world. In order to meet the needs of different users, developers need to internationalize applications in multiple languages ​​so that applications can meet the needs of different users based on multilingual functions.

[0003] Before launching an application's multilingual features, developers need to conduct comprehensive testing to avoid product quality issues after launch. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a file testing method, the method comprising: Obtain the source program files and multi-language configuration files of the target application; Determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function; The multi-language configuration file is tested according to the plurality of first keys.

[0006] In a second aspect, the present disclosure provides a file testing device, the device comprising: An acquisition module, used to acquire the source program files and multi-language configuration files of the target application; a determination module, configured to determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multilingual function of the target application, and the multilingual configuration file is a configuration file corresponding to the multilingual function; A testing module is used to test the multi-language configuration file according to the multiple first keys.

[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.

[0008] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.

[0009] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect of the present disclosure when the computer program is executed by a processor.

[0010] Through the above technical solution, the source program files of the target application can be scanned to identify the references of the target application source code to the multi-language package, and multiple first keys (i.e., the keys of the internationalized language package) referenced in the source program files can be extracted. Then, the optimized multi-language configuration files can be tested using the multiple first keys, so as to verify whether the optimized multi-language configuration files have redundant or missing configurations (such as key-value pairs in the language package) for the target application. Moreover, compared with the test method of covering all multi-language functions by writing test cases, the test efficiency can be greatly improved.

[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 The figure is a flow chart of a file testing method according to an exemplary embodiment.

[0013] Figure 2 is based on Figure 1 The illustrated embodiment shows a flow chart of a file testing method.

[0014] Figure 3 is based on Figure 1 The illustrated embodiment shows a flow chart of a file testing method.

[0015] Figure 4 The invention is a block diagram of a file testing device according to an exemplary embodiment.

[0016] Figure 5 is based on Figure 4 The illustrated embodiment shows a block diagram of a file testing device.

[0017] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0019] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0020] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0021] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0022] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0024] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0025] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0026] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0027] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0028] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0029] The present disclosure is mainly used in the scenario of testing the multi-language function of the application configuration. Taking the application as a mini program as an example, the mini program can download the multi-language configuration file from the international language configuration platform when packaging. In this way, the mini program can achieve multi-language text adaptation by referencing the local multi-language configuration file. In order to avoid the mini program package being too large, the international language of the mini program can be filtered and optimized when the mini program is packaged, and only the international language configuration that needs to be referenced by the current code is retained. In order to avoid product quality problems caused by optimization, the optimized mini program also needs to be quickly and comprehensively tested.

[0030] Taking mini programs as an example, since the internationalized multi-language configuration platform does not support remote acquisition of internationalized texts by the mini program side, the multi-language configuration files can only be packaged locally in the mini program. However, the mini program and the web management platform (referring to the management platform that is matched with the mini program) share a set of multi-language configuration files. With the continuous accumulation of functional iterations, the multi-language configuration files will gradually increase, and the impact of the increase in the size of the multi-language configuration files will continue to deepen. Then there will be the following problems: the mini program uses a hashmap-like reference method to reference the multi-language configuration file. Therefore, it is difficult to find out whether there is a problem with the key (that is, the key of each key-value pair in each language package in the multi-language configuration file) during the packaging stage. For the same business platform, mini programs and web management platforms have many shared multi-language configuration files, which cannot be distinguished in the short term, nor can they be configured separately, and need to be maintained. In addition, since the multi-language configuration key generated by the multi-language configuration platform is a random string of preset length (such as 10), it is impossible to distinguish whether the content of this key is applied to the application mini program, the web management platform, or both based on the meaning of the key of the multi-language configuration platform.

[0031] In the related art, after each mini program is packaged, all functions containing international configurations are tested according to the baseline test case, which can be done manually or automatically. However, this requires full coverage testing for each function involving multi-language configuration, and each function needs to write a test case. Both manual testing and UI automated testing require a lot of time investment, which cannot meet the current needs of rapid testing.

[0032] In another related technology, the multi-language configuration file of the application can be scanned to determine whether the configuration file is correct. However, this method can only verify whether the multi-language translation of a single content configuration is correct, and cannot verify whether the configuration file after filtering and optimization retains the multi-language configuration required by the current application.

[0033] In order to solve the above problems, the present invention provides a file testing method, device, readable medium, electronic device and program product. The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings.

[0034] Figure 1 FIG. 1 is a flowchart of a file testing method according to an exemplary embodiment. Figure 1 As shown, the method comprises the following steps: In step S101 , the source program file and multi-language configuration file of the target application are obtained.

[0035] Among them, the target application may include an application applet. The source program file refers to the source code file of the application applet. The multilingual configuration file refers to the configuration file corresponding to the multilingual function of the target application, and the multilingual configuration file includes multiple different language packs, and different language packs correspond to different types of languages ​​(such as Chinese, English, French, etc.). In this way, the target application can support the display of interface text content in multiple languages ​​based on the multilingual configuration file, that is, the target application can display corresponding text content according to the different language environments of users.

[0036] In this step, during the process of obtaining the multi-language configuration file of the target application, the multi-language configuration original file may be downloaded from the preset multi-language configuration platform; after filtering the multi-language configuration original file according to the multiple first keys, the multi-language configuration file is obtained.

[0037] The preset multi-language configuration platform may include an internationalized multi-language configuration platform. In the source program file stage of packaging the target application, a full multi-language configuration original file (i.e., a full internationalized language package file) may be downloaded from the internationalized multi-language configuration platform. The multi-language configuration original file may be, for example, a *.json file.

[0038] In addition, the multiple first keys refer to text identifiers used by the multi-language function of the target application. The text identifier can be understood as a key in each key-value pair in each language pack in the multi-language configuration file.

[0039] For example, in the multi-language configuration file corresponding to the target application, a key-value pair in the Chinese language package is "abcdefg123": "Welcome to our application!", and a key-value pair in the English language package is "abcdefg123": "Welcome to our application!", where "abcdefg123" is the key, and "Welcome to our application!" and "Welcome to our application!" are values ​​in different languages ​​corresponding to the key "abcdefg123". The first key corresponding to the text content "Welcome to our application!" or "Welcome to our application!" in the interface of the target application is "abcdefg123", which is only an example and is not limited to this in the present disclosure. It can be understood that different text contents of the target application can be identified by different first keys.

[0040] As mentioned above, during the packaging phase of the mini program, the full internationalized language package file is downloaded from the multi-language configuration platform. The full internationalized language package file contains not only the key-value pairs of the first key to be used by the current target application (i.e., the key referenced in the source program file of the target application), but also the keys used by other applications or web management platforms. In order to avoid the mini program package being too large, the full internationalized language package file downloaded can be filtered to only retain the multi-language configuration (i.e., the first key and the corresponding key-value pairs) that the current target application needs to reference.

[0041] In the process of filtering the original multi-language configuration file according to multiple first keys, the present disclosure can filter the keys in the original multi-language configuration file according to multiple first keys referenced in the source program file, and generate a json file containing only the first keys referenced in the source program file (i.e., the keys referenced in the source program file) as the optimized multi-language configuration file. When packaging the target application, the optimized multi-language configuration file can be used for packaging.

[0042] In step S102, a plurality of first keys referenced in the source program file are determined, where the first keys are text identifiers used by the multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function.

[0043] In a possible implementation of this step, the source program file may be parsed using an abstract syntax tree (AST) to obtain a target AST corresponding to the source program file; and a plurality of first keys may be determined based on the target AST using a preset matching algorithm.

[0044] The preset matching algorithm may include a regular matching algorithm.

[0045] For example, the source code in the source program file can be scanned, and the source code of the applet in the source program file can be parsed into a target AST based on an AST parser (such as acorn), and then the target AST is traversed, and regular expressions or other pattern matching techniques are used to identify nodes containing internationalized language strings, thereby obtaining the key of the multi-language configuration file referenced in the source program file as the first key.

[0046] These nodes are usually string literals or template strings. The multiple first keys are then further determined based on the nodes containing the internationalized language strings.

[0047] In step S103, the multi-language configuration file is tested according to the multiple first keys.

[0048] By performing this step, it can be verified whether there is any redundant or missing configuration (such as key-value pairs in the language pack) in the optimized multi-language configuration file for the target application.

[0049] By adopting the above method, the source program files of the target application can be scanned to identify the references of the target application source code to the multi-language package, and multiple first keys (i.e., the keys of the internationalized language package) referenced in the source program files can be extracted. Then, the optimized multi-language configuration files can be tested using the multiple first keys, so as to verify whether the optimized multi-language configuration files have redundant or missing configurations (such as key-value pairs in the language package) for the target application. Moreover, compared with the test method of covering all multi-language functions by writing test cases, the test efficiency can be greatly improved.

[0050] Figure 2 is based on Figure 1 The embodiment shown is a flowchart of a file testing method, such as Figure 2 As shown, step S103 includes the following sub-steps: In step S1031, a plurality of second keys in the multi-language configuration file are determined, where the second keys are text identifiers used to represent different texts in the multi-language configuration file.

[0051] In this step, the multiple second keys can be obtained by scanning multiple language packs (such as zh.json and en.json) in the multi-language configuration file. The second key refers to the key of each key-value pair in the multi-language configuration file. Unlike the first key mentioned above, the first key refers to the key referenced in the source program file of the target application, and the second key is the key in each key-value pair in the multi-language configuration file. It can be understood that both the first key and the second key can be regarded as text identifiers of different texts.

[0052] By way of example, the following describes a possible multi-language configuration file for a target application: { "en": { "abcdefg123": "Welcome to our application!", "in12345678": "Login", "out1234567": "Logout"}, "en": { "abcdefg123": "Welcome to our app!", "in12345678": "Log in", "out1234567": "Log out"} } Among them, "abcdefg123", "in12345678" and "out1234567" in the multi-language configuration file are the second key. This is only an example, and the present disclosure does not limit this.

[0053] In step S1032, a difference recognition is performed on the plurality of first keys and the plurality of second keys to obtain a first recognition result, where the first recognition result indicates whether there are redundant and / or missing second keys in the multi-language configuration file.

[0054] In a possible implementation of this step, the difference between the multiple first keys and the multiple second keys can be identified by performing a diff comparison on the multiple first keys and the multiple second keys. The diff comparison refers to a JSON diff comparison, and the difference between the multiple first keys and the multiple second keys can be identified by the JSON diff comparison.

[0055] It is understandable that if the multi-language configuration file of the target application does not have redundant and / or missing configurations, the multiple first keys and the multiple second keys should be completely consistent. Therefore, by performing a diff comparison on the multiple first keys and the multiple second keys, the differences between the multiple first keys and the multiple second keys can be determined, so as to further determine whether the multiple second keys are redundant and / or missing relative to the multiple first keys.

[0056] It should be emphasized here that in the test method of scanning multi-language configuration files in the related art, it can only verify whether the text content corresponding to each key in a single language package is translated correctly, and cannot verify whether the configuration in the multi-language configuration file (which can be understood as the second key) is redundant and / or missing.

[0057] Figure 3 is based on Figure 1 The embodiment shown is a flowchart of a file testing method, such as Figure 3 As shown, the method further comprises the following steps: In step S104, a difference recognition is performed on the second key respectively included in each of the multiple different language packages to obtain a second recognition result, where the second recognition result indicates whether the second keys in the multiple different language packages are completely consistent.

[0058] In this step, the difference identification can be achieved by performing a diff comparison on the second key respectively included in each language pack in a plurality of different language packs.

[0059] By performing this step, the second keys in different language packs in the multi-language configuration file can be compared to see whether they are completely consistent, thereby avoiding anomalies when performing language switching based on the multi-language function of the target application.

[0060] In one embodiment of the present disclosure, it is also possible to test whether the text content in the multi-language package has errors in format, grammar, symbols, etc. Figure 3 As shown, the method also includes: In step S105, for each language package in a plurality of different language packages, the text content corresponding to each second key in the language package is verified according to a preset dimension through a preset model; wherein the preset dimension includes at least one of the following: text format, text grammar, and text symbol.

[0061] In one implementation of this step, for each second key in the language pack, the text content corresponding to the second key and the verification requirement corresponding to the preset dimension may be input into a preset model, and then the verification result may be output through the preset model.

[0062] Among them, the verification requirements refer to the format, grammar or symbol requirements corresponding to the actual business scenario. For example, the verification requirements corresponding to the text format may be the font requirements and / or font size requirements of the text content, and the verification requirements corresponding to the text symbols may be the punctuation specifications of the text content to ensure that the punctuation is consistent with the sentence structure of the text. This is only an example, and the present disclosure is not limited to this. In the actual application scenario, the verification requirements corresponding to the preset dimension can be input into the preset model in the form of natural language instructions (text form or voice form). The verification result may include the detection result of whether the text content corresponding to each second key meets the verification requirements, and the verification result may further include specific problems with the format, grammar and symbols of the text content.

[0063] The preset model may be a pre-trained large language model (such as GPT (Generative Pre-trained Transformer), BERT (Bidirectional Encoder Representations from Transformers), and other models).

[0064] In a possible implementation, the verification result can be obtained by calling an open interface of the AI ​​platform (such as AI OpenApi) and inputting the text content corresponding to the second key and the verification requirements corresponding to the preset dimension into a preset model.

[0065] After the verification result is determined, a test report may be automatically generated based on the verification result. For example, the test report may display three different verification results: qualified, questionable, and unqualified.

[0066] In another embodiment of the present disclosure, it is also possible to compare whether the text content translation semantics corresponding to the same second key in multiple different language packages are consistent. Figure 3As shown, the method further comprises the following steps: In step S106, for each second key, the text content corresponding to the second key in each language package is obtained; through a preset model, a semantic consistency test is performed on the text content corresponding to the second key in each language package to obtain a test result; the test result represents whether the semantics of the text content corresponding to the second key is consistent in multiple different language packages.

[0067] It is understandable that the semantics of the text content corresponding to the same second key in different language packs in the multi-language configuration file should be completely consistent. If the semantics are inconsistent, an exception will occur when the target application switches the language.

[0068] By executing this step, the open interface of the AI ​​platform can be called to compare the text contents under the same configuration key (i.e., the second key) in different language packages in the multi-language configuration file based on the preset model to see whether they are semantically consistent, and a test report can be automatically generated based on the test results. For example, the test report can display three types of test results: consistent, questionable, and inconsistent.

[0069] By adopting the above method, the source program files of the target application can be scanned to identify the references of the target application source code to the multi-language package, and multiple first keys (i.e., the keys of the internationalized language package) referenced in the source program files can be extracted. Then, the optimized multi-language configuration files can be tested using the multiple first keys, so as to verify whether the optimized multi-language configuration files have redundant or missing configurations (such as key-value pairs in the language package) for the target application. Moreover, compared with the test method of covering all multi-language functions by writing test cases, the test efficiency can be greatly improved.

[0070] In addition, the file testing method provided in the present disclosure can also perform multi-dimensional dynamic detection on the optimized multi-language configuration file of the target application. Specifically, by scanning multiple file packages in the multi-language configuration file, it is possible to test whether the second keys in different language packages are completely consistent, thereby avoiding abnormalities when switching languages ​​based on the multi-language function of the target application, and the large language model can be used to test whether the text content translation semantics corresponding to the same second key in different language packages are consistent. The large language model can also be used to test whether the text content in the multi-language package has format, grammar, symbols and other errors. Therefore, the file testing method provided by the present disclosure can greatly improve the test efficiency while ensuring the overall accuracy of the test.

[0071] Figure 4 is a block diagram of a file testing device according to an exemplary embodiment. Figure 4 As shown, the device comprises: The acquisition module 401 is used to acquire the source program files and multi-language configuration files of the target application; A determination module 402 is used to determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function; The first testing module 403 is configured to test the multi-language configuration file according to the multiple first keys.

[0072] Optionally, the first testing module 403 is used to determine multiple second keys in the multilingual configuration file, where the second keys are text identifiers in the multilingual configuration file used to represent different texts; perform difference recognition on the multiple first keys and the multiple second keys to obtain a first recognition result, and the first recognition result indicates whether there are redundant and / or missing second keys in the multilingual configuration file.

[0073] Optionally, the determination module 402 is used to perform an abstract syntax tree AST parsing on the source program file to obtain a target AST corresponding to the source program file; and determine the multiple first keys through a preset matching algorithm according to the target AST.

[0074] Optionally, the multi-language configuration file includes a plurality of different language packages, and different language packages correspond to different types of languages; Figure 5 is based on Figure 4 The block diagram of a file testing device shown in the embodiment shown in FIG. Figure 5 As shown, the device also includes: The second testing module 404 is used to perform difference recognition on the second keys respectively included in each of the multiple different language packages to obtain a second recognition result, where the second recognition result indicates whether the second keys in the multiple different language packages are completely consistent.

[0075] Optionally, the second testing module 404 is further used to verify the text content corresponding to each second key in each language pack in the multiple different language packs according to preset dimensions through a preset model; wherein the preset dimensions include at least one of the following: text format, text grammar, and text symbols.

[0076] Optionally, the second testing module 404 is used to, for each second key in the language pack, input text content corresponding to the second key and a verification requirement corresponding to the preset dimension into the preset model, and then output a verification result through the preset model.

[0077] Optionally, the second test module 404 is further used to obtain, for each second key, the text content corresponding to the second key in each of the language packages; through a preset model, perform semantic consistency detection on the text content corresponding to the second key in each of the language packages to obtain a detection result; the detection result represents whether the semantics of the text content corresponding to the second key are consistent in the multiple different language packages.

[0078] Optionally, the acquisition module 401 is used to download a multi-language configuration original file from a preset multi-language configuration platform; and obtain the multi-language configuration file after filtering the multi-language configuration original file according to the multiple first keys.

[0079] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0080] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0081] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0082] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0083] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0084] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0085] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0086] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0087] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a source program file and a multilingual configuration file of a target application; determines a plurality of first keys referenced in the source program file, wherein the first key is a text identifier used by a multilingual function of the target application, and the multilingual configuration file is a configuration file corresponding to the multilingual function; and tests the multilingual configuration file according to the plurality of first keys.

[0088] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, an acquisition module may also be described as a "module for acquiring files".

[0091] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0092] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0093] According to one or more embodiments of the present disclosure, Example 1 provides a file testing method, including: Obtain the source program files and multi-language configuration files of the target application; Determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function; The multi-language configuration file is tested according to the plurality of first keys.

[0094] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein testing the multi-language configuration file according to the plurality of first keys comprises: Determine a plurality of second keys in the multi-language configuration file, where the second keys are text identifiers in the multi-language configuration file for representing different texts; Difference recognition is performed on the plurality of first keys and the plurality of second keys to obtain a first recognition result, wherein the first recognition result indicates whether there are redundant and / or missing second keys in the multi-language configuration file.

[0095] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein determining a plurality of first keys referenced in the source program file comprises: Performing an abstract syntax tree (AST) analysis on the source program file to obtain a target AST corresponding to the source program file; The plurality of first keys are determined according to the target AST through a preset matching algorithm.

[0096] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein the multi-language configuration file includes a plurality of different language packages, and different language packages correspond to different types of languages; the method further includes: A difference recognition is performed on the second keys respectively included in each of the multiple different language packages to obtain a second recognition result, where the second recognition result indicates whether the second keys in the multiple different language packages are completely consistent.

[0097] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the method further includes: For each language package in the multiple different language packages, verify the text content corresponding to each second key in the language package according to a preset dimension through a preset model; The preset dimension includes at least one of the following: Text format, text syntax, and text symbols.

[0098] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the checking of the text content corresponding to each second key in the language pack according to a preset dimension by using a preset model includes: For each second key in the language pack, after the text content corresponding to the second key and the verification requirement corresponding to the preset dimension are input into the preset model, the verification result is output through the preset model.

[0099] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 4, wherein the method further includes: For each of the second keys, obtaining text content corresponding to the second key in each of the language packages; Through a preset model, a semantic consistency check is performed on the text content corresponding to the second key in each of the language packages to obtain a test result; the test result represents whether the semantics of the text content corresponding to the second key are consistent in the multiple different language packages.

[0100] According to one or more embodiments of the present disclosure, Example 8 provides the method of any one of Examples 1-7, wherein obtaining the multi-language configuration file of the target application includes: Download the original multi-language configuration file from the preset multi-language configuration platform; After filtering the multi-language configuration original file according to the multiple first keys, the multi-language configuration file is obtained.

[0101] According to one or more embodiments of the present disclosure, Example 9 provides a file testing device, the device comprising: An acquisition module, used to acquire the source program files and multi-language configuration files of the target application; a determination module, configured to determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multilingual function of the target application, and the multilingual configuration file is a configuration file corresponding to the multilingual function; The first testing module is used to test the multi-language configuration file according to the multiple first keys.

[0102] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of the method described in any one of Examples 1-8 are implemented.

[0103] According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-8.

[0104] According to one or more embodiments of the present disclosure, Example 12 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-8 when executed by a processor.

[0105] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0106] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0107] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A file testing method, characterized in that: The method comprises: Obtain the source program files and multi-language configuration files of the target application; Determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multi-language function of the target application, and the multi-language configuration file is a configuration file corresponding to the multi-language function; The multi-language configuration file is tested according to the plurality of first keys.

2. The method according to claim 1, characterized in that The testing the multi-language configuration file according to the plurality of first keys comprises: Determine a plurality of second keys in the multi-language configuration file, where the second keys are text identifiers used to represent different texts in the multi-language configuration file; Difference recognition is performed on the plurality of first keys and the plurality of second keys to obtain a first recognition result, wherein the first recognition result indicates whether there are redundant and / or missing second keys in the multi-language configuration file.

3. The method according to claim 1, characterized in that Determining a plurality of first keys referenced in the source program file comprises: Performing an abstract syntax tree (AST) analysis on the source program file to obtain a target AST corresponding to the source program file; The plurality of first keys are determined according to the target AST through a preset matching algorithm.

4. The method according to claim 1, characterized in that: The multi-language configuration file includes a plurality of different language packages, and different language packages correspond to different types of languages; the method further includes: A difference recognition is performed on the second keys respectively included in each of the multiple different language packages to obtain a second recognition result, where the second recognition result indicates whether the second keys in the multiple different language packages are completely consistent.

5. The method according to claim 4, characterized in that The method further comprises: For each language package in the multiple different language packages, verify the text content corresponding to each second key in the language package according to a preset dimension through a preset model; The preset dimension includes at least one of the following: Text format, text syntax, and text symbols.

6. The method according to claim 5, characterized in that The checking of the text content corresponding to each second key in the language pack by using a preset model and performing preset dimension checking includes: For each second key in the language pack, after the text content corresponding to the second key and the verification requirement corresponding to the preset dimension are input into the preset model, the verification result is output through the preset model.

7. The method according to claim 4, characterized in that The method further comprises: For each of the second keys, obtaining text content corresponding to the second key in each of the language packages; Through a preset model, a semantic consistency check is performed on the text content corresponding to the second key in each of the language packages to obtain a test result; the test result represents whether the semantics of the text content corresponding to the second key are consistent in the multiple different language packages.

8. The method according to any one of claims 1 to 7, characterized in that: Acquiring the multi-language configuration file of the target application includes: Download the original multi-language configuration file from the preset multi-language configuration platform; After filtering the multi-language configuration original file according to the multiple first keys, the multi-language configuration file is obtained.

9. A file testing device, characterized in that: The device comprises: An acquisition module, used to acquire the source program files and multi-language configuration files of the target application; a determination module, configured to determine a plurality of first keys referenced in the source program file, wherein the first keys are text identifiers used by a multilingual function of the target application, and the multilingual configuration file is a configuration file corresponding to the multilingual function; The first testing module is used to test the multi-language configuration file according to the multiple first keys.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 8 are implemented.

11. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.