Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A mutation testing method based on Android multithreaded data dependency

A technology of data dependence and mutation testing, applied in electrical digital data processing, software testing/debugging, error detection/correction, etc., can solve the problem of increasing the time cost of the mutation testing process, reducing the efficiency and success rate of mutation testing, and unable to program the mutation location Mutation and other issues to achieve the effect of reducing redundant variants, reducing the generation of invalid variants, and improving accuracy

Inactive Publication Date: 2019-01-15
EAST CHINA NORMAL UNIV
View PDF2 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, most of the mutation operators of existing mutation testing tools (muJava, Pit, etc.) are general-purpose operators, and the symbol type detection is used to detect the data type of the code statement to be mutated and use the corresponding mutation operator, which is suitable for most Java projects , but if it is directly applied to the Android project, it will increase the time cost of the mutation testing process and bring more workload
Since the development of Android applications requires developers to master a lot of preparatory knowledge, which is not within the scope of traditional mutation tools, the existing mutation operators are also unable to find suitable program mutation positions in Android applications for mutation.
The above reasons eventually lead to the mutation process to generate a large number of stillborn mutants (Stillborn Mutants, mutants that cannot be compiled) and trivial mutants (Trivial Mutants, mutants that crash at startup): developers for a specific context (such as multiple Thread-triggered context environment code) code mutation, the existing mutation operator is difficult to give a sufficiently accurate program mutation location for mutation testing, and the application of operators in untargeted code segments will inevitably result in a large number of invalid variants, and the large scale of the variants makes it difficult for software testers to quickly discover possible test set problems, which directly affects the effect of mutation testing
In short, providing a method of mutation testing that can be directly applied to Android applications and provide multi-threaded context-dependent mutations while reducing the efficiency and success rate of mutation testing is a problem that cannot be solved by current mutation techniques.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A mutation testing method based on Android multithreaded data dependency
  • A mutation testing method based on Android multithreaded data dependency
  • A mutation testing method based on Android multithreaded data dependency

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0033] In this embodiment, take the following section of the source code P to be tested with multi-thread calling as an example:

[0034]

[0035] When analyzing the APK, the data flow diagram of the variable rowIds in the 19th line statement in P will be obtained, which contains code lines 12, 13, 14, and 19; then this method will analyze the abstract syntax tree of the source code P, and analyze Line 16 is the multi-thread trigger position of the Thread type; combined with the data flow diagram and the abstract syntax tree, the data-dependent statement chain of the 16-line statement in this type of file is obtained, including 12, 13, and 14; then traverse the statement chain, if it is found to be The for statement uses the FLR operator to generate variants, for example, for(int i=0; i<cityCount; i++) is mutated into for(int i=1; i<cityCount; i++).

[0036] Mutation testing stage, the input of this stage is the mutation generated by the previous stage, and a pre-defined se...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a mutation test method based on Android multithreaded data dependence, which can accurately generate mutants related to multithreaded data dependence, reduce the generation rate of invalid mutants, and improve Android multithreaded mutation test efficiency. The method comprises two stages of variant generation and variant testing. In the variant generation phase, the Android application program (hereinafter referred to as APK file) is analyzed to obtain the data stream information. The source code file of Android application is parsed by abstract syntax tree and symboltype, and the trigger position of multi-thread in the program is obtained. Analyzing the context code of the trigger position to get the mutable position; data type analysis of mutation position is carried out and mutation operator is applied to generate mutant which is dependent on multithreaded data. In the variant testing phase, each variant is compiled and the APK file generated is run to select the appropriate variant program. Applying test cases to valid variant APK files and recording test results.

Description

technical field [0001] The invention belongs to the technical field of software testing, and relates to a variation testing method based on Android multi-thread data dependence. Background technique [0002] "Mutation Testing" (Mutation Testing) is a software testing method. This test method is to change some statements in the source code according to the defined mutation operators (Mutation Operators) and check whether the test case can find errors, thereby verifying and improving the effectiveness of the test set, which is often used in unit testing. In the mutation process, the selection of the mutation operator is crucial, and it will directly affect the effectiveness of the mutation test to detect test cases. However, most of the mutation operators of existing mutation testing tools (muJava, Pit, etc.) are general-purpose operators, and the symbol type detection is used to detect the data type of the code statement to be mutated and use the corresponding mutation opera...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
CPCG06F11/3684G06F11/3688
Inventor 徐立华刘剑袁宇杰贺樑
Owner EAST CHINA NORMAL UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products