Mobile software aging-friendly defect detection method and system based on large language model
Through depth-first search and large language model mutation operations, test cases that efficiently trigger elderly-friendly defects are generated, solving the problem of difficulty in identifying elderly-friendly defects in mobile applications in existing technologies and realizing automated elderly-friendly defect detection.
Patent Information
- Application Number
- CN202410830330.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-06-25
AI Technical Summary
Existing technologies make it difficult to generate efficient test cases to trigger elderly-friendly defects in mobile applications, and lack automated identification methods.
Depth-first search is used to generate initial test cases, and mutation operations are performed in combination with a large language model to generate test cases that efficiently trigger aging-friendly defects, and defects are identified through feature analysis.
It achieves efficient and automated identification and detection of elderly-friendly defects in mobile applications and generates detailed defect reports.
Smart Images

Figure CN118820083B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of software engineering and artificial intelligence, and in particular to a method and system for detecting age-friendly defects in mobile software based on a large language model. Background Art
[0002] The World Health Organization predicts that the global population aged 60 and over will increase from 1 billion in 2020 to 1.4 billion in 2030. Mobile applications also play a vital role in the daily lives of seniors, serving a wide range of daily needs, including entertainment, social interaction, and shopping. Considering that significant declines in many physiological functions, such as vision, cognitive ability, and memory, can severely impact their ability to use mobile applications, making mobile applications user-friendly for seniors is crucial in the design process.
[0003] Popular mobile operating systems (such as iOS and Android) provide integrated assistive services (such as enlarging fonts) to help seniors use mobile applications designed for general audiences to complete complex tasks such as shopping and social networking. However, there are many compatibility issues between the aforementioned assistive services and mobile applications. After the assistive services are enabled, the mobile application's user interface will be distorted, making it difficult for seniors to use the mobile applications. To alleviate this problem, commercial mobile applications have begun to provide dedicated senior-friendly versions for seniors, with user interfaces designed based on the physiological characteristics of the elderly, thereby avoiding compatibility issues between assistive services and mobile applications. However, due to factors such as uneven development experience and a lack of analysis of elderly users, a large number of mobile applications designed for seniors currently have serious accessibility issues, such as fonts and icons that are too small. In this invention, we refer to such issues as senior-friendly defects. In addition to causing unfriendly user interfaces that make it difficult for seniors to use, these senior-friendly defects may also disrupt the functional logic of the mobile application and even leak personal data. However, currently, academia and industry lack sufficient attention and in-depth research on senior-friendly defects in senior-friendly mobile applications. Existing research mainly focuses on analyzing the compatibility issues between auxiliary services of mobile operating systems and mobile applications. There has been no in-depth research on the elderly-friendly defects in elderly-friendly mobile applications. There is a lack of automated detection tools for such problems to assist developers in locating and repairing such defects.
[0004] The prior invention patent application, "A Solver Defect Detection Method Based on a Large Pre-trained Language Model," with publication number CN116932389A, involves augmenting the data using formulas from the solver's standard library and historically defect-triggering formulas as a training set; customizing the pre-trained large model using a "retrain-fine-tune" framework based on the training set to generate test inputs for the solver; generating solver test cases using the trained model, and validating multiple solvers using differential testing. The specific implementation of this prior art demonstrates that this solution augments the collected dataset using diversity-guided mutation and semantics-preserving mutation techniques. These data augmentation techniques include diversity-guided mutation and semantics-preserving mutation. Diversity-guided mutation performs sub-formula and operator mutation on formulas in the test benchmark to maximize the diversity of the training set. Semantics-preserving mutation aims to improve the diversity of the dataset while maintaining the ability of the defect-triggering cases to trigger defects. These two mutation strategies are applied to two types of data to obtain higher-quality datasets for model training.
[0005] The existing invention patent application, "Deep Learning Library Testing Method Based on Guided Model Mutation," with publication number CN112183749A, includes: model mutation rules; mutation model generation based on a heuristic search strategy; and deep learning library test predictions based on differential testing to calculate and locate inconsistency defects. This existing solution utilizes model mutation and a heuristic search strategy to guide the generation of a large number of structurally diverse deep learning models, and then employs differential testing to test the deep learning library.
[0006] However, the defects involved in the aforementioned existing solutions involve the correctness of software operation results; the test case generation method involved in the aforementioned existing solutions includes machine learning training and mutation generation; at the same time, the aforementioned existing technology mainly uses differential testing methods for defect identification.
[0007] In summary, the defect detection target in the existing technology is not the elderly-friendly defects in mobile software. It is difficult to generate efficient test cases to trigger elderly-friendly defects in mobile applications, and it is difficult to automatically identify such problems as elderly-friendly defects. Summary of the Invention
[0008] The technical problem to be solved by the present invention is: how to solve the technical problem in the existing technology that it is difficult to generate efficient test cases to trigger elderly-friendly defects in mobile applications, and it is difficult to automatically identify and detect problems such as elderly-friendly defects.
[0009] The present invention solves the above technical problems by adopting the following technical solutions: A method for detecting defects in mobile software for the elderly based on a large language model includes:
[0010] S1. Use depth-first search to automatically traverse mobile applications with aging-friendly modes and generate initial test cases.
[0011] S2, execute the initial test case and obtain the runtime information; for each running state s i , collecting runtime information of the mobile application in the running state, wherein the runtime information includes: associated GUI layout files and runtime GUI screenshots;
[0012] S3. Generate prompt words based on motion information and test case mutation targets, and use them to guide the preset large language model to perform mutation operations, so as to mutate the initial test case into a test case that effectively triggers elderly-friendly defects;
[0013] S4. Obtain the output of the preset large language model and parse it to obtain the mutation event;
[0014] S5. For the initial test case, perform event mutation operations and use case execution operations according to the mutation events;
[0015] S6. Based on the event mutation operation of the preset large language model, the initial test case is mutated and executed to obtain mutation operation information;
[0016] S7. Based on the initial operation information and the variant operation information, and according to the characteristics of the elderly-friendly defects, feature analysis and matching are performed on the operation information to identify the elderly-friendly defects and generate an elderly-friendly defect report.
[0017] Compared with the aforementioned background technology, the present invention involves the elderly-friendly defects in mobile software. It does not involve the correctness of the running results, but rather the compatibility issues between mobile software and the elderly. At the same time, the test case generation method of the present invention is different from the aforementioned background technology. The present invention is based on rule guidance and is generated with the assistance of a large language model. The present invention is also different from the aforementioned defect identification method. The present invention is based on automatic identification based on the classification results of extensive empirical research on elderly-friendly defects.
[0018] The present invention realizes systematic detection of age-friendly defects in mobile applications by generating test cases that can effectively trigger age-friendly defects and designing corresponding identification strategies based on the characteristics of age-friendly defects.
[0019] This invention analyzes the characteristics of age-related defects and performs targeted mutations on common test cases, thereby generating test cases that can effectively trigger age-related defects, achieving efficient triggering of age-related defects. To address the shortcomings of existing technologies in detecting age-related defects, this invention, based on the results of feature analysis of age-related defects, identifies defects by analyzing whether the runtime characteristics of mobile applications meet the set constraints or layout patterns, and automatically identifies exposed age-related defects.
[0020] In a more specific technical solution, in S1, the following logic is used to express the test case:
[0021] t=[e1,e2,…,e n ]
[0022] Where, e i (1≤i≤n) represents events such as click and slide.
[0023] In a more specific technical solution, in S1, the execution record Tr(t) of each initial test case t is expressed using the following logic:
[0024]
[0025] Where s i (0≤i≤n) represents the running status of the mobile application.
[0026] The present invention targets the defects in the adaptability of mobile software for the elderly. It uses a depth-first search method to traverse the user interfaces in mobile applications. During the traversal process, it conducts an interface adaptability check for the elderly to identify the user interfaces in mobile applications that have been adapted for the elderly, providing a basis for subsequent detection of defects for the elderly.
[0027] In a more specific technical solution, S2 includes:
[0028] S21. A heuristic rule is embedded to calculate the average size of all text components and icon components on the GUI page of the mobile application, and compare it with a preset empirical threshold to determine whether the mobile application has an aging-friendly mode;
[0029] S22. Execute each event in the initial test case until the mobile application runs to a stable state for all text components and icon components. For each GUI page, save a runtime GUI screenshot of the mobile application and the associated GUI layout file.
[0030] S23. Perform feature analysis on the associated GUI layout files and runtime screenshots; wherein the feature analysis includes: component information and execution event matching analysis, GUI interface element analysis, and GUI interface function identification.
[0031] In more specific technical solutions, S3 includes:
[0032] S31, inputting the prompt word into the preset large language model to submit the associated GUI layout file, runtime GUI screenshot, and test case event sequence to the preset large language model;
[0033] S32. Generate operation suggestion information of the mutation operation in combination with the test case mutation target.
[0034] During the mutation process, the present invention provides specific operational suggestions for mutating the test case based on the GUI layout file corresponding to the generated test case and the event sequence of the test case by designing prompt words and leveraging the reasoning and prediction capabilities of the large language model.
[0035] In a more specific technical solution, S4 includes:
[0036] S41. Find the corresponding event in the initial test case based on the operation suggestion information output by the large threshold language model;
[0037] S42. Perform event conversion based on the original event and operation suggestion information to obtain a variant event.
[0038] In more specific technical solutions, S5 includes:
[0039] S51. According to the operation suggestion information, the event e in the initial test case is i Perform mutation operations;
[0040] Mutate the initial test case t to a mutated test case
[0041]
[0042] Where, Indicates the event after mutation;
[0043] S52, mutation test cases Perform use case execution operations and mutation processing operation records Tr(t).
[0044] The present invention automatically traverses the mobile application to be tested to generate enough test cases; it transforms the generated test cases by combining two mutation operations, event mutation and content mutation, to generate new test cases that can efficiently trigger aging defects.
[0045] The present invention executes the mutated test cases, and based on the feature analysis results of the elderly-friendly defects, identifies defects by analyzing whether the runtime characteristics of the mobile application meet the set constraints or layout patterns, automatically identifies the exposed elderly-friendly defects, and generates a detailed defect report.
[0046] In a more specific technical solution, in S52, the operation record Tr(t) is mutated into a mutated operation record using the following logic:
[0047]
[0048] In a more specific technical solution, in S6, according to the mutation operation output by the large language model, the GUI component in the test case is mutated, so that the running record Tr(t) of the initial test case is mutated into the mutated running record
[0049]
[0050] Where, Indicates the state s i The new state of the GUI components after mutation.
[0051] In a more specific technical solution, the mobile software aging-friendly defect detection system based on a large language model includes:
[0052] The initial test case generation module uses depth-first search to automatically traverse mobile applications with aging-friendly modes and generate initial test cases;
[0053] Runtime information acquisition module is used to execute the initial test case and obtain runtime information; for each running state s i , collecting runtime information of the mobile application in the running state, wherein the runtime information includes: associated GUI layout files, runtime GUI screenshots, and the runtime information acquisition module is connected to the initial test case generation module;
[0054] The prompt word generation module is used to generate prompt words based on motion information and test case mutation targets, thereby guiding the preset large language model to perform mutation operations to mutate the initial test case into an efficient test case that triggers elderly-friendly defects. The prompt word generation module is connected to the runtime information acquisition module;
[0055] The output result parsing module is used to obtain the output results of the preset large language model and parse the results to obtain the mutation events. The output result parsing module is connected to the prompt word generation module;
[0056] The mutation execution operation module is used to perform event mutation operations and use case execution operations on the initial test case according to the mutation event. The mutation execution operation module is connected to the output result parsing module;
[0057] A mutation operation information acquisition module is used to perform component mutation and execution on the initial test case based on the event mutation operation of the preset large language model to obtain mutation operation information. The mutation operation information acquisition module is connected to the mutation execution operation;
[0058] The elderly-friendly defect recognition module is used to perform feature analysis and matching on the runtime information based on the initial operation information and the variant operation information and according to the characteristics of the elderly-friendly defects, so as to identify the elderly-friendly defects and generate an elderly-friendly defect report. The elderly-friendly defect recognition module is connected with the variant operation information acquisition module, the variant execution operation module and the runtime information acquisition module.
[0059] Compared with the prior art, the present invention has the following advantages:
[0060] The present invention realizes systematic detection of age-friendly defects in mobile applications by generating test cases that can effectively trigger age-friendly defects and designing corresponding identification strategies based on the characteristics of age-friendly defects.
[0061] This invention analyzes the characteristics of age-related defects and performs targeted mutations on common test cases, thereby generating test cases that can effectively trigger age-related defects, achieving efficient triggering of age-related defects. To address the shortcomings of existing technologies in detecting age-related defects, this invention, based on the results of feature analysis of age-related defects, identifies defects by analyzing whether the runtime characteristics of mobile applications meet the set constraints or layout patterns, and automatically identifies exposed age-related defects.
[0062] The present invention targets the defects in the adaptability of mobile software for the elderly. It uses a depth-first search method to traverse the user interfaces in mobile applications. During the traversal process, it conducts an interface adaptability check for the elderly to identify the user interfaces in mobile applications that have been adapted for the elderly, providing a basis for subsequent detection of defects for the elderly.
[0063] During the mutation process, the present invention provides specific operational suggestions for mutating the test case based on the GUI layout file corresponding to the generated test case and the event sequence of the test case by designing prompt words and leveraging the reasoning and prediction capabilities of the large language model.
[0064] The present invention automatically traverses the mobile application to be tested to generate enough test cases; it transforms the generated test cases by combining two mutation operations, event mutation and content mutation, to generate new test cases that can efficiently trigger aging defects.
[0065] The present invention executes the mutated test cases, and based on the feature analysis results of the elderly-friendly defects, identifies defects by analyzing whether the runtime characteristics of the mobile application meet the set constraints or layout patterns, automatically identifies the exposed elderly-friendly defects, and generates a detailed defect report.
[0066] The present invention solves the technical problems in the prior art of difficulty in generating efficient test cases to trigger elderly-friendly defects in mobile applications and difficulty in automatically identifying and detecting such problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a schematic diagram of the basic steps of the method for detecting defects in mobile software for the elderly based on a large language model according to Example 1 of the present invention. DETAILED DESCRIPTION
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0069] Example 1
[0070] like Figure 1 As shown, the method for detecting defects in mobile software adaptability to the elderly based on a large language model provided by the present invention includes the following basic steps:
[0071] S1. Generate initial test cases using depth-first search;
[0072] In this embodiment, the elderly-friendly mode of the mobile software is entered, and initial test cases are generated using a depth-first traversal method.
[0073] In this embodiment, for the mobile application to be tested that has an aging-friendly mode option, a predefined test script is executed in advance to turn on the aging-friendly mode in the mobile application; a depth-first search strategy is used to automatically traverse the mobile application, and then a certain number of initial test cases are generated to achieve coverage of as many GUI() interfaces in the mobile application as possible.
[0074] In this embodiment, each generated test case is represented as t = [e1, e2…, e n ], where e i (1≤i≤n) represents events such as clicks and slides. The execution record Tr(t) of each test case t is expressed as follows:
[0075]
[0076] Among them, s i (0≤i≤n) represents the running status of the mobile application.
[0077] S2. Execute the generated test case and obtain runtime information;
[0078] In this embodiment, during the execution of the test case, runtime information of the mobile software is obtained; in this embodiment, the runtime information includes but is not limited to: a graphical user interface (GUI) interface with an aging-friendly design and GUI screenshots.
[0079] In this embodiment, for each operating state s i , collect the GUI layout files and GUI screenshots of the mobile application in this running state. Specifically, since not all GUI pages in an elderly-friendly mobile application will be designed for aging, a heuristic rule is embedded in this embodiment during the operation of the mobile application. The average size of the components of all texts and icons on the GUI page is calculated and compared with the empirical threshold. If it is greater than the threshold, it indicates that an elderly-friendly design has been performed; after each event is executed, when the mobile application is waiting to run to a stable state where all GUI components no longer change, the screenshots and associated GUI layout files that appear during the runtime are saved for each GUI page; feature analysis is performed on the collected GUI layout files and screenshots; in this embodiment, the feature analysis operations include but are not limited to: matching analysis of functional component information and execution events in the GUI interface, analyzing the interface elements of the GUI interface, and identifying the functional characteristics of the GUI interface.
[0080] S3, generating prompt words based on the information during exercise;
[0081] In this embodiment, based on the acquired mobile application runtime information and combined with the test objectives, prompt words are constructed to guide the large language model to generate test cases that can mutate the initial test cases into test cases that can effectively trigger the elderly-friendly defects;
[0082] In this embodiment, corresponding prompt words are generated and input into the large language model, guiding the large language model GPT4.0 to generate test cases that can effectively trigger age-friendly defects. Specifically, the retained GUI layout file, GUI screenshots, and the event sequence of the test case are submitted to the large language model through designed prompt words. Combined with the test case mutation target, operational suggestions for mutating the test case are generated. In this embodiment, the mutation target is to display more GUI components in the GUI interface, and the GUI components display more content.
[0083] S4, generate mutation operations based on the large language model;
[0084] In this embodiment, the prompt word is input into the large language model GPT4.0, and is parsed into a specific mutation operation based on the output result of the large language model.
[0085] In this embodiment, the output of the large language model is parsed to generate corresponding mutation events. Specifically, based on the event mutation operation prompts output by the large language model, the corresponding event is found in the initial test case. Based on the original event, the event is transformed according to the suggestions of the large language model to generate a mutation event. Based on the component mutation operation prompts output by the large language model, the corresponding component is found in the initial test case. Based on the original component, the component is transformed according to the suggestions of the large language model to generate a mutation component.
[0086] S5. mutate the initial test case and execute it;
[0087] In this embodiment, based on the mutation operation of the large language model, the generated initial test case is mutated and executed to obtain runtime information.
[0088] In this embodiment, according to the mutation operation output by the large language model, the event e in the test case is i Perform mutation, test case t mutates to
[0089]
[0090] in, Indicates the mutated event, such as clicking on a component that is different from the original GUI component, so that the mutated test case can display more GUI components during execution. Execute, so that the running record changes from Tr(t)
[0091]
[0092] S6. Component mutation and execution of the initial test case;
[0093] In this embodiment, based on the mutation operation of the large language model, the generated initial test cases are subjected to component mutation and executed to obtain runtime information.
[0094] In this embodiment, according to the mutation operation output by the large language model, the GUI component in the test case is mutated so that the running record is mutated from Tr(t) to
[0095]
[0096] Indicates the state s i The new state of the GUI component after the mutation, which enables the mutated GUI component to display more content during operation.
[0097] S7. Automatically identify triggered age-friendly defects.
[0098] In this embodiment, based on the operation information obtained in the aforementioned steps S5 and S6, feature analysis and matching are performed on the operation information according to the characteristics of the elderly-friendly defects, and the identified elderly-friendly defects are reported to generate an elderly-friendly defect report.
[0099] In the present invention, the applicant analyzed 691 elderly-friendly defects collected from popular commercial elderly-friendly mobile applications and concluded that the current elderly-friendly defects mainly include three types of problems: (1) Text is too small: The text displayed in the GUI interface is too small, which makes it difficult for the elderly to see the text clearly, affecting their use of mobile applications; (2) Lack of prompts: The components in the GUI interface lack text operation prompts, which makes it difficult for the elderly to clearly understand the function of the component and unable to perform further operations; (3) Icons are too small: The icons in the GUI interface are too small, which makes it difficult for the elderly to see and operate them, affecting their use of mobile applications.
[0100] The mutated test cases are run, and by performing feature matching analysis on the runtime data, defects in the elderly-friendly interface are automatically identified. In this embodiment, defects in the elderly-friendly interface include but are not limited to: text that is too small, lack of prompts, and icons that are too small.
[0101] In the process of obtaining the defect of too small text in this embodiment, based on the reasonable assumption that the proportion of widgets with too small text in the GUI page is very small, each GUI interface in the elderly-friendly mobile application is scanned and the average height h of the text in the GUI interface is calculated. text_average If there is a text height h text Significantly smaller than h text_average , the report has a text-too-small defect.
[0102] In the defect acquisition process of lack of prompts in this embodiment, for each GUI page, all clickable icon widgets in the GUI page are scanned, and it is checked whether there is any text prompt near the clickable widget. If not, a defect is reported.
[0103] In the process of obtaining the icon-too-small defect in this embodiment, the detection is performed in the same assumption and manner as the text-too-small defect. Scan and calculate the average height h of the icons in the GUI interface icon_average If there is an icon with a height h icon Significantly smaller than h icon_average 'The report has a text too small defect.
[0104] Through the above steps, it is possible to implement automated testing of the elderly-friendly capabilities of elderly-friendly mobile applications, provide the test results to the automatic generation tool for elderly-friendly mobile applications, and correct the generated elderly-friendly mobile applications to ensure that the elderly-friendly mobile applications can meet the needs of the elderly and provide a good user experience.
[0105] In summary, the present invention realizes systematic detection of elderly-friendly defects in mobile applications by generating test cases that can effectively trigger elderly-friendly defects and designing corresponding identification strategies based on the characteristics of elderly-friendly defects.
[0106] This invention analyzes the characteristics of age-related defects and performs targeted mutations on common test cases, thereby generating test cases that can effectively trigger age-related defects, achieving efficient triggering of age-related defects. To address the shortcomings of existing technologies in detecting age-related defects, this invention, based on the results of feature analysis of age-related defects, identifies defects by analyzing whether the runtime characteristics of mobile applications meet the set constraints or layout patterns, and automatically identifies exposed age-related defects.
[0107] The present invention targets the defects in the adaptability of mobile software for the elderly. It uses a depth-first search method to traverse the user interfaces in mobile applications. During the traversal process, it conducts an interface adaptability check for the elderly to identify the user interfaces in mobile applications that have been adapted for the elderly, providing a basis for subsequent detection of defects for the elderly.
[0108] During the mutation process, the present invention provides specific operational suggestions for mutating the test case based on the GUI layout file corresponding to the generated test case and the event sequence of the test case by designing prompt words and leveraging the reasoning and prediction capabilities of the large language model.
[0109] The present invention automatically traverses the mobile application to be tested to generate enough test cases; it transforms the generated test cases by combining two mutation operations, event mutation and content mutation, to generate new test cases that can efficiently trigger aging defects.
[0110] The present invention executes the mutated test cases, and based on the feature analysis results of the elderly-friendly defects, identifies defects by analyzing whether the runtime characteristics of the mobile application meet the set constraints or layout patterns, automatically identifies the exposed elderly-friendly defects, and generates a detailed defect report.
[0111] The present invention solves the technical problems in the prior art of difficulty in generating efficient test cases to trigger elderly-friendly defects in mobile applications and difficulty in automatically identifying and detecting such problems.
[0112] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for detecting defects in mobile software for the elderly based on a large language model, characterized by: The method comprises: S1. Use depth-first search to automatically traverse mobile applications with aging-friendly modes and generate initial test cases. S2, execute the initial test case and obtain runtime information; for each running state s i , collecting runtime information of the mobile application in the running state, wherein the runtime information includes: associated GUI layout files and runtime GUI screenshots; S3. Based on the runtime information and in combination with the test case mutation target, a prompt word is generated to guide the preset large language model to perform a mutation operation to mutate the initial test case into a test case that efficiently triggers elderly-friendly defects; S4. Obtain the output result of the preset large language model and analyze it to obtain a variation event; S5. Perform event mutation operation and use case execution operation on the initial test case according to the mutation event; S6. Based on the event mutation operation of the preset large language model, perform component mutation on the initial test case and execute the mutation operation to obtain mutation operation information; S7. Based on the initial operation information and the variant operation information, and according to the characteristics of the elderly-friendly defects, feature analysis and matching are performed on the operation information to identify the elderly-friendly defects and generate an elderly-friendly defect report.
2. The method for detecting defects in mobile software for the elderly based on a large language model according to claim 1, characterized in that: In S1, the following logic is used to express the initial test case: t=[e1,e2,…,e n ] Where, e i (1≤i≤n) represents click and slide events.
3. The method for detecting defects in mobile software for the elderly based on a large language model according to claim 1, characterized in that: In S1, the execution record Tr(t) of each initial test case t is expressed using the following logic: Where s i (0≤i≤n) represents the running status of the mobile application.
4. The method for detecting defects in mobile software for the elderly based on a large language model according to claim 1, characterized in that: The S2 includes: S21. Embedding a heuristic rule to calculate the average size of all text components and icon components on the GUI page of the mobile application, and comparing the average size with a preset empirical threshold to determine whether the mobile application has the aging-friendly mode; S22: Execute each event in the initial test case until the mobile application runs to a state where all the text components and the icon components are in a stable state, and save the runtime GUI screenshot of the mobile application and the associated GUI layout file for each GUI page; S23. Perform feature analysis on the associated GUI layout file and runtime screenshot; wherein the feature analysis includes: component information and execution event matching analysis, GUI interface element analysis, and GUI interface function identification.
5. The method for detecting age-friendly defects in mobile software based on a large language model according to claim 1, characterized in that: The S3 includes: S31, inputting the prompt word into the preset large language model to submit the associated GUI layout file, the runtime GUI screenshot, and the test case event sequence to the preset large language model; S32: Generate operation suggestion information for the mutation operation in combination with the test case mutation target.
6. The method for detecting age-friendly defects in mobile software based on a large language model according to claim 1, characterized in that: The S4 includes: S41. Find a corresponding event in the initial test case according to the operation suggestion information output by the preset large language model; S42: Perform an event conversion operation based on the original event and the operation suggestion information to obtain the variant event.
7. The method for detecting age-friendly defects in mobile software based on a large language model according to claim 1, characterized in that: The S5 includes: S51, according to the operation suggestion information, the event e in the initial test case i performing the mutation operation; Mutate the initial test case t to a mutated test case Where, Indicates the event after mutation; S52, the mutation test case The use case execution operation is performed, and the mutation processing operation record Tr(t) is recorded.
8. The method for detecting defects in mobile software for the elderly based on a large language model according to claim 7, characterized in that: In S52, the operation record Tr(t) is mutated into a mutated operation record using the following logic:
9. The method for detecting defects in mobile software for the elderly based on a large language model according to claim 1, characterized in that: In S6, according to the mutation operation output by the large language model, the GUI component in the test case is mutated, so that the running record Tr(t) of the initial test case is mutated into the mutated running record Where, Indicates the state s i The new state of the GUI components after mutation.
10. A mobile software aging-friendly defect detection system based on a large language model, characterized by: The system comprises: The initial test case generation module uses depth-first search to automatically traverse mobile applications with aging-friendly modes and generate initial test cases; Runtime information acquisition module, used to execute the initial test case and obtain runtime information; for each running state s i , collecting runtime information of the mobile application in the running state, wherein the runtime information includes: associated GUI layout files, runtime GUI screenshots, and the runtime information acquisition module is connected to the initial test case generation module; a prompt word generation module, configured to generate prompt words based on the runtime information and in combination with the test case mutation target, thereby guiding the preset large language model to perform a mutation operation to mutate the initial test case into a test case that efficiently triggers elderly-friendly defects. The prompt word generation module is connected to the runtime information acquisition module; An output result parsing module, used to obtain the output result of the preset large language model and parse the result to obtain a variation event, wherein the output result parsing module is connected to the prompt word generation module; a mutation execution operation module, configured to perform event mutation operation and use case execution operation on the initial test case according to the mutation event, the mutation execution operation module being connected to the output result parsing module; a mutation operation information acquisition module, configured to perform component mutation and execution on the initial test case based on the event mutation operation of the preset large language model to obtain mutation operation information, wherein the mutation operation information acquisition module is connected to the mutation execution operation module; The elderly-friendly defect recognition module is used to perform feature analysis and matching on the runtime information based on the initial operation information and the variant operation information, according to the elderly-friendly defect characteristics, to identify the elderly-friendly defects and generate an elderly-friendly defect report. The elderly-friendly defect recognition module is connected to the variant operation information acquisition module, the variant execution operation module and the runtime information acquisition module.
Citation Information
Patent Citations
Deep learning library test method based on guided model variation
CN112183749A
Multi-task software test case evolution generation method
CN112732577A
Solver defect detection method based on large pre-training language model
CN116932389A