CN-121979518-A - Intelligent auxiliary method and system for software development
Abstract
The invention belongs to the technical field of software development and discloses an intelligent auxiliary method and system for software development, comprising the following steps of acquiring a software development demand text and generating a structured demand model based on a natural language processing model and a knowledge graph of the software development field; the method comprises the steps of generating a plurality of candidate technical schemes and scoring based on a structural demand model and a technical stack adaptation rule, realizing real-time generation of codes based on a pre-training coding model and context information of a current development scene, automatically generating test cases and generating test reports based on the structural demand model and the generated codes, collecting data of all links in the whole development process, and continuously optimizing parameters through a reinforcement learning algorithm. By adopting the method and the system, the intelligent assistance of the whole-flow software development from the demand analysis to the iterative optimization is realized, the development efficiency and the code quality are improved, the development threshold is reduced, and the technical problems of fragmentation and poor suitability of the existing auxiliary tool are solved.
Inventors
- LIU CHENXIN
- SHA NING
- WANG TIANYUE
- PAN JIE
Assignees
- 海口灵点教育科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260126
Claims (10)
- 1. The intelligent auxiliary method for software development is characterized by comprising the following steps of: Step S1, demand analysis, namely acquiring a software development demand text, and performing word segmentation, entity identification and relation extraction on the demand text based on a natural language processing model and a knowledge graph of the software development field to generate a structured demand model; step S2, scheme generation, namely, based on the structural demand model obtained in the step S1, searching a historical development case library, generating a plurality of sets of candidate technical schemes by combining technical stack adaptation rules, scoring feasibility, economy and maintainability of each candidate technical scheme by adopting a analytic hierarchy process, and outputting 1-3 sets of technical schemes with the highest scores for a developer to select; S3, coding assistance, namely acquiring a technical scheme selected by a developer, and based on a pre-training coding model, combining the context information of the current development scene to realize real-time generation of codes, real-time verification of grammar errors, unification of code styles and output of performance optimization suggestions; Step S4, test assistance, namely automatically generating unit test and integrated test cases based on the structured demand model and the generated codes, executing automatic test and generating a test report, positioning problem codes and giving correction suggestions aiming at the cases which do not pass the test; And S5, iterative optimization, namely collecting demand analysis data, scheme selection data, coding modification data and test result data in the whole development process, and continuously optimizing parameters of a demand analysis model, scheme generation rules and a pre-training coding model through a reinforcement learning algorithm.
- 2. The intelligent auxiliary method and system for software development according to claim 1, wherein in step S1, an improved model based on BERT is adopted as a natural language processing model, the BERT model is finely tuned through a corpus of the software development domain, and the recognition precision of the model to the domain term is improved; step S11, firstly, preprocessing a required text, removing irrelevant characters and stop words, and performing word segmentation and part-of-speech tagging; Step S12, inputting the preprocessed text into the BERT model after fine adjustment, and identifying a functional module entity, a data entity, a technical index entity and a constraint condition entity in the demand; Step S13, finally, based on the knowledge graph of the software development field, extracting the association relation between the identified entities through the graph neural network model, and constructing a structured demand model; The structured demand model is stored in a JSON format and comprises fields of demand ID, demand type, demand description, associated demand ID and constraint parameters.
- 3. The intelligent assisting method and system for software development according to claim 1, wherein in step S2, the history development case library stores software development project cases completed in the past, each case including case ID, requirement description, adopted technical scheme, development period, cost, maintenance record information; s21, converting the structured demand model into a vector by adopting a vector retrieval algorithm, performing similarity calculation with the demand vector of the cases in the historical case library, and retrieving a plurality of cases matched with the similarity as references; step S22, a technology stack adaptation rule is formulated based on the matching relation of the demand type, the constraint condition and the technology stack, and for high concurrency demands, a micro-service architecture and a distributed database technology stack are preferentially adapted; step S23, scoring feasibility, economy and maintainability of each candidate technical scheme by adopting an analytic hierarchy process; And step S24, sorting according to the comprehensive scores, and outputting the first 1-3 sets of candidate technical schemes, wherein the scheme content comprises architecture design, technical stack details, development steps, expected cost and period.
- 4. The intelligent software development assistance method and system according to claim 3, wherein in step S23, the grading process of the analytic hierarchy process is specifically: step S231, firstly, constructing a judgment matrix, taking feasibility, economy and maintainability as criterion layers, taking specific evaluation indexes under each criterion as scheme layers, and determining weights of each criterion and index through field expert scoring; The method comprises a scheme layer, a technical maturity index, a team adaptation index, an economic efficiency index, a maintainability index, a code readability index and a document integrity index, wherein the feasibility index comprises a technical maturity index and a team adaptation index; Step S232, performing consistency test, calculating a feature vector corresponding to the maximum feature value of the judgment matrix, testing a consistency proportion CR, if CR is less than 0.1, judging that the matrix passes the consistency test, otherwise readjusting expert scoring; and step S233, finally, calculating the comprehensive score of each candidate technical scheme by adopting a comprehensive score calculation formula according to the weight passing the consistency test, wherein the comprehensive score is as follows: ; Wherein, the Is a composite score; Weights for the ith criterion; the number of the rules is the number; is the score of the jth scheme under the ith criterion.
- 5. The intelligent software development assistance method and system according to claim 1, wherein in step S3, a fusion model of CodeBERT and GPT is adopted as the pre-training encoding model; step S31, firstly, collecting context information of a current development scene, wherein the context information comprises written code fragments, a current development module and a technical stack type; step S32, inputting the context information and the corresponding functional requirements in the structural requirement model as input, and inputting the fusion model to generate a plurality of candidate code segments; step S33, finally, screening candidate code segments based on code complexity, readability and execution efficiency indexes, and outputting optimal code segments for reference of developers; The system carries out grammar verification on codes written by developers in real time, adopts a grammar parser to identify grammar errors and give correction prompts, checks the code styles based on code style specifications preset by development teams and provides unified modification suggestions, and recognizes performance bottlenecks in the codes through a static code analysis tool to give performance optimization suggestions.
- 6. The intelligent software development assistance method and system according to claim 1, wherein in step S4, the process of automatically generating the test case is as follows: step S41, firstly, extracting test points based on functional requirements and constraint conditions in a structural requirement model, and determining test input, expected output and a test scene; step S42, dividing the test input into a valid equivalence class and an invalid equivalence class by adopting an equivalence class dividing method, and generating a unit test case aiming at a boundary value of a constraint condition by adopting a boundary value analysis method; And S43, finally, converting the generated test cases into executable test codes, calling an automatic test framework to execute the test, recording test results, and for the cases which do not pass the test, carrying out static analysis and dynamic tracking and positioning on the problem code positions through codes, and giving correction suggestions by combining a demand model.
- 7. The intelligent software development assistance method and system according to claim 1, wherein in step S5, the reinforcement learning algorithm is implemented as follows: step S51, firstly, defining a state space as a feature vector for developing the whole flow data, wherein the feature comprises a required text length, a required type, a technical stack type, a scheme selection result, code modification times, a test passing rate and a development period; the reward function is a weighted sum of a development efficiency improvement value and a code quality improvement value; And S52, initializing reinforcement learning agent parameters, inputting acquired development data into the agent, outputting a model parameter adjustment strategy by the agent based on the current state, updating each auxiliary model parameter according to the adjustment strategy, acquiring application data of the updated model in a subsequent development project, calculating a reward value, and optimizing the agent parameters through back propagation to realize continuous iterative optimization of the model.
- 8. The intelligent software development assistance method and system according to claim 7, wherein, in step S51, ; 。
- 9. A system for an intelligent software development assistance method according to any one of claims 1-8, comprising a requirement analysis module, a scheme generation module, a coding assistance module, a test assistance module, a data acquisition module, a model optimization module, and an interaction module; the demand analysis module is used for acquiring a software development demand text and generating a structured demand model based on a natural language processing model and a domain knowledge graph; The scheme generation module is used for searching the historical case library based on the structural demand model, generating candidate technical schemes by combining the technical stack adaptation rules, and grading and outputting an optimal scheme through an analytic hierarchy process; the coding auxiliary module is used for realizing real-time code generation, grammar verification and optimization suggestion output through a pre-training coding model based on the selected technical scheme and development context information; the test auxiliary module is used for generating test cases based on the demand model and the codes, executing automatic tests, positioning problem codes and giving correction suggestions; the data acquisition module is used for acquiring various data in the whole development process, including the requirement analysis data, the scheme selection data, the coding modification data and the test result data, cleaning and standardizing the acquired data, and storing the acquired data in the data warehouse; the model optimization module is used for continuously optimizing parameters of each auxiliary model through a reinforcement learning algorithm based on the data acquired by the data acquisition module; And the interaction module is used for realizing interaction between a developer and the system and comprises functions of text input, technical scheme selection, code modification and test result viewing, and three interaction modes of text input, voice input and visual operation are supported.
- 10. The intelligent auxiliary system for software development according to claim 9, wherein the demand analysis module comprises a text preprocessing unit, an entity recognition unit, a relation extraction unit and a model storage unit, wherein the text preprocessing unit is responsible for denoising, word segmentation and part-of-speech tagging of a demand text, the entity recognition unit is used for realizing demand entity recognition by adopting a trimmed BERT model, the relation extraction unit is used for realizing entity association relation extraction based on a graph neural network model and a domain knowledge graph, and the model storage unit is used for storing the generated structured demand model and supporting the invoking and inquiring of a subsequent module; The scheme generation module comprises a case retrieval unit, a scheme generation unit, a scoring unit and a scheme output unit, wherein the case retrieval unit adopts a vector retrieval algorithm to retrieve cases matched with the current requirement in a historical development case library, the scheme generation unit generates candidate technical schemes based on matching cases and technical stack adaptation rules, the scoring unit adopts a hierarchical analysis method to realize comprehensive scoring of the candidate schemes, and the scheme output unit is used for displaying scoring results and candidate scheme details in a visual mode and supporting viewing and selection of developers; the coding auxiliary module integrates a pre-training fusion coding model, a grammar parser and a static code analysis tool, and can respond to coding operation of a developer in real time to provide code auxiliary service; The test auxiliary module comprises a test case generation unit, an automatic test unit, a problem positioning unit and a correction suggestion unit, so that the full automation of a test flow can be realized, and the workload of a tester is reduced; The model optimization module comprises a reinforcement learning agent, a parameter adjustment unit and a model evaluation unit, wherein the agent outputs an optimization strategy based on data feedback, the parameter adjustment unit performs parameter updating, and the model evaluation unit evaluates the effect of the updated model.
Description
Intelligent auxiliary method and system for software development Technical Field The invention relates to the technical field of software development, in particular to an intelligent auxiliary method and system for software development. Background With the rapid development of information technology, the development requirements of software are increasingly complex, the development period requirements are continuously shortened, and the requirements on development efficiency and code quality are also higher. Currently, auxiliary tools such as grammar prompt functions of a code editor, automatic test tools, project management tools and the like are already appeared in the software development process, and the tools improve the development efficiency to a certain extent. However, the existing software development auxiliary tools have obvious limitations that firstly, tool function fragmentation is carried out, most tools only provide assistance for a single link of software development, such as code complementation or test only, full-flow coverage from demand analysis to iterative optimization cannot be realized, data among the tools are not communicated, so that developers need to frequently switch among a plurality of tools to influence development efficiency, secondly, intelligent suitability is poor, the existing auxiliary tools mostly adopt fixed rules or universal models, personalized adaptation cannot be carried out according to specific development demands, technology stack types and coding habits of the developers, generated auxiliary results are not enough in pertinence, even mismatching with development scenes is likely to occur, thirdly, the model parameters of the existing tools are mostly fixed, dynamic adjustment cannot be carried out according to actual data feedback in the development process, the auxiliary effects are difficult to be improved along with accumulation of use scenes, fourthly, the existing tools cannot automatically convert the demands of natural language description into structural development guidance information, the demands need to be manually carded by the developers to be converted into time-consuming and power consumption, and deviation of demands easily occur. Therefore, how to construct a set of intelligent auxiliary method and system which can cover the whole process of software development, have personalized adaptation capability and can be optimized continuously becomes a technical problem to be solved in the technical field of the current software development. Disclosure of Invention The invention aims to provide an intelligent auxiliary method and system for software development, which aim at the technical problems of fragmented functions, poor suitability, lack of continuous optimization capability and dependence on manpower in demand analysis of the existing software development auxiliary tool, realize the intelligent auxiliary of the whole flow from demand analysis to iterative optimization, improve the development efficiency and the code quality, and reduce the development threshold. In order to achieve the above purpose, the present invention provides an intelligent auxiliary method for software development, comprising the following steps: s1, demand analysis, namely acquiring a software development demand text, and performing word segmentation, entity identification and relation extraction on the demand text based on a natural language processing model and a knowledge graph of the software development field to generate a structured demand model. Preferably, an improved model based on BERT is adopted as a natural language processing model, and the BERT model is finely tuned through a large amount of corpus in the field of software development, including a demand document, a technical document, a project case description and the like, so that the recognition precision of the model on the field terms is improved. Step S11, firstly, preprocessing a required text, removing irrelevant characters (such as special symbols and redundant blank spaces), stopping words, and performing word segmentation and part-of-speech tagging. Step S12, inputting the preprocessed text into the trimmed BERT model, and identifying functional module entities (such as a user login module), data entities (such as user information), technical index entities (such as response time less than or equal to 2S) and constraint condition entities (such as Windows 10 compatible and above systems) in the demand. And S13, finally, extracting the association relation among the identified entities through a graph neural network model based on the knowledge graph of the software development field, and constructing a structured demand model. The knowledge graph comprises entities, attributes and association relations among the entities in the software development field, such as association relations between a user login module and an identity verification function. The structural demand model is stored i