Pull Request Merge Testing by Target Object Relevance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for merging pull requests (PRs) into a master branch require unnecessary tests and resource consumption due to the need to test code changes against both current and new objects, even when the changes are only related to the new object.
Innovation Solution
A method and system that determines whether a code change in a PR is related to a target object, performing tests only on the new object when necessary, thereby avoiding tests on the current object.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If tests are performed on both current and new objects for every PR, then code quality and reliability are ensured, but test time and resource consumption increase unnecessarily
Solution Approach 1:
The patent segments the testing process by dividing objects into current objects and new objects. The system determines whether a PR is related to new objects and selectively applies tests only to relevant object pairs, rather than uniformly testing all combinations. This segmentation allows the system to maintain reliability for relevant tests while eliminating redundant testing time.
Solution Approach 2:
The patent applies partial action by performing only the necessary subset of tests rather than all possible tests. The system determines the minimal required test scope based on PR relevance to new objects, executing only those tests that are actually needed to ensure code quality, thereby reducing unnecessary test time while maintaining adequate reliability.
2Reliability
If comprehensive tests are run on all object pairs, then code reliability is maintained, but resource consumption increases
Solution Approach 1:
The patent segments the testing workload by identifying and separating relevant test cases from irrelevant ones. By determining PR relevance to new objects and selectively executing tests only on related object pairs, the system maintains code reliability through comprehensive testing where needed while significantly reducing overall resource consumption by eliminating redundant test executions.
Solution Approach 2:
The patent changes the parameter of test execution scope from a fixed comprehensive approach to a dynamic selective approach. The system adjusts which tests are executed based on the relationship between the PR and new objects, transforming the testing process from a static all-or-nothing approach to a flexible parameter-driven approach that optimizes resource consumption while maintaining reliability.
3Productivity
If the system determines PR relevance to new objects and selectively tests, then test efficiency improves, but the complexity of the merging process increases
Solution Approach 1:
The patent applies preliminary action by determining PR relevance to new objects before executing the testing process. This preliminary determination step allows the system to plan and execute only the necessary tests, improving test efficiency by avoiding redundant work. The additional complexity of the relevance determination is offset by the significant reduction in unnecessary test execution.
Data Source
AI summary
A method includes determining whether a code change associated with a pull request (PR) is related to a target object. The method further includes performing, in response to that the code change is related to the target object, a test associated with the target object on the PR. The method further includes avoiding, in response to that the code change is not related to the target object, performing the test associated with the target object on the PR. Through this method, it is possible to only perform a test associated with a target object on an extraction request related to the target object, without the need for performing a test associated with another object. Therefore, time and resource usage can be saved, the efficiency of merging a PR can be improved, and the energy consumption can be reduced.


