An automated software product line feature model generation method based on use case enhancement
Through the use case enhanced automation method, combined with the large language model and UML use case diagram, the problems of manual dependency and modeling complexity in the generation of software product line feature models are solved, and efficient and accurate feature model generation is achieved, which reduces costs and supports the modeling of complex requirements.
Patent Information
- Application Number
- CN202510715849.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-05-30
AI Technical Summary
Existing technologies for generating feature models for software product lines rely on manual modeling and lack the experience of domain experts, making it difficult to handle the complexity of large-scale, high-dimensional feature interactions. Machine learning-based methods are also ineffective in modeling sparse data and implicit feature interactions, resulting in long model construction cycles and high maintenance costs, making it difficult to support the needs of efficient and accurate software product lines.
An automated method based on use case enhancement is adopted, combined with formal modeling theory and generative artificial intelligence technology. By integrating structured prompt engineering and domain adaptive optimization mechanism, a use case constraint prompt framework and a feature constraint prompt framework are constructed. The large language model is used to generate standardized feature model corpus and UML use case diagram corpus, forming a use case enhanced joint representation to drive the domain adaptive large language model parameter optimization.
It realizes end-to-end intelligent conversion from unstructured requirement description to formal feature model, improves the efficiency and accuracy of software product line modeling, reduces maintenance costs, and supports efficient and accurate generation of software product line feature models.
Smart Images

