FEAT is a unified framework to evaluate the Android automated testing techniques.
FEAT allow the users to access their automated testing techniques by implement some interface. So far, we access three three automated techniques which have good compatibility:
- Monkey
- AppCrawler
- Appium
Given an Android app source code, you can use FEAT will instrument and compile it, then use the techniques have been accessed to test it, for evaluate the techniques.
- Recommand to use in Java after 1.7
- Maven is needed
- The configuration of the techniques you want to use is needed.
- cd to /FEAT/lib and 'sudo chmod 777 aapt' to give permissions for 'aapt' to extract the apk file.
2.When use Appium, you should add the Appium script into FEAT.jar
1. rename the testing srcipt to Main.java
2. move it into package FEAT.AppiumTestCode
3. execute: mvn install:install-file -Dfile=lib/apkUtil-1.0.jar -DgroupId=apkUtil -DartifactId=apkUtil -Dversion=1.0 -Dpackaging=jar
4. execute: mvn assembly:assembly and use the new jar file
3.If you want to use mutation testing, you should confirm that: After insturmentation, your app Project can create to an apk success. In other word, try to create apk file once.
- ExecutionConfig.txt need to fill in.
AppDir
means the relative path of the main module of these projects. In general, it is "/app"SourceCodeDir
means the relative path of java code in the main module. In general it is "/app/src/main/java"ClassesDir
means the relative path of class file of this project. In general it is "/app/build/intermediates/classes"ReportDir
means the path of report created. In general, it is not need to modify.ApkCreatePath
means the relative path of the Android application package that created. In general, it is "/app/build/outputs/apk/app-debug.apk"
In the next version, we will automated acquire these information.
The runnable jar can be found in: FEAT-code-public/FEAT.jar
To run FEAT, you should use the following command, and specifying the required arguments:
Instrumentation:
java -jar FEAT.jar I <AppProjrctDir> <AppPackageName>
Mutation create:
java -jar FEAT.jar MC <AppProjrctDir> <AppPackageName> <OutDir>
Automated testing techniques:
java -jar FEAT.jar T <AppProjrctDir> <AppPackage> <OutDir> <ToolName> [special parameters]
Provide the following list of required arguments when running FEAT:
AppProjrctDir
: path of the app project;AppPackage
: path of the apk which used to do the testing;AppPackageName
: App main package name;OutDir
: path to output the testing result;ToolName
: Name of the automated testing tools. Only need when use automated tesing tools; [special parameters]:RunScript
: path of the scripts which control the automated testing tools. Only need when use automated tesing tools;ToolDir
: path of the dir to store automated testing tools. Only need when use automated tesing tools; The other arguments of FEAT should be complete by editing theAppdirConfig.txt
file andPointConfig.txt
file. The formal is used to set the related information of app structure, the latter is used to set the score rule.
Instrumentation:
java -jar FEAT.jar I /Trial/memetastic io.github.gsantner.memetastic
Mutation create:
java -jar FEAT.jar MC /Trial/memetastic io.github.gsantner.memetastic /outputs/memetastic
Appium:
java -jar FEAT.jar T /Trial/memetastic /Trial/memetastic.apk /outputs/memetastic Appium
Monkey:
java -jar FEAT.jar T /Trial/memetastic /Trial/memetastic.apk /outputs/memetastic Monkey Commands/linux/monkey.sh
AppCrawler:
java -jar FEAT.jar T /Trial/memetastic /Trial/memetastic.apk /outputs/memetastic AppCrawler Commands/linux/appcrawler.sh /automatorTools
The output directory will contain a folder for each techniques in each mobile devices in the output path you send in.
- Only can use in Linux now, we wll add windows compatibility in the future.
- Enhanced exception remove duplicates
- Find new method to detect mutation is killed or not(by coverage ratio now)