Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

698 results about "Unit testing" patented technology

In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.

Customized prompt generation service for software engineering tasks

A customized prompt generation service automates prompts to a large language model to perform a specified software engineering task. The service stores the custom data of a client that includes code diff hunks, source code segments, code reviews, repaired code, and unit tests from a code base or repository of the client. Prompt templates are associated with each software engineering task that include the requisite information needed for the large language model to perform the target task. A prompt to a large language model includes examples of the software engineering task from the custom data of the client of the service.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

Saving production runs of a function as unit test and automatic output regeneration

An artificial intelligence system can be used to respond to natural language inputs. The AI System may, for example, receive a first user input for a LLM, generate a first prompt based on the first user input, transmit the first prompt to an LLM, receive an output from the LLM, and evaluate the output from the LLM with reference to one or more validation tests. Responsive to determining that the output from the LLM is not validated, generate a second prompt for the LLM, where the second prompt indicates at least an aspect of the output that caused the output to not be evaluated (e.g., a portion of the output that may need to be updated or corrected), transmit the second prompt to the LLM, and receive an updated output from the LLM. The AI system can include an application for testing functions that utilize interactions with language models.
Owner:PALANTIR TECHNOLOGIES INC

Unit test case generation system based on large language model

The invention provides a unit test case generation system based on a large language model, and the system comprises a function dependency analysis engine module which is used for preprocessing a target project, extracting a function dependency relationship, and generating an abstract syntax tree and a source code file; the large model module is used for automatically generating a test case through the code context information and the optimized cue word; and the verification and optimization module is used for verifying whether the test cases can be successfully executed or not by compiling and running the test cases, marking part of the test cases needing to be further processed, automatically analyzing error reasons, optimizing cue words and realizing automatic repair of the part of the test cases. According to the unit test case generation system based on the large language model, the function dependency analysis and the large language model are combined, the high-quality test case can be automatically generated, dependence on manpower or existing test cases is not needed, manual intervention is reduced, and the test efficiency and comprehensiveness are improved.
Owner:SHANGHAI ANBAN INFORMATION TECH CO LTD

Large language models for creating a multi-lingual, low-resource code translation dataset

One or more unit-test cases are generated from a monolingual code corpus and the generated unit-test cases are filtered to generate a corpus of unit-test cases which have acceptability scores exceeding one or more predefined thresholds. One or more of the code samples of the monolingual code corpus are translated from a source language to a target language using a pretrained Large Language Model and the generated unit-test cases are translated from the source language to the target language. The LLM-translated code samples are validated using the translated unit-test cases and a parallel-data training corpus comprising the LLM-translated code samples that pass the validation is created. The pretrained large language model (LLM) is fine-tuned using the parallel-data training corpus, a given code segment is translated using the fine-tuned large language model (LLM), the translated given code segment is tested and the tested given code segment is deployed.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION +1

Code automatic generation and optimization system based on multiple modes

The invention discloses an automatic code generation and optimization system based on multiple modes, which relates to the technical field of automatic programming, and comprises a task analysis module for analyzing task description and constraint conditions in combination with a CLIPS rule engine and a knowledge graph and original data, identifying task targets and requirements, and outputting a task risk assessment report and a task intention set; the optimization decision module is used for selecting an optimal modal data subset by using a particle swarm optimization algorithm and a path planning algorithm, performing optimization adjustment according to task requirements, and outputting a code generation strategy; and the test evaluation module is used for evaluating and improving the unit test and the integration test by utilizing the variation test, carrying out quality and performance evaluation on the code through continuous integration and continuous delivery, and outputting a code evaluation report and an optimization suggestion. According to the method, the optimal modal data subset is dynamically screened, and the data transmission path is optimized, so that the code performance is ensured, the computing resource consumption is reduced, and the global optimization of the code generation strategy is realized.
Owner:FUJIAN QIFEI FUTURE TECH CO LTD

Method and device for automatically generating unit test based on thinking chain prompt

