package Ġsa ar land . cis pa . tan ap uch . the sis Ċ Ċ import Ġjava . io . File Ċ import Ġjava . nio . file . Files ĊĊ Ċ class ĠAverage Formatting For Plot { Ċ Ċ } Ċ Ċ private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġfalse " Ċ // private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġtrue " Ċ // private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġfalse Ġadditional Ġaddress Ġbooks " Ċ // private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġtrue Ġadditional Ġaddress Ġbooks " Ċ // private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġtrue Ġrer un _ 3 _ apps " Ċ // private Ġval Ġcoverage FolderPath Ġ= ĠSystem . getProperty (" user . dir ") Ġ+ Ġ"\\ instrumentation - logs \\ RQ 3 _ coverage \\ 5 0 0 actions Ġtests Ġbi ased Ġtrue Ġrem ix " Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ ĊĊĠĠĠ Ġval Ġapk Name 1 Ġ= Ġ" com . e ley bo urn . book catalog ue " ĊĠĠĠ Ġval Ġapk Name 2 Ġ= Ġ" com . every car . android " ĊĠĠĠ Ġval Ġapk Name 3 Ġ= Ġ" com . k ay ak . android " ĊĠĠĠ Ġval Ġapk Name 4 Ġ= Ġ" com . lon ely planet . guides " ĊĠĠĠ Ġval Ġapk Name 5 Ġ= Ġ" com . mir k oo . apps . mis lib ros " ĊĠĠĠ Ġval Ġapk Name 6 Ġ= Ġ" com . address book " ĊĠĠĠ Ġval Ġapk Name 7 Ġ= Ġ" com . r akes h . address book " ĊĊĠĠĠ Ġavg Formatting For Plot ( apk Name 1 ) ĊĠĠĠ Ġ// avg Formatting For Plot ( apk Name 2 ) ĊĠĠĠ Ġavg Formatting For Plot ( apk Name 3 ) ĊĠĠĠ Ġ// avg Formatting For Plot ( apk Name 4 ) ĊĠĠĠ Ġavg Formatting For Plot ( apk Name 5 ) ĊĊĠĠĠ Ġavg Formatting For Plot ( apk Name 6 ) ĊĠĠĠ Ġavg Formatting For Plot ( apk Name 7 ) Ċ Ċ } ĊĊ Ċ fun Ġavg Formatting For Plot ( apk Name : ĠString , Ġinterval : ĠInt Ġ= Ġ 1 8 0 ){ ĊĊĠĠĠ Ġval Ġsai Gen _ disabled Ġ= Ġmutable ListOf < Float >() ĊĠĠĠ Ġval Ġsai Gen _ enabled Ġ= Ġmutable ListOf < Float >() ĊĊĠĠĠ ĠFile ( coverage FolderPath ). walk (). forEach Ġ{ Ġfile Ġ-> ĊĠĠĠĠĠĠĠ Ġif ( file . name . contains ("${ apk Name }_ avg Cov Over Time . txt ")){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcov Over Time Ġ= ĠFiles . read All Lines ( file . to Path ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif ( file . name . contains (" disabled ")){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcov Over Time . forEach { ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsai Gen _ disabled . add ( it . toFloat ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif ( file . name . contains (" enabled ")){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcov Over Time . forEach { ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsai Gen _ enabled . add ( it . toFloat ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( sai Gen _ disabled . size Ġ== Ġsai Gen _ enabled . size ){ ĊĠĠĠĠĠĠĠ Ġprintln (" Coverage ĠOver ĠTime Ġof Ġ${ apk Name } Ġw ti h Ġinterval : Ġ${ interval }") ĊĠĠĠĠĠĠĠ Ġprintln (" INTERVAL ĠSA IG EN - DISABLED ĠSA IG EN - ENABLED ") ĊĊĠĠĠĠĠĠĠ Ġval Ġsize Ġ= Ġsai Gen _ disabled . size ĊĠĠĠĠĠĠĠ Ġvar Ġi Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġwhile Ġ( i Ġ< Ġsize ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprintln ("${ ( i + 1 )* interval } Ġ${ sai Gen _ disabled [ i ]} Ġ${ sai Gen _ enabled [ i ]} ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġi ++ ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġprintln ("") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġout FileName Ġ= Ġcoverage FolderPath Ġ+ Ġ"\\ graph Formatted _${ apk Name }_ avg Cov Over Time . txt " ĊĠĠĠ ĠFile ( out FileName ). print Writer (). use Ġ{ Ġout Ġ-> ĊĠĠĠĠĠĠĠ Ġif Ġ( sai Gen _ disabled . size Ġ== Ġsai Gen _ enabled . size ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsize Ġ= Ġsai Gen _ disabled . size ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvar Ġi Ġ= Ġ 0 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwhile Ġ( i Ġ< Ġsize ){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġout . println ("${ ( i + 1 )* interval } Ġ${ sai Gen _ disabled [ i ]} Ġ${ sai Gen _ enabled [ i ]} ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġi ++ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }