Multi-language version software testing method and device, electronic equipment and storage medium
By identifying the set of text controls in multilingual software testing, traversing and saving interface screenshots, and calculating coverage, the problem of incomplete text control testing was solved, achieving efficient and accurate multilingual testing, avoiding translation errors and omissions, and improving the level of test automation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the testing coverage of text controls is incomplete during the multilingual software testing process, resulting in frequent instances of incorrect translation display and omissions, which affect the game's reputation and cause economic losses. There is a lack of efficient tools or methods to ensure completeness and accuracy.
By identifying the set of text controls to be tested in the first language version of the target game, traversing and testing each text control, saving screenshots of the interface, calculating test coverage, and when a preset value is reached, determining the screenshot set for automatic testing of the second language version, thus avoiding duplicate test paths.
It improves the efficiency and accuracy of multilingual testing, ensures the completeness of test coverage, reduces the risk of translation errors and omissions, and enhances the automation and accuracy of testing.
Smart Images

Figure CN122019375A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text testing, and more particularly to a method, apparatus, electronic device, and storage medium for testing multilingual software versions. Background Technology
[0002] In the quality assurance of the software testing industry, UI interface testing accounts for a high proportion of functional testing, and text control testing also accounts for a considerable proportion of UI testing. For software or games exported overseas, the text displayed on text controls needs to be translated and then displayed on the interface for testing, resulting in a lot of text translations needing to be tested on the interface.
[0003] For testers, testing text controls on the interface is limited to black-box methods. However, due to unclear UI requirements documentation and incomplete test case coverage, some text controls are frequently missed during testing. There is no efficient tool or method to check whether the weekly text control tests are fully covered. The testing process relies entirely on human experience, which is rather blind. Incorrect translations and omissions frequently occur on foreign servers, causing confusion among players and leading to a decline in the game's reputation and economic losses. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and storage medium for testing multilingual software, to ensure the completeness of test coverage and improve the efficiency and accuracy of multilingual testing.
[0005] According to one aspect of the present invention, a method for testing multilingual software is provided, the method comprising: Determine the set of text controls; the set of text controls is the set of the first text controls that need to be tested in the first language version of the target game; Determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set. Based on the first screenshot set and the text control set, the test coverage is determined, and the first screenshot set when the test coverage reaches a preset value is determined as the second screenshot set; Based on the second set of screenshots, the text control of the second language version of the target game is tested.
[0006] According to another aspect of the present invention, a multilingual text testing apparatus is provided, the apparatus comprising: The control set determination module is used to determine the text control set; the text control set is the set of the first text controls that need to be tested in the first language version of the target game; The first testing module is used to determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set. The coverage determination module is used to determine the test coverage based on the first screenshot set and the text control set, and to determine the first screenshot set when the test coverage reaches a preset value as the second screenshot set; The second testing module is used to test the text controls of the second language version of the target game based on the second set of screenshots.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multilingual version software testing method according to any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the multilingual version software testing method according to any embodiment of the present invention.
[0009] The technical solution of this invention determines the set of first text controls to be tested in the first language version of the target game as a text control set, thereby accurately identifying the text controls to be tested. Text control testing is then performed based on this text control set to avoid missing any text controls. Next, each second text control contained in each first display interface corresponding to the first language version of the target game is determined. By traversing each second text control, when it is determined that the currently traversed second text control exists in the text control set, the currently traversed second text control is precisely tested. After testing, a screenshot of the first interface of the first display interface corresponding to the currently traversed second text control is saved in a first screenshot set. Because there is a correspondence between the first interface screenshot and the first text control being tested, saving the first interface screenshot of the first display interface corresponding to the tested first text control allows for precise identification of which first text control in the text control set has been tested. Furthermore, based on the first set of screenshots and the set of text controls, the test coverage is determined to ensure the integrity of the test coverage. Then, the first set of screenshots when the test coverage reaches a preset value is determined as the second set of screenshots. This allows for automatic and accurate testing of text controls in the second language version of the target game based on the second set of screenshots. As a result, other language versions do not need to repeat complex test paths and can directly perform language-specific verification based on screenshots, which greatly improves the efficiency and accuracy of multilingual testing.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of a multilingual version software testing method provided by an embodiment of the present invention; Figure 2 This is a flowchart of another multilingual version software testing method provided by an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a multilingual text testing device according to an embodiment of the present invention; Figure 4This is a schematic diagram of the structure of an electronic device that implements the multilingual version software testing method of the present invention, according to an embodiment of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] Figure 1 This is a flowchart illustrating a multilingual software testing method provided in an embodiment of the present invention. This embodiment is applicable to testing multilingual text controls for the same game version. The method can be executed by a multilingual text testing device, which can be implemented in hardware and / or software and can be configured in any electronic device with network communication capabilities. Figure 1 As shown, the multilingual version software testing method of the present invention may include the following steps: S110. Determine the text control set; the text control set is the set of the first text controls that need to be tested in the first language version of the target game.
[0016] Text controls, in this context, refer to UI elements used in graphical user interfaces or game interfaces to display text information and respond to text content updates, style adjustments, and user interactions. Their main functions include presenting text content, controlling text styles, and data binding and interaction with users or system logic. The first language version can be understood as the latest game version where the target game's content is presented in the first language; the first language refers to the language type used by the target game.
[0017] Specifically, determining the text control set may include: if the first language version of the target game is the first development version, then all text controls in the first language version of the target game are determined as the first text controls; if the first language version of the target game is not the first development version, then text controls in the first language version of the target game that differ from previous game versions are determined as the first text controls; the first language version of the target game is the latest game version developed based on previous game versions; and all first text controls are set as a text control set.
[0018] Accordingly, identifying the text control that differs between the first language version of the target game and the historical game version as the first text control may include: obtaining a first text identifier list for the first language version of the target game and a second text identifier list for the historical game version; the first text identifier list is a set of text identifier strings (TIDS) for all text controls in the first language version of the target game; the second text identifier list is a set of text identifier strings for all text controls in the historical game version; since the text identifier strings of the differentiated text controls are different, the text identifier string of the first text identifier list that differs from the second text identifier list is identified as the target text identifier string, and the text control of the first language version of the target game corresponding to the target text identifier string is identified as the first text control.
[0019] In an embodiment of the present invention, optionally, determining a text control that differs from a previous version of the target game in its first language as the first text control may include steps A1-A5: Step A1: Obtain the first code set of the target game's first language version and the second code set of the historical game versions; wherein, the code set includes, but is not limited to, source code files, UI script files, localization processing code files and related configuration files.
[0020] Step A2: Based on the UI framework and text management mechanism adopted by the game, determine the first reference code set of the first reference text control from the first code set; based on the UI framework and text management mechanism adopted by the game, determine the second reference code set of the second reference text control from the second code set; wherein, the reference code set may include, but is not limited to, code files and code directories related to text control creation, text content assignment, text style setting, localization mapping and text refresh logic.
[0021] Step A3: Use a code difference analysis tool to compare the first and second reference code sets file by file and line by line, identify the addition, modification and deletion operations of the code, and generate code difference information.
[0022] Step A4: Based on the feature information and code differentiation information of the text control, determine the change points of the text control; among which, the change points may include, but are not limited to, changes in the instantiation, lookup or mounting path of the text control; changes in the text content assignment statement or data source; modifications to text style properties (font, font size, color, alignment, etc.); changes in localized function calls or localized key values; and modifications to the text control event handling logic or dynamic refresh logic.
[0023] Step A5: Determine the third and fourth reference text controls based on the change points, and designate the third and fourth reference text controls as the first text controls, so as to form a text control set by combining all the first text controls.
[0024] The third reference text control can be understood as the text control that directly changes after the historical game version changes to the first language version of the target game; the fourth reference text control can be understood as the text control that indirectly changes after the historical game version changes to the first language version of the target game. For example, the impact of some text controls is not limited to the code change of a single text control, but may also be indirectly affected by changes in the text management module, UI loading logic, or configuration table loading mechanism.
[0025] In addition, the text control set can be verified by UI design diagrams, configuration table differences, and in-game debugging information. Text controls that have no practical impact can be removed, and missing controls can be added to form the final text control set.
[0026] In this embodiment of the invention, by comparing the code sets of the first language version of the target game with those of historical game versions, the text controls that are directly and indirectly affected by the version update can be accurately identified, thereby improving the accuracy of identifying the set of text controls that are differentiated.
[0027] S120. Determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set.
[0028] Specifically, the description file corresponding to the first display interface is obtained. The description file contains the configuration information of all controls in the first display interface, such as control ID, type, position, and text content. The control entries in the description file are parsed, and the second text control is selected based on the text control type field. The attribute information of the second text control is then extracted, including its ID, text content, and style.
[0029] Optionally, determining the second text controls contained in each first display interface corresponding to the first language version of the target game may include: determining the UI control tree of each first display interface corresponding to the first language version of the target game, traversing the UI control tree, and obtaining the second text controls.
[0030] Among them, the UI control tree can be a tree-shaped data model used to describe the hierarchical structure of user interface components, and it is the core foundation for front-end rendering, component management, and event dispatching.
[0031] Specifically, obtain the UI resources corresponding to the first display interface; the UI resources are used to describe the hierarchical structure of the interface and all the UI controls it contains; the UI resources may include UI prefabs, UI layout files, interface configuration tables or UI tree structure data.
[0032] The acquired UI interface resources are parsed to generate a corresponding UI control tree. Each node in the UI control tree represents a UI control and records the control's type, name, path, parent node, and child node information.
[0033] Then, the UI control tree is traversed in a depth-first or breadth-first manner. The control type of each node is determined, the target node that belongs to the text control type is selected, the text control corresponding to the target node is determined as the second text control, and the attribute information of the second text control is recorded.
[0034] The text control types include, but are not limited to, text display components, rich text components, and localized text components. The attribute information of the second text control can include control identifier, control path, control type, text content, style attributes, and layout attributes. The control path can be understood as the hierarchical path in the UI control tree; the control type can be understood as static text, dynamic text, rich text, etc.; the text content can be understood as the initial text or bound localized key-value pairs; style attributes can be understood as font, font size, color, alignment, etc.; and layout attributes can be understood as position, size, anchor points, etc.
[0035] In this embodiment of the invention, the UI control tree of each first display interface corresponding to the first language version of the target game is determined, and the second text control is obtained by traversing the UI control tree. The introduction of the UI control tree can realize the automatic and fast acquisition of the text controls contained in the first display interface.
[0036] Accordingly, each second text control is traversed. When it is determined that the currently traversed second text control exists in the text control collection, the currently traversed second text control is tested. After the test is completed, the first screenshot of the first display interface corresponding to the currently traversed second text control and the attribute information of the currently traversed second text control are saved in the first screenshot collection, and the test status of the first text control corresponding to the first interface screenshot is marked as tested.
[0037] S130. Based on the first screenshot set and the text control set, determine the test coverage, and determine the first screenshot set when the test coverage reaches the preset value as the second screenshot set.
[0038] Specifically, the test status of the first text control corresponding to the first interface screenshot in the first screenshot set is "tested". The ratio of the number of first interface screenshots in the first screenshot set to the number of first text controls in the text control set is used as the test coverage. The preset value can be 100%. When the test coverage reaches 100%, the first screenshot set with 100% test coverage is determined as the second screenshot set, so that the text controls of the second language version of the target game can be tested based on the second screenshot set.
[0039] S140. Based on the second screenshot set, test the text control on the second language version of the target game.
[0040] The second language version can be understood as the latest version of the target game where the content is presented in a second language; the second language can be understood as the language type used in the game version, which is different from the first language.
[0041] Specifically, the first text control corresponding to the first interface screenshot is obtained and identified as the fifth text control. Based on the interface information of the first interface screenshot corresponding to the fifth text control, the reference display interface corresponding to the second language version of the target game is called, and the reference display interface is screenshotted to obtain a reference interface screenshot. It is determined whether the semantic information between the reference interface screenshot and the first interface screenshot corresponding to the fifth text control is consistent. If they are consistent, it is determined that the text control test of the second language version of the target game is successful, and the risk of translation errors and omissions is avoided.
[0042] The technical solution of this invention determines the set of first text controls to be tested in the first language version of the target game as a text control set, thereby accurately identifying the text controls to be tested. Text control testing is then performed based on this text control set to avoid missing any text controls. Next, each second text control contained in each first display interface corresponding to the first language version of the target game is determined. By traversing each second text control, when it is determined that the currently traversed second text control exists in the text control set, the currently traversed second text control is precisely tested. After testing, a screenshot of the first interface of the first display interface corresponding to the currently traversed second text control is saved in a first screenshot set. Because there is a correspondence between the first interface screenshot and the first text control being tested, saving the first interface screenshot of the first display interface corresponding to the tested first text control allows for precise identification of which first text control in the text control set has been tested. Furthermore, based on the first set of screenshots and the set of text controls, the test coverage is determined to ensure the integrity of the test coverage. Then, the first set of screenshots when the test coverage reaches a preset value is determined as the second set of screenshots. This allows for automatic and accurate testing of text controls in the second language version of the target game based on the second set of screenshots. As a result, other language versions do not need to repeat complex test paths and can directly perform language-specific verification based on screenshots, which greatly improves the efficiency and accuracy of multilingual testing.
[0043] Figure 2 This is a flowchart illustrating another multilingual software testing method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of the multilingual software testing method based on the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, the method includes: S210. Determine the text control set; the text control set is the set of the first text controls that need to be tested in the first language version of the target game.
[0044] S220. Determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set.
[0045] Specifically, determine the UI control tree of each first display interface corresponding to the first language version of the target game, traverse the UI control tree to obtain the second text control, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control; Furthermore, saving the screenshot of the first interface of the first display screen corresponding to the currently traversed second text control in the first screenshot set can include: identifying the second text control corresponding to the first text control in the text control set as the fourth text control; and saving the text hierarchy information corresponding to the fourth text control and the screenshot of the first interface corresponding to the currently traversed second text control in the first screenshot set. Here, the text hierarchy information can be understood as the hierarchical path of the corresponding node in the UI control tree. The hierarchical path is unique, and it can be used to directly call the display screen of the first game version in other languages, achieving quick location of the interface of the text control being tested, reducing the number of searches, and improving testing efficiency.
[0046] S230. Based on the first screenshot set and the text control set, determine the test coverage, and determine the first screenshot set when the test coverage reaches the preset value as the second screenshot set.
[0047] The preset value can be a value within a preset range that is set according to actual needs.
[0048] S240. Based on the interface information of the first interface screenshot, call the second display interface corresponding to the second language version of the target game, and take a screenshot of the second display interface to obtain the second interface screenshot.
[0049] Specifically, the interface information may include the attribute information of the text control to be tested. Based on the attribute information of the text control to be tested corresponding to the first interface screenshot, the second display interface corresponding to the second language version of the target game is called, and the second display interface is screenshotted to obtain the second interface screenshot.
[0050] Optionally, the first screenshot set stores the text hierarchy information corresponding to the fourth text control and the first interface screenshot. The fourth text control is the second text control corresponding to the first text control in the text control set. Further, calling the second display interface corresponding to the second language version of the target game based on the interface information of the first interface screenshot may include: obtaining the reference text hierarchy information of the fourth text control corresponding to the first interface screenshot from the first screenshot set, and calling the second display interface corresponding to the second language version of the target game based on the reference text hierarchy information, thereby quickly locating the interface of the tested text control in the second language version of the target game, reducing the number of searches, and improving testing efficiency.
[0051] S250. Based on the first interface screenshot and the second interface screenshot, determine whether there is a third text control in the second interface screenshot; the third text control is a text control with the same semantics and position as the fourth text control in the first interface screenshot; the fourth text control is the second text control corresponding to the first text control in the text control set.
[0052] Specifically, preprocessing operations are performed on the first and second interface screenshots respectively to obtain preprocessed first and second interface screenshots; among which, the preprocessing operations may include, but are not limited to, grayscale conversion, median denoising, binarization enhancement and resolution normalization.
[0053] Then, text recognition is performed on the preprocessed first interface screenshot to obtain the first reference text content and first position information of the fourth text control; based on the first position information, text recognition is performed on the preprocessed second interface screenshot to obtain the second reference text content; according to the standard translation mapping table, it is determined whether the semantics between the first and second reference text contents are the same. If they are the same, it is determined that a third text control exists in the second interface screenshot; if they are not the same, it is determined that a third text control does not exist in the second interface screenshot. This achieves the test of whether there are translation errors or omissions in the text control to be tested in the second language version of the target game. The standard translation mapping table contains the second language text information corresponding to all the first language text information in the interface to be compared.
[0054] Optionally, determining whether a third text control exists in the second interface screenshot based on the first and second interface screenshots may include: processing the first and second interface screenshots using a large language model to determine whether a third text control exists in the second interface screenshot. Specifically, the large language model extracts a first set of text blocks from the first interface screenshot and a second set of text blocks from the second interface screenshot; the first set of text blocks stores the first reference position information and the first reference content information of the text control corresponding to the first interface screenshot; the second set of text blocks stores the second reference position information and the second reference content information of the text control corresponding to the second interface screenshot; based on the first and second reference content information, a pair of text controls with the same semantics in the first and second interface screenshots is determined; based on the first and second reference position information, the position offset of the text control pair is determined; if a pair of text controls with a position offset less than a preset offset threshold is determined, then it is determined that a third text control exists in the second interface screenshot. This embodiment of the invention, by processing the first and second interface screenshots using a large language model, can achieve a fast and accurate determination of whether a third text control exists in the second interface screenshot.
[0055] In an embodiment of the present invention, optionally, determining whether a third text control exists in the second interface screenshot based on the first interface screenshot and the second interface screenshot may include steps B1-B3: Step B1: Based on the screenshot of the first interface, determine the first text content and text position information of the fourth text control.
[0056] The first text content can be understood as the text data displayed on the fourth text control, which can be used to describe the function of the fourth text control and other information; the text position information can be understood as the position coordinates of the fourth text control in the first interface screenshot.
[0057] Specifically, optical character recognition technology is used to perform text recognition on the first interface screenshot to obtain the first text content and text position information of the fourth text control.
[0058] Step B2: Based on the first text content and text location information, determine the text prompt words.
[0059] Among them, text prompts are used to prompt the large language model to perform tasks.
[0060] Specifically, the first text prompt can be the second text content extracted from the second screenshot based on the text location information; the second text prompt can be the semantic correspondence between the first and second text content; the third text prompt can be the reasonable translation of whether the first and second text content are each other; the fourth text prompt can be the analysis result of the first and second text content; and the first, second, third, and fourth text prompts can be used as the total text prompt.
[0061] Optionally, determining the text prompt based on the first text content and text location information may further include: extracting the second text content from the corresponding location in the second interface screenshot based on the text location information, and determining the text prompt based on the first and second text content. For example, analyzing the semantic correspondence between the first and second text content; determining whether the first and second text content are reasonable translations of each other; and outputting the analysis results of the first and second text content can all serve as text prompts.
[0062] Step B3: Based on the text prompts and the large language model, process the first and second interface screenshots to determine whether a third text control exists in the second interface screenshot.
[0063] Among them, the Large Language Model (LLM) is a large-scale neural network model based on deep learning architecture in the field of artificial intelligence.
[0064] Specifically, if the second text content is generated in the large language model based on the prompt words, then the text prompt words, the first text content, and the text position information are input into the large language model so that the large language model can process the first and second interface screenshots, output the analysis results of the first and second text content, and determine whether there is a third text control in the second interface screenshot based on the analysis results.
[0065] If the second text content is not generated in the large language model based on the prompt words, but is extracted in advance from the corresponding position in the second screenshot based on text location information, then the text prompt words, the first text content, and the second text content are input into the large language model, and the analysis results of the first and second text content are output. Based on the analysis results, it is determined whether a third text control exists in the second screenshot. The analysis results can include information describing whether the semantics of the first and second text content are consistent.
[0066] In this embodiment of the invention, the first text content and text position information of the fourth text control are determined based on the first interface screenshot. Then, text prompts are determined based on the first text content and text position information. This allows for accurate and rapid processing of the first and second interface screenshots using text prompts and a large language model to determine whether a third text control exists in the second interface screenshot. The use of a large language model can significantly improve testing efficiency and accuracy.
[0067] The technical solution of this invention determines the set of first text controls to be tested in the first language version of the target game as a text control set, thereby accurately identifying the text controls to be tested. Text control testing is then performed based on this text control set to avoid missing any text controls. Next, the UI control tree for each first display interface corresponding to the first language version of the target game is determined. The UI control tree is traversed to obtain the second text controls. The introduction of the UI control tree enables quick and accurate acquisition of the second text controls. Further traversal of each second text control is performed. When it is determined that the currently traversed second text control exists in the text control set, it is tested precisely. After testing, a screenshot of the first interface of the first display interface corresponding to the currently traversed second text control is saved in a first screenshot set. Because there is a correspondence between the first interface screenshot and the tested first text control, saving the first interface screenshot of the first display interface corresponding to the tested first text control allows for precise identification of which first text control in the text control set has been tested. Furthermore, based on the first set of screenshots and the set of text controls, the test coverage is determined to ensure the completeness of the test coverage. Then, the first set of screenshots when the test coverage reaches a preset value is determined as the second set of screenshots. This allows for the automatic and accurate retrieval of the second display interfaces corresponding to the second language version of the target game based on the first interface screenshots in the second set of screenshots. The second display interfaces are then captured to obtain second interface screenshots. Based on the first and second interface screenshots, it is determined whether a third text control exists in the second interface screenshot. The judgment result accurately determines whether the text control to be tested in the second language version is translated accurately or whether there are any omissions in translation. Moreover, other language versions do not need to repeat the complex test path. Language-specific verification is directly performed based on the screenshots, which greatly improves the efficiency and accuracy of multilingual testing.
[0068] Figure 3 This is a schematic diagram of a multilingual text testing device provided in an embodiment of the present invention. This embodiment is applicable to testing multilingual text controls for the same game version. The multilingual text testing device can be implemented in hardware and / or software, and can be configured in any electronic device with network communication capabilities. Figure 3 As shown, the multilingual text testing device of the present invention may include: The control set determination module 310 is used to determine the text control set; the text control set is the set of the first text controls that need to be tested in the first language version of the target game; The first test module 320 is used to determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set. The coverage determination module 330 is used to determine the test coverage based on the first screenshot set and the text control set, and to determine the first screenshot set when the test coverage reaches a preset value as the second screenshot set; The second test module 340 is used to test the text control of the second language version of the target game based on the second screenshot set.
[0069] Based on the above embodiments, optionally, the second testing module includes an interface calling unit and a testing unit; the interface calling unit is used to call the second display interface corresponding to the second language version of the target game based on the first interface screenshot, and take a screenshot of the second display interface to obtain a second interface screenshot; the testing unit is used to determine whether there is a third text control in the second interface screenshot based on the first interface screenshot and the second interface screenshot; the third text control is a text control with the same semantics and position as the fourth text control corresponding to the first interface screenshot; the fourth text control is the second text control corresponding to the first text control in the text control set.
[0070] Based on the above embodiments, optionally, the test unit is used for: The first and second interface screenshots are processed based on a large language model to determine whether a third text control exists in the second interface screenshot.
[0071] Optionally, based on the above embodiments, the testing unit is further configured to: determine the first text content and text position information of the fourth text control based on the first interface screenshot; determine the text prompt word based on the first text content and text position information; and process the first interface screenshot and the second interface screenshot based on the text prompt word and the large language model to determine whether a third text control exists in the second interface screenshot.
[0072] Based on the above embodiments, optionally, the first test module includes a screenshot saving unit, which is used to save the text hierarchy information corresponding to the fourth text control and the screenshot of the first interface in a first screenshot set.
[0073] Based on the above embodiments, optionally, the interface invocation unit is used to: obtain the reference text level information of the fourth text control corresponding to the first interface screenshot, and invoke the second display interface corresponding to the second language version of the target game based on the reference text level information.
[0074] Based on the above embodiments, optionally, the first test module includes a control determination unit, which is used to: determine the UI control tree of each first display interface corresponding to the first language version of the target game, traverse the UI control tree, and obtain the second text control.
[0075] Based on the above embodiments, optionally, the control set determination module is used to: if the first language version of the target game is an initial development version, then determine all text controls in the first language version of the target game as first text controls; if the first language version of the target game is not an initial development version, then determine the text controls in the first language version of the target game that differ from historical game versions as first text controls; the first language version of the target game is the latest game version developed based on the historical game version; and set all the first text controls into the text control set.
[0076] The multilingual text testing device provided in this embodiment of the invention can execute the multilingual version software testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0077] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0078] Figure 4 A schematic diagram of an electronic device is shown that can be used to implement the multilingual version software testing method of embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0079] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0080] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0081] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as multilingual software testing methods.
[0082] In some embodiments, the multilingual software testing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via read-only memory (ROM) 12 and / or communication unit 19. When the computer program is loaded into random access memory (RAM) 13 and executed by processor 11, one or more steps of the multilingual software testing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the multilingual software testing method by any other suitable means (e.g., by means of firmware).
[0083] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0084] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0085] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0087] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0088] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0089] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0090] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for testing multilingual software, characterized in that, The method includes: Determine the set of text controls; the set of text controls is the set of the first text controls that need to be tested in the first language version of the target game; Determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set. Based on the first screenshot set and the text control set, the test coverage is determined, and the first screenshot set when the test coverage reaches a preset value is determined as the second screenshot set; Based on the second set of screenshots, the text control of the second language version of the target game is tested.
2. The method according to claim 1, characterized in that, Based on the second set of screenshots, text control testing was performed on the second language version of the target game, including: Based on the interface information of the first interface screenshot, the second display interface corresponding to the second language version is called, and the second display interface is screenshotted to obtain the second interface screenshot; Based on the first interface screenshot and the second interface screenshot, it is determined whether a third text control exists in the second interface screenshot; the third text control is a text control with the same semantics and position as the fourth text control corresponding to the first interface screenshot; the fourth text control is the second text control corresponding to the first text control in the text control set.
3. The method according to claim 2, characterized in that, Based on the first screenshot and the second screenshot, determine whether a third text control exists in the second screenshot, including: The first and second interface screenshots are processed based on a large language model to determine whether a third text control exists in the second interface screenshot.
4. The method according to claim 3, characterized in that, Based on a large language model, the first and second interface screenshots are processed to determine whether a third text control exists in the second interface screenshot, including: Based on the first screenshot of the interface, determine the first text content and text position information of the fourth text control; Based on the first text content and text location information, determine the text prompt words; Based on the text prompts and the large language model, the first and second interface screenshots are processed to determine whether a third text control exists in the second interface screenshot.
5. The method according to claim 2, characterized in that, Saving a screenshot of the first interface of the first display interface corresponding to the currently traversed second text control in the first screenshot set also includes: The text hierarchy information corresponding to the fourth text control and the screenshot of the first interface are saved in the first screenshot set.
6. The method according to claim 5, characterized in that, Based on the screenshot of the first interface, the second display interface corresponding to the second language version of the target game is invoked, including: Obtain the reference text hierarchy information of the fourth text control corresponding to the first interface screenshot, and based on the reference text hierarchy information, call the second display interface corresponding to the second language version of the target game.
7. The method according to claim 1, characterized in that, Determine each second text control contained in each first display interface corresponding to the first game version of the first language, including: Determine the UI control tree for each first display interface corresponding to the first language version of the target game, traverse the UI control tree, and obtain the second text control.
8. The method according to claim 1, characterized in that, Determine the set of text controls, including: If the first language version of the target game is the first development version, then all text controls in the first language version of the target game are determined as the first text controls; If the first language version of the target game is not the first development version, then the text control that differs from the previous game version in the first language version of the target game is determined as the first text control; the first language version of the target game is the latest game version developed based on the previous game version; Collect all the first text controls into the text control set.
9. A multilingual text testing device, characterized in that, The device includes: The control set determination module is used to determine the text control set; the text control set is the set of the first text controls that need to be tested in the first language version of the target game; The first testing module is used to determine each second text control contained in each first display interface corresponding to the first language version of the target game, traverse each second text control, and when it is determined that the currently traversed second text control exists in the text control set, test the currently traversed second text control, and save the first interface screenshot of the first display interface corresponding to the currently traversed second text control in the first screenshot set. The coverage determination module is used to determine the test coverage based on the first screenshot set and the text control set, and to determine the first screenshot set when the test coverage reaches a preset value as the second screenshot set; The second testing module is used to test the text controls of the second language version of the target game based on the second set of screenshots.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multilingual version software testing method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the multilingual version software testing method according to any one of claims 1-8.