This application discloses a precise testing method, apparatus, device, and medium based on code change and
test case mapping, relating to the field of
software testing technology. The method includes: executing test cases and collecting their execution traces using
code coverage tools, recording the signatures of all covered code methods and their
coverage data; storing the mapping relationship between
test case identifiers, code method signatures, and coverage; obtaining a
list of changed files through a version
control system when a code repository commits; performing method-level structural comparisons for each changed file;
processing all changed files in parallel and merging them to obtain a final set of changed methods composed of affected method signatures; comparing the set of changed methods with an established
test case-code method mapping
database; retrieving all test cases covering any method in the set of changed methods, and generating a recommended test case
list. Therefore, this application can achieve a
regression testing scheme with high
test quality and execution efficiency.