The invention discloses a thinking chain prompt-based unit test automatic generation method and device, and the method comprises the steps: (1), carrying out the analysis of a to-be-tested project, and constructing an abstract syntax tree; (2) constructing a system dependency graph according to the association among the nodes of the abstract syntax tree; (3) locating the most relevant context information of the to-be-tested method by using the system dependency graph; (4) constructing a simplified context code by using the most relevant context information of the to-be-tested method; (5) establishing an object construction graph, and guiding the large language model to generate an object creation code for the method to be tested in combination with a thinking chain prompt technology from bottom to top; and (6) in combination with the object creation code and the simplified context code, guiding the large language model to generate a correct test case, and performing verification and repair. According to the method, the correctness of generating the test case by the large model can be effectively improved, the generated test case is improved by utilizing the interaction capability of the large model, and finally, the method is superior to the existing method in the aspects of accuracy, coverage rate, assertion quality and the like.
Owner:ZHEJIANG UNIV

Conversational unit test generation using large language model

A large language model, trained on source code and natural language text generates a unit test for a change to a file in a pull request of a code repository. An ordered sequence of prompts is created and each is applied serially to the large language model to perform an individual task that leads to the generation of the unit test. The unit test may be added to an existing file or generated as a newly-created file. Each prompt includes the data from a previously-issued prompt of the ordered sequence in order for the model to retain contextual knowledge learned previously. The model generates the unit test as update commands when the unit test is added to an existing file.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

Method and system for automating software development lifecycles

A method for automating a software development lifecycle by using artificial intelligence is disclosed. The method includes receiving a request to generate software components, the request including requirements in a natural language format; determining, by using a first model, tasks to generate the requested software components based on the request, each of the tasks including a sequence of subtasks, an acceptance criterion, and a predicted effort level; generating, by using a second model, sets of software code based on the tasks, the sets of software code corresponding to the requested software components; generating, by using a third model, unit tests for each of the sets of software code; initiating the unit tests for each of the sets of software code; and releasing, by using a fourth model, the sets of software code based on a result of the corresponding unit tests.
Owner:JPMORGAN CHASE BANK NA

Test checking of pull request changes using large language model

A large language model, trained on source code and natural language text, predicts the testworthiness of a change in a pull request of a code repository. A prompt given to the large language model includes a question and an answer format for the model to predict whether a unit test is needed for the change. The question describes the model's task, the changes made to the file, and the contents of the changed file. When the model predicts that the change requires a unit test, a check is made to determine if the test exists. A comment is inserted into the pull request indicating the testworthiness of the change and whether a unit test exits for the test.
Owner:MICROSOFT TECHNOLOGY LICENSING LLC

AI large model-based unit test case rapid generation method

The invention particularly relates to a unit test case rapid generation method based on an AI large model. According to the unit test case rapid generation method based on the AI large model, structure information is extracted through a static AST, an execution path is tracked through dynamic instrumentation, and code analysis is achieved; an analysis result is converted into cue words through AI, a multi-scene use case is generated through reasoning, and the multi-scene use case is matched with a language framework; counting row / branch / path coverage, identifying gaps and optimizing loop logic; hot spots and paths are displayed through a visual report, IDE one-key repair and manual correction of a feedback model are supported, intelligent retrieval and reuse of historical cases are realized by relying on FAISS, and the generation accuracy is continuously improved. According to the unit test case rapid generation method based on the AI large model, high-coverage-rate test case generation is achieved through the AI large model, the test case generation efficiency is remarkably improved, the test period is shortened, the software quality is improved, the workload of manually compiling and maintaining the test case is reduced, and the development cost is reduced.
Owner:INSPUR TIANYUAN COMM INFORMATION SYST CO LTD

Warehouse level code problem solving system based on large language model

The invention discloses a warehouse level code problem solving system based on a large language model, and relates to the technical field of software engineering, a source code file is extracted from a code warehouse, a static analysis tool is utilized to analyze codes, a warehouse level code graph is constructed, and then code entities and dependency relationships thereof are analyzed; based on the warehouse-level code graph, combining historical problem solving data, and constructing a dynamic evolution knowledge graph through continuous learning; through a context retrieval module, according to the context information of the current problem, dynamically retrieving related solution strategies and generating corresponding code patches, complementing or reviewing suggestions; the validity of the generated patch is verified through static analysis, unit testing and integration testing, and a problem solving strategy is optimized according to feedback of a developer. The problem solving efficiency and accuracy can be improved, the development cost is reduced, the solving process is gradually optimized through an intelligent feedback mechanism, a closed-loop feedback mechanism is formed, and therefore the increasingly complex software development requirements are met.
Owner:北京开放传神科技有限公司