Figure CN120234032B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software product lines, and in particular to a method for generating an automated software product line feature model based on use case enhancement. Background Art
[0002] A software product line (SPL) is a collection of software systems built using domain engineering methods. By systematically reusing a predefined set of core assets, it derives software products that meet specific market or mission requirements in a configurable manner. The various functions within a software product line can be abstracted into a series of features, which users can enable or disable to customize the software product to meet their needs.
[0003] The software product line feature model is a structured modeling approach for functional features and their relationships within a software product line. It is used to systematically describe the common and variable characteristics of a product family within a software product line. Feature models typically employ a tree-like topology, with each node representing a feature. The combination rules and constraints between features formally define the possible configuration space of product line members. Compared to traditional independent development models, software product lines enable efficient development and personalized customization of software products by managing common and variable characteristics.
[0004] While software product line feature models can significantly improve the systematicity and reuse efficiency of software development, their construction and maintenance are significantly more complex than traditional requirements modeling methods. Frequent feature additions, deletions, and modifications driven by software requirements often lead to continuous reconstruction of the model structure, increasing the time and labor costs of manual maintenance. Furthermore, the evolution of feature models involves multiple constraints. If the constraints between features are not accurately modeled, configuration anomalies or runtime errors may occur during the derivation phase. As software product lines evolve towards larger scale and higher dimensions, the potential combinations of feature interactions are growing exponentially, and the complexity and maintenance costs of feature model construction are also increasing dramatically. Therefore, efficiently and automatically generating software product line feature models is of great significance.
[0005] The existing technology for generating feature models for software product lines has the following deficiencies:
[0006] (1) Manual modeling methods are highly dependent on the experience of domain experts, especially in the feature hierarchy division and constraint rule definition stages, which require a lot of manual intervention. As the scale of SPL expands, the complexity of feature interactions increases dramatically, and manual modeling is prone to constraint omissions or logical contradictions.
[0007] (2) Although current machine learning-based generative methods can leverage historical configuration data, they are ineffective in modeling sparse data (such as product lines in emerging fields) or implicit feature interactions (such as the implicit association between functional requirements and architectural features). Existing algorithms often rely on explicit feature labels, making it difficult to automatically mine deep feature relationships from unstructured requirements text, resulting in low completeness and accuracy of the generated models.
[0008] These shortcomings directly lead to long feature model construction cycles and high maintenance costs, and make it difficult to support the high-dimensional and dynamically evolving needs of industrial-grade software product lines. Therefore, an automated software product line feature model generation method is urgently needed to address the above technical issues. Summary of the Invention
[0009] In response to the problems existing in the existing technology, the present invention provides an automated software product line feature model generation method based on use case enhancement. By integrating formal modeling theory with generative artificial intelligence technology, and combining structured prompt engineering with domain adaptive optimization mechanism, it can achieve more efficient and accurate software product line modeling for complex software requirements.
[0010] The technical solution of the present invention is achieved as follows:
[0011] A method for generating an automated software product line feature model based on use case enhancement includes the following steps:
[0012] S1. Collect a feature model for a software product line, where the feature model includes multiple features. Construct a feature constraint prompt framework based on the constraint relationships between the features. For a UML use case diagram, which includes multiple constituent elements, construct a use case constraint prompt framework based on the constraint relationships between the constituent elements. The feature model for a software product line includes several features, and its tree-like hierarchical structure reflects the constraint relationships between features. A UML use case diagram includes use cases, participants, and relationships, where relationships include relationships between participants and use cases, and relationships between use cases.
[0013] S2. Collect the first software requirement text, input the feature constraint prompt framework and the use case constraint prompt framework, and obtain use case constraint prompts and feature constraint prompts respectively;
[0014] Inputting the use case constraint prompt and the first software requirement text into a preset first language model to generate UML use case diagram structured data, which is recorded as a first corpus;
[0015] Inputting the feature constraint prompt and the first software requirement text into a preset second language model to generate SPL feature model structured data, which is recorded as a second corpus;
[0016] S3. Concatenate the first corpus and the second corpus to construct a use case enhanced joint representation; one use case enhanced joint representation and the corresponding first software requirement text constitute a sample pair;
[0017] S4. Repeat steps S2 and S3 to obtain multiple sample pairs to form a training set; the second large language model is trained using the training set to maximize the correlation between the use case enhanced joint representation and the first software requirement text, thereby obtaining an SPL use case enhanced large model;
[0018] S5. Collect the second software requirement text, input the feature constraint prompt framework, and use the generated feature constraint prompt as a prompt word; input the prompt word into the SPL use case enhanced large model for reasoning to generate an SPL feature model.
[0019] The "SPL feature model" here and the "feature model" collected by S1 have the same structure, but in order to distinguish the former from the latter, the former is the result generated by the universal large model of the method of the present invention.
[0020] The present invention combines the constraint relationship between the software product line feature model and the UML use case diagram, encodes the domain knowledge of software product line feature modeling and UML use case modeling into structured prompts, and guides the large language model to generate standardized feature model corpus and UML use case diagram corpus. By splicing the SPL feature model corpus with the UML use case diagram corpus, the use case enhanced joint representation formed is input into the model as part of the training set data, driving the domain-adaptive large language model parameter optimization. Finally, a specialized SPL use case enhanced large model for software product line engineering is formed, realizing end-to-end intelligent conversion from unstructured requirement description to formal feature model, and realizing efficiency leap and cost optimization of software product line feature model modeling through generative artificial intelligence-driven automated modeling technology.
[0021] As a further optimization of the above solution, the constraint relationship between the features is a first constraint relationship, including mandatory, optional, or, exclusive or, required, exclusive;
[0022] The constituent elements include participants and use cases; the constraint relationship between the constituent elements is a second constraint relationship, including the relationship between the participants and the use cases, and the relationship between the use cases; the second constraint relationship includes association, generalization, inclusion, and extension.
[0023] As a further optimization of the above solution, in S2, the first software requirement text, the first corpus, and the second corpus are cleaned and standardized, including data desensitization, terminology standardization, and integrity verification;
[0024] The data desensitization process involves identifying sensitive entities in the first software requirement document and replacing them with placeholders. Sensitive entities include personal identity information and business-sensitive information. Personal identity information includes name, ID number, phone number, email address, and address. Business-sensitive information includes customer order numbers, contract numbers, and financial transaction amounts.
[0025] The term standardization includes: creating a standard term base; identifying non-standard terms in the first software requirement text and replacing them with standard terms in the standard term base; and eliminating ambiguities caused by synonyms, polysemous words and abbreviations.
[0026] The integrity check involves identifying missing fields in the first corpus and completing them based on the first software requirements document. This ensures that each use case in the use case diagram has required fields, such as name, description, and participants. Missing fields are user-defined. Furthermore, the features and constraints between them are identified in the second corpus and corrected based on the first software requirements document.
[0027] As a further optimization of the above solution, in S2, the first corpus and the second corpus are encoded to obtain vectors V uml and vector V fm ; Then encode the first software requirement text to obtain vector V req ; Vector V uml and V fm The splicing process is performed to obtain the enhanced joint representation of the use case.
[0028] As a further optimization of the above scheme, set the separator and encode it to get the vector V sep ; Use the attention mechanism to dynamically calculate the position relationship, which is the vector V uml , vector V sep , vector V fm Assign independent position codes, namely pos uml ,pos sep ,pos fm ; The splicing process is expressed as:
[0029] V joint =V uml ⊕V sep ⊕V fm +Concat(pos uml ,pos sep ,pos fm );
[0030] Among them, ⊕ represents exclusive OR, V joint Represents the use case enhancement joint representation.
[0031] As a further optimization of the above solution, the training is to calculate the SPL mutual information of the sample pairs, that is:
[0032]
[0033] Among them, I SPL (R; J) represents the SPL mutual information; r represents the vector V req ; j represents the vector V joint ; R is a set of multiple r; J is a set of multiple j; p(r,j) represents the joint distribution of r and j; p(r) and p(j) represent the marginal distributions of r and j respectively;
[0034] The SPL mutual information is maximized to maximize the correlation between the use case enhanced joint representation and the first software requirement text.
[0035] I SPL (R; J) can be viewed as the KL divergence between p(r, j) and p(r)p(j).
[0036] As a further optimization of the above scheme, the training also includes using the MINE method to calculate the SPL mutual information estimate using the neural network θ, namely:
[0037]
[0038] in, represents the SPL mutual information estimation value; T θ is a function parameterized by a neural network;
[0039] The SPL mutual information is maximized by gradient descent θ.
[0040] MINE stands for Mutual Information Neural Estimation. It converts the SPL mutual information into the KL divergence between the joint distribution and the marginal distribution. Using a neural network to approximate a function T that satisfies the integrability condition, we obtain a lower bound estimate of the SPL mutual information.
[0041] As a further optimization of the above solution, the training also includes constructing a loss function for the second largest language model, namely:
[0042]
[0043] in, represents the loss function; Represents semantic loss; represents the SPL mutual information loss; λ is the mutual information weight coefficient, ranging from [0.1, 1.0]; N represents the number of sample pairs; K represents the number of features contained in the second corpus in the i-th sample pair; y i,k represents the ground truth value of the kth feature in the i-th sample pair; represents the predicted probability of the kth feature in the i-th sample pair by the second largest language model;
[0044] After minimizing the loss function, the second largest language model is the SPL use case enhanced large model.
[0045] By maximizing the SPL mutual information to strengthen the domain correlation between input and output, we ultimately obtain a specialized large model that retains general language understanding capabilities and has the structural awareness characteristics of the software product line domain.
[0046] As a further optimization of the above solution, in S5, the SPL feature model is XML formatted data; the SPL feature model is encoded and processed to generate a visual model and display it.
[0047] Compared with the prior art, the present invention achieves the following beneficial effects:
[0048] The present invention combines the constraint relationship between the software product line feature model and the UML use case diagram, encodes the domain knowledge of software product line feature modeling and UML use case modeling into structured prompts, and guides the large language model to generate standardized feature model corpus and UML use case diagram corpus. By splicing the feature model corpus with the UML use case diagram corpus, a use case enhanced joint representation is formed as a part of the training set data input model, driving the domain adaptive large language model parameter optimization. Finally, a specialized SPL use case enhanced large model for software product line engineering is formed, realizing end-to-end intelligent conversion from unstructured requirement description to formal feature model, realizing efficiency leap and cost optimization of software product line feature model modeling through generative artificial intelligence driven automated modeling technology, and realizing more efficient and accurate software product line modeling for complex software requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of a method for generating an automated software product line feature model based on use case enhancement provided by an embodiment of the present invention;
[0050] Figure 2 This is a flow chart of automatically generating a software product line feature model by enhancing a large model using SPL use cases, as provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in 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. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0052] like Figure 1 As shown, this embodiment provides a method for generating an automated software product line feature model based on use case enhancement, including the following steps:
[0053] S1. Collect the feature model of the software product line, which includes multiple features; construct a feature constraint prompt framework based on the constraint relationship between the features; the constraint relationship between the features is the first constraint relationship, including mandatory, optional, or, exclusive or, required, and exclusive.
[0054] The UML use case diagram includes multiple constituent elements, including participants and use cases.
[0055] The use case constraint prompt framework is constructed based on the constraint relationships between constituent elements. Constraint relationships between constituent elements are secondary constraint relationships, including those between actors and use cases, and between use cases. Secondary constraint relationships include association, generalization, inclusion, and extension. The feature model of a software product line contains several features, and its tree-like hierarchy reflects the constraint relationships between features. UML use case diagrams contain use cases, actors, and relationships.
[0056] S2. Collect the first software requirement text, input the first software requirement text into a feature constraint prompt framework and a use case constraint prompt framework, and obtain a use case constraint prompt and a feature constraint prompt respectively.
[0057] For example, the first software requirement text is given as:
[0058] "The online translator system is designed to provide users with convenient translation services, allowing users to enter text to be translated directly on the screen and supporting instant translation between multiple languages. When encountering text that cannot be recognized or translated, the system will promptly notify the user through a prompt message. Users can also save frequently translated text or phrases and view past translations through the history function. The system has voice input capabilities, can process and translate text in uploaded images, and allows users to select different translation engines for optimal translation results. In addition, the system provides a translation quality rating function, supports offline translation mode, allows users to customize interface themes and font sizes, has multi-platform compatibility, and provides an API interface for third-party application integration. While protecting user privacy, the system regularly updates the language library to support emerging languages and dialects, and collects feedback through user feedback channels for continuous product improvement."
[0059] The generated use case constraint hint is:
[0060] "You are an expert in UML use case diagram construction. Given a piece of software requirement text, you can generate the corresponding UML use case diagram, for example:
[0061] Participant 1:
[0062] Actor 1 -> Use Case 1
[0063] Actor 1 -> Use Case 2
[0064] Use Case 1 -> Use Case 2
[0065] Participant 2:
[0066] Actor 2 -> Use Case 3 ......
[0068] Related Relationships: ......
[0070] Generalization relationship: ......
[0072] Contains relationship: ......
[0074] Extended Relationship:
[0075] …”
[0076] Below I will give you a software requirement text. Please generate a UML use case diagram based on the following software requirement text:
[0077] {{The online translator system is designed to provide users with a convenient translation service, allowing users to enter text to be translated directly on the screen, and supports instant translation between multiple languages. When encountering text that cannot be recognized or translated, the system will promptly inform the user through a prompt message. Users can also save commonly translated text or phrases and view past translations through the history function. The system has a voice input function, can process and translate text in uploaded images, and allows users to select different translation engines to obtain the best translation effect. In addition, the system provides a translation quality rating function, supports offline translation mode, allows users to customize interface themes and font sizes, has multi-platform compatibility, and provides an API interface for third-party application integration. While protecting user privacy, the system regularly updates the language library to support emerging languages and dialects, and collects opinions through user feedback channels to continuously improve the product.}}
[0078] Note: The constraint relationships that may be included in the generated UML use case diagram include association relationships, generalization relationships, inclusion relationships, and extension relationships.
[0079] The generated result only needs to return the data in the above format. "
[0080] The generated feature constraint hint is:
[0081] "You are a professional requirements analyst who is good at analyzing software requirements to define the Software Product Line (SPL) feature model. You know that there are six possible constraint types in the SPL feature model, including mandatory, optional, or, exclusive or, required, and exclusive. "Mandatory" applies to a single mandatory feature. "Optional" applies to a single optional feature. "Or" applies to a one-to-many constraint, when the parent feature exists, at least one child feature exists, and two or more child features can coexist. "Exclusive or" applies to a one-to-many constraint, when the parent feature exists, the child features coexist in a mutually exclusive manner. "Required" applies to two unrelated but interdependent features. "Excluded" applies to two unrelated and mutually exclusive features.
[0082] Below I will give you a software requirement text. Please generate a software product line feature model based on the following software requirement text:
[0083] {{The online translator system is designed to provide users with a convenient translation service, allowing users to enter text to be translated directly on the screen, and supports instant translation between multiple languages. When encountering text that cannot be recognized or translated, the system will promptly inform the user through a prompt message. Users can also save commonly translated text or phrases and view past translations through the history function. The system has a voice input function, can process and translate text in uploaded images, and allows users to select different translation engines to obtain the best translation effect. In addition, the system provides a translation quality rating function, supports offline translation mode, allows users to customize interface themes and font sizes, has multi-platform compatibility, and provides an API interface for third-party application integration. While protecting user privacy, the system regularly updates the language library to support emerging languages and dialects, and collects opinions through user feedback channels to continuously improve the product.}}
[0084] The generated result only needs to return XML format data, that is, {XML format code}.
[0085] Input the use case constraint prompt and the first software requirement text into the preset first language model to generate UML use case diagram structured data, which is recorded as the first corpus. In this embodiment, ChatGLM-9b is used as the first language model. The generated first corpus is as follows:
[0086] "user:
[0087] User->Enter the text to be translated (enter the text to be translated on the screen)
[0088] User->Real-time translation (supports instant translation between multiple languages)
[0089] User->Receive prompt information (When the input text cannot be recognized or translated, the system will notify the user through a prompt message)
[0090] User->Save Frequent Translations (allows users to save frequently translated text or phrases)
[0091] User->View Translation History (provides history function, allowing users to view past translation records) User->Voice Input (supports voice input function, allowing users to input text by voice)
[0092] User->Image Translation (able to process and translate text in uploaded images)
[0093] User->Select Translation Engine (allows users to select different translation engines to obtain the best translation results) User->Evaluate Translation Quality (provides translation quality rating function, allowing users to evaluate translation results)
[0094] User->Offline Translation (supports offline translation mode to ensure that basic translation functions can still be used when the network is unavailable)
[0095] User->Customize interface (allows users to customize interface themes and font sizes to meet the visual preferences of different users)
[0096] User->Use multi-platform (with multi-platform compatibility, supports use on mobile phones, tablets and computers)
[0097] User->Feedback (provides user feedback channels and collects user opinions to continuously improve products) system:
[0098] System -> Protect Privacy (ensures that user-entered text is not stored or shared without permission)
[0099] System->Update Language Library (The language library is updated regularly to support more emerging languages and dialects)
[0100] System->Provide API interface (provides API interface to allow third-party applications to integrate translation functions) association relationship:
[0101] User inputs text to be translated -> system translates in real time
[0102] User saves frequently used translations->The system provides the ability to view translation history
[0103] User voice input->system image translation
[0104] Generalization relationship:
[0105] User real-time translation -> User offline translation
[0106] User receives prompt information -> User provides feedback
[0107] Contains relationship:
[0108] User real-time translation -> Select translation engine + Evaluate translation quality
[0109] User views translation history -> saves frequently used translations
[0110] System privacy protection->Update language library + provide API interface
[0111] Extended Relationship:
[0112] User voice input -> User image translation
[0113] User-defined interface -> user-friendly multi-platform
[0114] The system provides API interface->system update language library".
[0115] Input the feature constraint prompt and the first software requirement text into the preset second language model to generate SPL feature model structured data, which is recorded as the second corpus. In this embodiment, ChatGLM-9b is used as the second language model. The generated second corpus is as follows:
[0116]
[0117]
[0118] The first software requirement text, the first corpus, and the second corpus are cleaned and standardized, including data desensitization, terminology standardization, and integrity verification.
[0119] Data desensitization involves identifying sensitive entities in the first software requirement text and replacing them with placeholders. Sensitive entities include personal identity information and business-sensitive information. Personal identity information includes name, ID number, phone number, email address, and address. Business-sensitive information includes customer order numbers, contract numbers, and financial transaction amounts. In this embodiment, spaCy's NER model is used to identify sensitive entities in the collected first software requirement text.
[0120] Terminology standardization involves creating a standard terminology database; identifying non-standard terms in the first software requirements document and replacing them with standard terms from the standard terminology database; and eliminating ambiguity caused by synonyms, polysemous words, and abbreviations. In this embodiment, the standard terminology database is created in accordance with GB / T 8567-2006, "Computer Software Documentation Specification."
[0121] Completeness checking involves identifying missing fields in the first corpus and completing them based on the first software requirements document. This ensures that each use case in the use case diagram has required fields, such as name, description, and participants. Missing fields are user-defined. Features and constraints between features are identified in the second corpus, and these constraints are corrected based on the first software requirements document.
[0122] In this embodiment, the first corpus and the second corpus are encoded by the pre-trained language model BERT to obtain vectors V and V respectively. uml and vector V fm The formal representation of a UML use case diagram is a directed graph G = (V, E), where the node set V consists of actors and use cases, and the edge set E consists of the constraints between actors and use cases, and between use cases. Use cases are extracted from the node set V, and the constraints between use cases are extracted from the edge set E. The pre-trained language model BERT is used to encode the UML use case diagram vector, namely V uml .
[0123] Then encode the first software requirement text to obtain vector V req ; Set the separator [SEP] and encode it to get vector V sep , used to explicitly distinguish between requirement text and use case diagram features.
[0124] S3. Concatenate the first corpus and the second corpus to construct a use case enhanced joint representation. Specifically, the attention mechanism is used to dynamically calculate the position relationship, which is the vector V uml , vector V sep , vector V fm Assign independent position codes, namely pos uml ,pos sep ,pos fm ; The splicing process is expressed as:
[0125] V joint =V uml ⊕V sep ⊕V fm +Concat(pos uml ,pos sep ,pos fm );
[0126] Among them, ⊕ represents exclusive OR, which indicates the use case enhanced joint representation.
[0127] A use case enhanced joint representation and the corresponding first software requirement text constitute a sample pair. The positional relationship is dynamically calculated through the attention mechanism, and independent positional encodings are assigned to text, separators, and graph features, preserving spatial order.
[0128] S4. Repeat steps S2 and S3 to obtain multiple sample pairs to form a training set; the second largest language model is trained using the training set to maximize the correlation between the use case enhanced joint representation and the first software requirement text to obtain the SPL use case enhanced large model.
[0129] Specifically, in this embodiment, the training is to calculate the SPL mutual information of the sample pair, that is:
[0130]
[0131] Among them, I SPL (R; J) represents the SPL mutual information, which can be understood as the preliminary definition of the SPL mutual information between sample pairs; r represents the vector V req ; j represents the vector V joint ; R is a set of multiple r; J is a set of multiple j; p(r,j) represents the joint distribution of r and j; p(r) and p(j) represent the marginal distributions of r and j respectively; I SPL(R; J) can be viewed as the KL divergence between p(r, j) and p(r)p(j). The SPL mutual information is maximized, and the correlation between the example-enhanced joint representation and the first software requirement text is maximized.
[0132] In this embodiment, the MINE method is used to calculate the SPL mutual information estimation value using the neural network θ, that is:
[0133]
[0134] in, represents the SPL mutual information estimation value; T θ is a function parameterized by a neural network; by gradient descent θ, the SPL mutual information is maximized.
[0135] MINE stands for Mutual Information Neural Estimation. It converts the SPL mutual information into the KL divergence between the joint distribution and the marginal distribution. Using a neural network to approximate a function T that satisfies the integrability condition, we obtain a lower bound estimate of the SPL mutual information.
[0136] In this embodiment, the training also includes constructing a loss function for the second largest language model, namely:
[0137]
[0138] in, represents the loss function; Represents semantic loss; represents the SPL mutual information loss; λ is the mutual information weight coefficient, ranging from [0.1, 1.0]; N represents the number of sample pairs; K represents the number of features contained in the second corpus in the i-th sample pair; y i,k represents the ground truth value of the kth feature in the i-th sample pair; represents the predicted probability of the second largest language model for the kth feature in the i-th sample pair;
[0139] After minimizing the loss function, the second largest language model is the SPL use case enhanced large model.
[0140] By maximizing the SPL mutual information to strengthen the domain correlation between input and output, we ultimately obtain a specialized large model that retains general language understanding capabilities and has the structural awareness characteristics of the software product line domain.
[0141] S5, such as Figure 2 As shown, the second software requirement text is collected, the feature constraint prompt framework is input, and the generated feature constraint prompt is used as a prompt word; the prompt word is input into the SPL use case enhanced large model for reasoning to generate an SPL feature model.
[0142] In this embodiment, the SPL feature model is XML formatted data.
[0143] Specifically, the second software requirement text is: "The online legal consultation service platform is committed to providing users with convenient and secure services, allowing users to register an account and set login credentials, while providing a secure login mechanism to protect user privacy. Users can enter consulting questions or keywords on the homepage, and the system will display relevant legal consulting articles, cases or lawyer information. If the search request does not match any results, the system will prompt the user to try other keywords or contact customer service. Users can view the profiles and evaluations of legal experts in different fields, select suitable experts for online consultation, and communicate with experts in real time through instant chat functions. The system supports users to upload relevant documents or evidence materials, and ensures the security and confidentiality of all uploaded content and communications. The user's consultation history will be recorded for review at any time, and the consultation results can be evaluated and feedback can be provided. The system continuously optimizes the service quality based on this. In addition, the platform provides a self-service answer area for common legal questions, supports multiple payment methods, and provides users with electronic receipts. Customer service support helps solve problems encountered during user use, and the system regularly updates legal and regulatory information to keep the content timeless and accurate."
[0144] The output SPL feature model is:
[0145]
[0146] The SPL feature model is coded and processed, and a visual model is generated and displayed using the FeatureIDE tool. FeatureIDE is an open-source integrated development environment (IDE) based on Eclipse, focusing on feature-oriented software development (FOSD) and designed to support the development and management of software product lines (SPLs).
[0147] The present invention combines the constraint relationship between the software product line feature model and the UML use case diagram, encodes the domain knowledge of software product line feature modeling and UML use case modeling into structured prompts, and guides the large language model to generate standardized feature model corpus and UML use case diagram corpus. By splicing the feature model corpus with the UML use case diagram corpus, a use case enhanced joint representation is formed as a part of the training set data input model, driving the domain adaptive large language model parameter optimization. Finally, a specialized SPL use case enhanced large model for software product line engineering is formed, realizing end-to-end intelligent conversion from unstructured requirement description to formal feature model, and realizing efficiency leap and cost optimization of software product line feature model modeling through generative artificial intelligence driven automated modeling technology.
[0148] Based on the disclosure and teachings of the above description, those skilled in the art may also make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and modifications and variations of the present invention should also fall within the scope of protection of the claims of the present invention. In addition, although certain specific terms are used in this description, these terms are only for convenience of description and do not constitute any limitation to the present invention.
Claims
1. A method for generating an automated software product line feature model based on use case enhancement, characterized in that: The steps include: S1. Collect a feature model of a software product line, wherein the feature model includes multiple features; construct a feature constraint prompt framework based on the constraint relationships between the features; for a UML use case diagram, which includes multiple constituent elements, construct a use case constraint prompt framework based on the constraint relationships between the constituent elements; S2. Collect the first software requirement text, input the feature constraint prompt framework and the use case constraint prompt framework, and obtain use case constraint prompts and feature constraint prompts respectively; Inputting the use case constraint prompt and the first software requirement text into a preset first language model to generate UML use case diagram structured data, which is recorded as a first corpus; Inputting the feature constraint prompt and the first software requirement text into a preset second language model to generate SPL feature model structured data, which is recorded as a second corpus; S3. Encode the first corpus and the second corpus to obtain vectors V uml and vector V fm ; Then encode the first software requirement text to obtain vector V req ; Set the separator and encode it to get vector V sep ; Use the attention mechanism to dynamically calculate the position relationship, which is the vector V uml , vector V sep , vector V fm Assign independent position codes, namely pos uml ,pos sep ,pos fm ; The first corpus and the second corpus are concatenated and expressed as: V joint =V uml ⊕V sep ⊕V fm +Concat(pos uml ,pos sep ,pos fm ); Among them, ⊕ represents exclusive OR, V joint Representation use case enhancement joint representation; One of the use case enhanced joint representations and the corresponding first software requirement text constitutes a sample pair; S4. Repeat steps S2 and S3 to obtain multiple sample pairs to form a training set; the second large language model is trained using the training set to maximize the correlation between the use case enhanced joint representation and the first software requirement text, thereby obtaining an SPL use case enhanced large model; The training is to calculate the SPL mutual information of the sample pairs, that is: Among them, I SPL (R; J) represents the SPL mutual information; r represents the vector V req ; j represents the vector V joint ; R is a set of multiple r; J is a set of multiple j; p(r,j) represents the joint distribution of r and j; p(r) and p(j) represent the marginal distributions of r and j respectively; Maximizing the SPL mutual information to maximize the correlation between the use case enhanced joint representation and the first software requirement text; The training also includes using the MINE method to calculate the SPL mutual information estimate using the neural network θ, namely: in, represents the SPL mutual information estimation value; T θ is a function parameterized by a neural network; Maximize the SPL mutual information by gradient descent θ; S5. Collect the second software requirement text, input the feature constraint prompt framework, and use the generated feature constraint prompt as a prompt word; input the prompt word into the SPL use case enhanced large model for reasoning to generate an SPL feature model.
2. The method for generating an automated software product line feature model based on use case enhancement according to claim 1, characterized in that: The constraint relationship between the features is a first constraint relationship, including mandatory, optional, or, exclusive or, required, exclusive; The constituent elements include participants and use cases; the constraint relationship between the constituent elements is a second constraint relationship, including the relationship between the participants and the use cases, and the relationship between the use cases; the second constraint relationship includes association, generalization, inclusion, and extension.
3. The method for generating an automated software product line feature model based on use case enhancement according to claim 1, characterized in that: In S2, the first software requirement text, the first corpus, and the second corpus are cleaned and standardized, including data desensitization, terminology standardization, and integrity verification; The data desensitization comprises: identifying sensitive entities in the first software requirement text and replacing the sensitive entities with placeholders; The term standardization includes: creating a standard term base; identifying non-standard terms in the first software requirement text and replacing them with standard terms in the standard term base; The integrity check is as follows: identifying missing fields in the first corpus and completing the missing fields according to the first software requirement text; identifying the features and the constraint relationships between the features in the second corpus, and correcting the features and the constraint relationships according to the first software requirement text.
4. The method for generating an automated software product line feature model based on use case enhancement according to claim 1, characterized in that: The training also includes constructing a loss function for the second largest language model, namely: in, represents the loss function; Represents semantic loss; represents the SPL mutual information loss; λ is the mutual information weight coefficient, ranging from [0.1, 1.0]; N represents the number of sample pairs; K represents the number of features contained in the second corpus in the i-th sample pair; y i,k represents the ground truth value of the kth feature in the i-th sample pair; represents the predicted probability of the kth feature in the i-th sample pair by the second largest language model; After minimizing the loss function, the second largest language model is the SPL use case enhanced large model.
5. The method for generating an automated software product line feature model based on use case enhancement according to claim 1, characterized in that: In S5, the SPL feature model is XML formatted data; the SPL feature model is encoded and processed to generate a visual model and display it.
Citation Information
Patent Citations
Combination optimization automatic modeling-oriented training data generation method and system
CN119294403A
Test case generation method and system based on large model and retrieval enhancement generation
CN119537222A