@@ -160,12 +160,12 @@ public static void runMutAPK(String[] args) throws NumberFormatException, FileNo
160160
161161 // Check Dead Code Methods
162162
163- // for(Entry<String, HashMap<String, CallGraphNode>> entry : deadCode.entrySet()) {
164- // System.out.println(entry.getKey());
165- // for(Entry<String, CallGraphNode> entryy : entry.getValue().entrySet()) {
166- // System.out.println(" "+entryy.getKey());
167- // }
168- // }
163+ // for(Entry<String, HashMap<String, CallGraphNode>> entry : deadCode.entrySet()) {
164+ // System.out.println(entry.getKey());
165+ // for(Entry<String, CallGraphNode> entryy : entry.getValue().entrySet()) {
166+ // System.out.println(" "+entryy.getKey());
167+ // }
168+ // }
169169
170170 // Prune ASTs
171171 for (Entry <String , SmaliAST > entry : smaliASTs .entrySet ()) {
@@ -208,11 +208,6 @@ public static void runMutAPK(String[] args) throws NumberFormatException, FileNo
208208 System .out .println (list .size () + " | " + mutationType );
209209 }
210210
211- // Check if the amount of PFLocations is lower than the requested by the user
212- if (totalMutants < amountMutants ) {
213- throw new MutAPKException ("The total of mutants need to be greater than the amount of mutants asked" );
214- }
215- System .out .println ("" );
216211
217212 // Build MutationLocation List
218213 List <MutationLocation > mutationLocationList = MutationLocationListBuilder .buildList (locations );
@@ -221,47 +216,49 @@ public static void runMutAPK(String[] args) throws NumberFormatException, FileNo
221216 System .out .println ();
222217 System .out .println ("--------------------------------------" );
223218
224- // Select Selector
225- switch (selectionStrategy ) {
226- case AMOUNT_MUTANTS_SS :
227- SelectorAmountMutantsMethod selectorAmountMutantsMethod = new SelectorAmountMutantsMethod ();
228- SelectorAmountMutants selectorAmountMutants = new SelectorAmountMutants (false , false , totalMutants ,
229- amountMutants );
230- mutationLocationList = selectorAmountMutantsMethod .mutantSelector (locations , selectorAmountMutants );
231- break ;
232- case REPRESENTATIVE_SUBSET_SS :
233- SelectorConfidenceInterval selectorConfidenceInterval = new SelectorConfidenceInterval (true , false ,
234- totalMutants , isRSPerOPerator , confidenceLevel , marginError );
235- SelectorConfidenceIntervalMethod CIMS = new SelectorConfidenceIntervalMethod ();
236- mutationLocationList = CIMS .mutantSelector (locations , selectorConfidenceInterval );
237- break ;
238- default :
239- break ;
240- }
241- System .out .println ("" );
219+ if (ignoreDeadCode ) {
220+ // Select Selector
221+ switch (selectionStrategy ) {
222+ case AMOUNT_MUTANTS_SS :
223+ SelectorAmountMutantsMethod selectorAmountMutantsMethod = new SelectorAmountMutantsMethod ();
224+ SelectorAmountMutants selectorAmountMutants = new SelectorAmountMutants (false , false , totalMutants ,
225+ amountMutants );
226+ mutationLocationList = selectorAmountMutantsMethod .mutantSelector (locations , selectorAmountMutants );
227+ break ;
228+ case REPRESENTATIVE_SUBSET_SS :
229+ SelectorConfidenceInterval selectorConfidenceInterval = new SelectorConfidenceInterval (true , false ,
230+ totalMutants , isRSPerOPerator , confidenceLevel , marginError );
231+ SelectorConfidenceIntervalMethod CIMS = new SelectorConfidenceIntervalMethod ();
232+ mutationLocationList = CIMS .mutantSelector (locations , selectorConfidenceInterval );
233+ break ;
234+ default :
235+ break ;
236+ }
237+ System .out .println ("" );
242238
243- System .out .println ("## Mutation Process Log" );
244- System .out .println ();
245- System .out .println ("```sh" );
239+ System .out .println ("## Mutation Process Log" );
240+ System .out .println ();
241+ System .out .println ("```sh" );
246242
247- // Execute mutation phase
248- MutationsProcessor mProcessor = new MutationsProcessor ("temp" , appName , mutantsFolder );
243+ // Execute mutation phase
244+ MutationsProcessor mProcessor = new MutationsProcessor ("temp" , appName , mutantsFolder );
249245
250- // Create de apkhash for the base folder
251- File manifest = new File (apkAbsolutePath + File .separator + "AndroidManifest.xml" );
252- File smali = new File (apkAbsolutePath + File .separator + "smali" );
253- File resource = new File (apkAbsolutePath + File .separator + "res" );
246+ // Create de apkhash for the base folder
247+ File manifest = new File (apkAbsolutePath + File .separator + "AndroidManifest.xml" );
248+ File smali = new File (apkAbsolutePath + File .separator + "smali" );
249+ File resource = new File (apkAbsolutePath + File .separator + "res" );
254250
255251
256- // Create ApkHashSeparator
257- ApkHashSeparator apkHashSeparator = mProcessor .generateApkHashSeparator (manifest , smali , resource , 0 );
258- // Add the base apkHashSeparator
259- ApkHashOrder .getInstance ().setApkHashSeparator (apkHashSeparator );
252+ // Create ApkHashSeparator
253+ ApkHashSeparator apkHashSeparator = mProcessor .generateApkHashSeparator (manifest , smali , resource , 0 );
254+ // Add the base apkHashSeparator
255+ ApkHashOrder .getInstance ().setApkHashSeparator (apkHashSeparator );
260256
261- if (multithread ) {
262- mProcessor .processMultithreaded (mutationLocationList , extraPath , apkName );
263- } else {
264- mProcessor .process (mutationLocationList , extraPath , apkName );
257+ if (multithread ) {
258+ mProcessor .processMultithreaded (mutationLocationList , extraPath , apkName );
259+ } else {
260+ mProcessor .process (mutationLocationList , extraPath , apkName );
261+ }
265262 }
266263
267264 }
0 commit comments