Python program test case generation method based on large language model

The invention belongs to the field of test case generation in traditional software engineering, and discloses a Python program test case generation method based on a large language model. The method can automatically generate and optimize a unit test case of a Python program, and comprises the following steps of: extracting public basic context and function information by utilizing project dependent structure scanning and an AST abstract syntax tree, and constructing an accurate cue word template; verification of grammar, operation logic and coverage rate is carried out on the test case generated by the large language model; aiming at the failed test case, designing a new cue word template and an iteration process so as to automatically iterate and improve, and setting the maximum number of iterations so as to ensure the efficiency; and finally, outputting an optimized high-quality successful test case set so as to improve the test efficiency and reduce the waste of manpower and material resources.
Owner:DALIAN UNIV OF TECH

Code generation method, code generation model and code modification model training method

The embodiment of the invention provides a code generation method, a code generation model and a code modification model training method.The code generation method comprises the steps that target code information is retrieved from alternative code information according to a to-be-tested unit in a target program and based on the unit dependency relation of the to-be-tested unit; wherein the alternative code information is obtained by screening auxiliary information based on a target information type, the auxiliary information is obtained by performing grammar structure analysis on a code file of the target program, and the target information type is the type of information used for unit testing; and generating a unit test code of the to-be-tested unit based on the target code information. Through the method, the generation quality of the unit test code can be improved.
Owner:ALIBABA (CHINA) CO LTD

Method and system for realizing automatic code generation by using multiple AI Agents

The invention discloses a method and a system for realizing automatic code generation by using multiple AI Agents, and relates to the field of electric digital data processing, a test driving agent receives a task transmitted by a previous node, and generates a task number, a task description, test data, a unit test script and a code statement; the code generation agent generates or updates codes according to the received task description and code declaration; the test driving agent returns an integrated test script and test data according to the task number; the continuous integration agent performs integration verification and regression test and feeds back information; the test driving agent returns a function test script, a performance test script and test data according to the task number; and the continuous deployment agent carries out continuous delivery and deployment and feeds back information. By means of mutual conversation and cooperative work of multiple AI Agents and in combination with a feedback mechanism, the problem that a single large model cannot complete complex software development tasks is solved, full-process operation automation can be achieved, and the code generation quality and efficiency can be improved.
Owner:LIMING VOCATIONAL UNIV

LLM-based constraint and self-repairing uniformization equipment knowledge graph automatic construction method

The invention belongs to the technical field of equipment knowledge engineering and natural language processing, and discloses an LLM-based constraint and self-repairing uniformization equipment knowledge graph automatic construction method. The method comprises the following steps: firstly, acquiring equipment related document data through network collection, document arrangement and database query; then, utilizing an equipment domain ontology and constraints as preposed soft and hard constraints, driving LLM to generate semantic intermediate representation, and obtaining candidate triples through structured compiling; then, a self-repairing closed loop is formed through semantic unit testing, logic consistency detection and evidence binding verification, and triples which violate constraints and have conflicts or illusions are automatically recognized and repaired; and finally, entity standard identification, cross-document duplicate removal combination and conflict resolution are realized through cross-segment unification and incremental alignment. According to the method, the fragile path that the LLM directly generates the triple and blindly stores the triple is avoided, the illusion and inconsistency problems are effectively inhibited, and the correctness, interpretability and maintainability of the equipment knowledge graph are remarkably improved.
Owner:SICHUAN UNIV

Data quality detection and improvement system for large language model

