Skip to content

Commit

Permalink
Improved usage information and added <repetitions>
Browse files Browse the repository at this point in the history
  • Loading branch information
icse19-FAST-R committed Jan 26, 2019
1 parent 2067515 commit 0dc7fd3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
22 changes: 18 additions & 4 deletions py/experimentAdequate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,34 @@
in the Adequate scenario and in all input test suite.
"""


usage = """USAGE: python3 py/experimentAdequate.py <coverageType> <program> <version> <repetitions>
OPTIONS:
<coverageType>: the target coverage criterion.
options: function, line, branch
<program> <version>: the target subject and its respective version.
options: flex v3, grep v3, gzip v1, make v1, sed v6, chart v0, closure v0, lang v0, math v0, time v0
<repetitions>: number of times the test suite reduction should be computed.
options: positive integer value, e.g. 50"""


if __name__ == "__main__":
if len(sys.argv) != 5:
print(usage)
exit()

SIR = [("flex", "v3"), ("grep", "v3"), ("gzip", "v1"), ("sed", "v6"), ("make", "v1")]
D4J = [("math", "v1"), ("closure", "v1"), ("time", "v1"), ("lang", "v1"), ("chart", "v1")]
script, covType, prog, v = sys.argv
script, covType, prog, v, rep = sys.argv
repeats = int(rep)

directory = "outputAdequate-{}/{}_{}/".format(covType, prog, v)
if not os.path.exists(directory):
os.makedirs(directory)
if not os.path.exists(directory + "selections/"):
os.makedirs(directory + "selections/")
if not os.path.exists(directory + "measures/"):
os.makedirs(directory + "measures/")

repeats = 50
os.makedirs(directory + "measures/")

# FAST parameters
k, n, r, b = 5, 10, 1, 10
Expand Down
23 changes: 19 additions & 4 deletions py/experimentBudget.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,27 @@
in the Budget scenario and in all input test suite.
"""


usage = """USAGE: python3 py/experimentBudget.py <coverageType> <program> <version> <repetitions>
OPTIONS:
<coverageType>: the target coverage criterion.
options: function, line, branch
<program> <version>: the target subject and its respective version.
options: flex v3, grep v3, gzip v1, make v1, sed v6, chart v0, closure v0, lang v0, math v0, time v0
<repetitions>: number of times the test suite reduction should be computed.
options: positive integer value, e.g. 50"""


if __name__ == "__main__":
if len(sys.argv) != 5:
print(usage)
exit()

SIR = [("flex", "v3"), ("grep", "v3"), ("gzip", "v1"), ("sed", "v6"), ("make", "v1")]
D4J = [("math", "v1"), ("closure", "v1"), ("time", "v1"), ("lang", "v1"), ("chart", "v1")]
script, covType, prog, v = sys.argv
script, covType, prog, v, rep = sys.argv
repetitions = int(rep)
repeats = 50

directory = "outputBudget-{}/{}_{}/".format(covType, prog, v)
if not os.path.exists(directory):
Expand All @@ -40,8 +57,6 @@
if not os.path.exists(directory + "measures/"):
os.makedirs(directory + "measures/")

repeats = 50

# FAST-R parameters
k, n, r, b = 5, 10, 1, 10
dim = 10
Expand All @@ -68,7 +83,7 @@ def one_(x): return 1

numOfTCS = sum((1 for _ in open(inputFile)))

for reduction in range(1, 30+1):
for reduction in range(1, repetitions+1):
B = int(numOfTCS * reduction / 100)

for run in range(repeats):
Expand Down
24 changes: 19 additions & 5 deletions py/experimentLargeScale.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@
in the Large-scale scenario and in all input test suite.
"""


usage = """USAGE: python3 py/experimentLargeScale.py <algorithm> <repetitions>
OPTIONS:
<algorithm>: the test suite reduction algorithm.
options: FAST++, FAST-CS, FAST-pw, FAST-all
<repetitions>: number of times the test suite reduction should be computed.
options: positive integer value, e.g. 50"""


if __name__ == "__main__":
if len(sys.argv) != 3:
print(usage)
exit()

ALGS = ["FAST++", "FAST-CS", "FAST-pw", "FAST-all"]
script, alg = sys.argv
script, alg, rep = sys.argv
repetitions = int(rep)

directory = "outputLargeScale/"
if not os.path.exists(directory):
Expand Down Expand Up @@ -56,7 +70,7 @@ def one_(x): return 1
numOfTCS = sum((1 for _ in open(inputFile)))

if alg == "FAST++":
for reduction in range(30):
for reduction in range(repetitions):
B = int(numOfTCS * reduction / 100)
pTime, rTime, sel = fastr.fastPlusPlus(inputFile, dim=dim, B=B, memory=False)
sOut = "{}/{}-{}.pickle".format(sPath, "FAST++", reduction+1)
Expand All @@ -67,7 +81,7 @@ def one_(x): return 1


if alg == "FAST-CS":
for reduction in range(30):
for reduction in range(repetitions):
B = int(numOfTCS * reduction / 100)
pTime, rTime, sel = fastr.fastCS(inputFile, dim=dim, B=B, memory=False)
sOut = "{}/{}-{}.pickle".format(sPath, "FAST-CS", reduction+1)
Expand All @@ -78,7 +92,7 @@ def one_(x): return 1


if alg == "FAST-pw":
for reduction in range(30):
for reduction in range(repetitions):
B = int(numOfTCS * reduction / 100)
pTime, rTime, sel = fastr.fast_pw(inputFile, r, b, bbox=True, k=k, memory=False, B=B)
sOut = "{}/{}-{}.pickle".format(sPath, "FAST-pw", reduction+1)
Expand All @@ -89,7 +103,7 @@ def one_(x): return 1


if alg == "FAST-all":
for reduction in range(30):
for reduction in range(repetitions):
B = int(numOfTCS * reduction / 100)
pTime, rTime, sel = fastr.fast_(
inputFile, all_, r, b, bbox=True, k=k, memory=False, B=B)
Expand Down

0 comments on commit 0dc7fd3

Please sign in to comment.