The invention provides a data quality detection and improvement system for a large language model, and relates to the technical field of code quality management. The data analysis and characteristic extraction module is used for extracting structured and semantic characteristics of codes and constructing a code distribution diagram; the multi-dimensional quality detection module comprehensively evaluates the data set quality from three aspects of semantic diversity, structural consistency and error mode; the code optimization and verification module generates an optimization suggestion based on a detection result, and verifies the effectiveness of an optimization scheme through dynamic evaluation and unit testing; the feedback and self-adaptive optimization module is combined with developer feedback and runtime performance test to dynamically adjust a repair strategy, and the complex code repair efficiency is improved through quantum computing auxiliary path search; according to the method, full-process automation from quality detection to optimization verification is achieved, the method is suitable for multi-dependency and multi-module complex code repair tasks, and the quality and efficiency of the code life cycle are improved.
Owner:北京开放传神科技有限公司

Automatic unit test generation method and device based on retrieval enhancement technology

The invention discloses an automatic unit test generation method and device based on a retrieval enhancement technology, and the method comprises the steps: firstly, analyzing other methods called by a to-be-tested method through a large language model, generating a natural language description of the called method, and generating a natural language description of the to-be-tested method in combination with a code of the to-be-tested method and context information of the to-be-tested method; then, according to code information of a to-be-tested method, whether a retrieval enhancement technology needs to be adopted to generate a unit test case is evaluated, if yes, natural language description and codes are input into a large language model to be embedded, and similar results are retrieved from an embedding result in a vector database; the results are processed and sorted to form a comprehensive prompt set as final retrieval enhancement output; and finally, in combination with retrieval enhancement output, generating a generation strategy of a unit test case by using a large language model. According to the method, the to-be-generated to-be-tested method can be analyzed, and high-quality unit test automatic generation is realized through enabling of the large language model and the retrieval enhancement technology.
Owner:ZHEJIANG UNIV

Method and device for testing AI SOC modular unit of set top box

The invention relates to the technical field of SOC modular unit testing, and discloses an AI SOC modular unit testing method and device of a set top box, and the method can automatically construct a testing platform simulating a real use environment, generate testing cases covering various scenes, achieve parallel testing and real-time interference compensation, and improve the testing efficiency. And multi-dimensional analysis and cross-batch alignment can be carried out on test data. Meanwhile, the method also has an adaptive optimization capability, and can dynamically adjust a test strategy according to a test result, so as to continuously improve the test efficiency and accuracy.
Owner:SHENZHEN YUEXINTONG TECH CO LTD

Unit test code generation method and device, electronic equipment and storage medium

The invention provides a unit test code generation method and device, electronic equipment and a storage medium, and the method comprises the steps: generating a test case of a to-be-tested code based on a large language model; and generating a unit test code for executing the test case based on a test code template engine. According to the method and device, the electronic equipment and the storage medium provided by the invention, the combination of the large language model and the test code template engine in the unit test code generation application is realized, and compared with a scheme of generating the unit test code completely through the large language model, the dependency on the large language model is reduced, and the efficiency of generating the unit test code is improved. Therefore, the influence of low calculation efficiency of a large language model on the generation efficiency of the unit test codes is weakened, the generation efficiency of the unit test codes is improved, and conditions are provided for batch generation of the unit test codes.
Owner:IFLYTEK CO LTD

Python test case generation method based on combination of big language model and type information

The invention discloses a Python test case generation method combining a large language model with type information, and the method comprises the steps: configuring an evaluation environment, including obtaining an open source project code for evaluation, configuring a method operation framework and the like; performing grammatical analysis on the open source project by using the abstract syntax tree, and constructing a control dependency graph G; and based on the control dependency graph G, utilizing cue words to drive a large language model to automatically generate and iterate test cases, and scoring and screening each test case to obtain an optimal test case set. According to the Python program automatic unit testing method and device, the problem that an existing Python program automatic unit testing tool is low in coverage rate on part of codes is solved, the supporting degree of the tool on Python language characteristics can be reflected, a user can be helped to better utilize information of the to-be-tested unit, and a test case higher in coverage rate and better in readability can be provided for a developer.
Owner:NANJING UNIV

System and method for translating a first coding language into a second coding language

Systems and methods for translating a first coding language into a second coding language train a machine learning (ML) model on a first coding language specific data set relating to the first coding language, in which the ML model is trained to translate one or more code sets of the first coding language to respective one or more code sets of the second coding language; using the ML model, generate various unit test cases, in which the unit test cases run the one or more code sets of the second coding language in parallel with the one or more code sets of the first coding language; iteratively test and refine the ML model until a maturity threshold is reached; and upon reaching the maturity threshold, containerize the one or more code sets of the second coding language into one or more applications.
Owner:THE BANK OF NEW YORK MELLON

Full-process automatic unit testing method and device for AI chip operator and medium

The invention discloses a full-process automatic unit testing method, device and equipment for an AI chip operator, a medium and a product. The method comprises the following steps: generating an engineering directory and a test framework design document through an architect agent according to operator interface information and a DSL operator design document knowledge base; the method comprises the following steps of: generating a test code for unit test by a software engineer agent according to a test framework design document and a domain knowledge base, and storing the test code in an engineering directory; multiple rounds of interaction are carried out through a software engineer agent and a test engineer agent, a test code is gradually corrected into a target test code which can be successfully compiled, a generated test case can be successfully executed and the generated test case meets the code coverage rate requirement, and a target operator code passing a unit test is obtained; and submitting the target operator code and the target test code which pass the normativity check to a code warehouse through a code auditing engineer agent so as to automatically realize the whole-process unit test of the AI chip operator.
Owner:SHANGHAI YUNSUI TECHNOLOGY CO LTD

Method and device for automatically generating Java method unit test case based on AI

The invention discloses a method and device for automatically generating a Java method unit test case based on AI, and the method comprises the steps: building a structured annotation specification, carrying out the automatic traversal and intelligent analysis of a Java project, extracting a method signature, a parameter type and a parameter constraint condition, constructing a test data generation model, and carrying out the automatic generation of the test case. The model is transmitted to an AI service to analyze business logic and boundary conditions, test case codes are generated, test cases are optimized and integrated to a project test directory, finally, code areas with insufficient coverage are identified through coverage rate analysis, a test completion strategy is generated, and iterative perfection of the test cases is completed. The technical problems that in the prior art, project-level automatic test case generation cannot be achieved, the generated test case cannot fully cover business logic and boundary conditions, and context relation understanding is lacked are solved, full-automatic project-level test generation is achieved, and the test efficiency and quality are improved.
Owner:BEIJING YULORE INNOVATION TECH

Model testing method, device, equipment and medium

The embodiment of the invention relates to a model testing method and device, equipment and a medium. The method comprises the steps of constructing a test question based on a standard answer in a basic data set; constructing a test data set based on the test questions and the cue word template; obtaining a target model, and inputting cue words in the test data set into the target model to obtain corresponding answers to be tested; performing unit testing on the to-be-tested answer, and determining a unit testing result; and determining a model test result of the target model based on the unit test result. According to the embodiment of the invention, the model test result of the target model is determined according to the unit test result, and the unit test result is used as the test index of the target model, so that compared with the prior art, the runnable particularity of special scenes such as code processing is considered, the real capability of the model can be reflected more objectively and effectively, and the test efficiency is improved. And the accuracy of model testing is greatly improved.
Owner:DOUYIN VISION CO LTD

Unit test case generation method and device, equipment and medium

The invention relates to the technical field of research and development management and the field of financial science and technology, and discloses a unit test case generation method, which comprises the following steps: compiling a current project to generate a class file, carrying out byte code analysis on the class file, traversing each class and method in the class file, and extracting control flow information and calling relation information. Determining circle complexity and call chain information of each method based on the extracted information, and generating path information required by the test case; simulating the execution path to generate a basic unit test case, determining an effective test case by utilizing an evaluation standard, and taking the effective test case as a template for generating a new case; and identifying the to-be-tested code of which the test case is not generated in the class file, generating a new test case by using the template, integrating the effective test case and the new test case, and generating a complete unit test case set. According to the method, by combining byte code analysis and path simulation, dependence on code context is reduced, and the effectiveness of the test case is improved through variation test and coverage rate evaluation.
Owner:PING AN BANK CO LTD

Data testing method and device, storage medium and computer program product

The invention discloses a data testing method and device, a storage medium and a computer program product. The method comprises the steps of obtaining an initial code file and a target prompt statement; analyzing and processing the initial code file and the target prompt statement by using a natural language processing model to generate a unit test code; compiling the unit test code to obtain a compiling result; and in response to determining that the unit test code is compiled based on the compilation result, executing the unit test code to obtain a test execution result. According to the method and the device, the technical problems of low test efficiency and poor test coverage rate in a unit test process in related technologies are solved.
Owner:GUANGZHOU XIAOPENG MOTORS TECH CO LTD

Unit test case generation large model fine tuning method based on feedback reinforcement learning

The invention relates to the technical field of software testing, and discloses a unit test case generation large model fine tuning method based on feedback reinforcement learning, which comprises the following steps: constructing a unit test fine tuning data set based on demand driving; an Actor model is constructed, and optimization is carried out through a demand-driven unit test fine tuning data set; a Critic model is constructed, and optimization is carried out through a demand-driven unit test fine tuning data set; and generating a unit test case based on the optimized Actor model, mapping the unit test case into a single instant reward based on the optimized Critic model, and obtaining a large model generated based on the unit test case through reinforcement learning. The unit test case generation method capable of automatically generating high-quality unit test cases with aligned requirements and consistent styles is constructed, the test efficiency and quality are remarkably improved, and the bottlenecks of traditional test generation in manual dependence, coverage depth and requirement consistency are broken through.
Owner:NO 15 INST OF CHINA ELECTRONICS TECH GRP

Code generation method and device based on large model, equipment, medium and product

The invention discloses a code generation method and device based on a large model, equipment, a medium and a product, and the method comprises the steps: carrying out the code generation through a first code large model according to target code demand data, and obtaining an initial code; according to the first code snippet, generating a test code through a second code large model to obtain a unit test code; according to the unit test code and the initial code, code repair based on editing distance regularization is conducted through a third code large model, and a to-be-analyzed code is obtained; performing iterative optimization on the to-be-analyzed code and the unit test code to obtain a target code corresponding to the target code demand data; according to the method, code generation, unit test generation and code repair are carried out in a multi-model cooperation mode, the reliability and accuracy of code generation can be effectively improved, software security vulnerabilities are reduced, and therefore the stability and security of a software system are improved.
Owner:CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1

High-reliability unit test automatic generation method and apparatus based on conversational large language model

The present invention provides a high-reliability unit test automatic generation method and apparatus based on a conversational large language model. First, projects are parsed and analyzed to extract context information, then the testing necessity of a method to be tested is determined, and different test direction lists are generated on the basis of the division of testing purposes. After initial test cases are generated and repaired, input data searching is performed on passed test cases to improve test input data. Subsequently, mutation testing is performed on all test cases, and test cases are regenerated for failed mutations to improve assertion quality. Finally, successful test cases are reduced and merged to avoid overlapping. The present invention is superior to existing methods in terms of coverage, test data integrity, assertion quality, and the like, and has stable performance across projects of different scales and fields. The generated test cases have significant advantages in readability, understandability, maintainability, test input data integrity, assertion quality, and volume.
Owner:ZHEJIANG UNIV

Full-automatic test equipment

The embodiment of the utility model discloses full-automatic testing equipment, the full-automatic testing equipment comprises a first conveying unit and a testing device, the testing device comprises a first transfer unit, a testing unit, a testing instrument and an upper computer, the first conveying unit is arranged on one side of the first transfer unit, and the testing unit is arranged on the other side of the first transfer unit. The conveying unit is used for conveying a to-be-tested plate to the first transfer unit; the first transfer unit is arranged on one side of the test unit and is used for conveying the to-be-tested plate to the test unit; the upper computer is connected with the test instrument, and the test instrument is connected with the to-be-tested plate through the test unit. By applying the full-automatic test equipment provided by the embodiment of the utility model, the test process can be fully automatically realized, manual participation is reduced, and compared with a semi-automatic mode in the prior art, the test efficiency of the full-automatic test equipment is greatly improved.
Owner:SUZHOU WEICHUANG ELECTRICAL EQUIP TECH