Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epas for apis #1

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
07cd59a
Update .gitignore
CTarzia Dec 23, 2023
4e868b3
bring progress from wrong repo
Dec 3, 2023
595d236
started enableddto
CTarzia Dec 23, 2023
2a798f3
bring progress from wrong repo
Dec 3, 2023
c14f7f7
started enableddto
CTarzia Dec 23, 2023
77b1a2b
Delete EPASampler.kt
CTarzia Dec 23, 2023
29dab78
skip endpoints check
CTarzia Dec 23, 2023
6825415
enabled actions visible in solution!!
CTarzia Jan 3, 2024
08dd10d
renamed dtos, added epa graph classes
CTarzia Jan 10, 2024
7e58a9f
epa writing + improvements
CTarzia Jan 10, 2024
3777c0c
progress in epa construction
CTarzia Jan 10, 2024
ec58995
epas andando y lindoossss
CTarzia Jan 17, 2024
047ded9
refactor
CTarzia Jan 17, 2024
8010fb9
cleanup
CTarzia Jan 17, 2024
db86bfe
code cleanup
CTarzia Jan 17, 2024
2f4fcdb
removed endpointforenablementinfo
CTarzia Jan 17, 2024
8894496
add epa calculation config + undid unwanted changes
CTarzia Jan 19, 2024
86d2c8e
updated docs and configs
CTarzia Jan 19, 2024
dd11948
improved epa generation
CTarzia Jan 21, 2024
52fce43
added heuristicsforepa
CTarzia Jan 21, 2024
d204908
fix imports
CTarzia Jan 22, 2024
76ca606
undo unwanted changes
CTarzia Jan 22, 2024
79963ff
made evaluatedindividual.results private
CTarzia Jan 22, 2024
d0ca40e
private results
CTarzia Jan 22, 2024
8e525bf
Added config check
CTarzia Jan 23, 2024
111dae3
add log for epa and interesting epas
CTarzia Jan 25, 2024
067e6d0
added config
CTarzia Jan 26, 2024
ce5241e
Merge branch 'master' into epas-for-apis
CTarzia Jan 26, 2024
192c063
update docs
CTarzia Jan 26, 2024
684c83c
Merge branch 'master' into epas-for-apis
CTarzia Feb 1, 2024
01475dd
created kotlin objects for restactions and small updates
CTarzia Feb 1, 2024
5e21b1f
added newline in epa generation
CTarzia Feb 2, 2024
fd10f4d
fixed epa generation
CTarzia Feb 4, 2024
383ae86
Merge branch 'master' into epas-for-apis
CTarzia Feb 4, 2024
d456bfc
fixed epa generation again
CTarzia Feb 5, 2024
2807090
Merge branch 'master' into epas-for-apis
CTarzia Feb 5, 2024
5831bf5
update isInitial when generating epa
CTarzia Feb 5, 2024
d730bf6
undo changes in evaluatedindividual
CTarzia Feb 5, 2024
e8a7424
move .dot generation from epa to epawriter
CTarzia Feb 6, 2024
4774d81
improved EpaWriter
CTarzia Feb 6, 2024
79bcd75
renamed PreviousEnabledEndpoints -> EnabledEndpointsBeforeAction
CTarzia Feb 6, 2024
2ff0e00
renamed variables
CTarzia Feb 6, 2024
534c9f9
Merge branch 'master' into epas-for-apis
CTarzia Feb 10, 2024
30c99db
Merge branch 'master' into epas-for-apis
CTarzia Feb 17, 2024
5fd0c97
Merge branch 'master' into epas-for-apis
CTarzia Feb 19, 2024
f7cbd71
added sorted and print node info
CTarzia Feb 20, 2024
57f8d6c
fix edge count
CTarzia Feb 20, 2024
d6985da
temporary changes
CTarzia Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add epa calculation config + undid unwanted changes
  • Loading branch information
CTarzia committed Jan 22, 2024
commit 8894496307ad024cba6208c097b71e5c461ae844
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public RestProblem(String openApiUrl, List<String> endpointsToSkip) {
this(openApiUrl, endpointsToSkip, null);
}


/**
*
* @param openApiUrl Provide the URL of where the OpenAPI schema can be found.
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/kotlin/org/evomaster/core/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ class Main {
writeCoveredTargets(injector, solution)
writeTests(injector, solution, controllerInfo)
writeStatistics(injector, solution) //FIXME if other phases after search, might get skewed data on 100% snapshots...
writeEPA(solution)
if (config.epaCalculation) {
writeEPA(solution)
}

val statistics = injector.getInstance(Statistics::class.java)
val data = statistics.getData(solution)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ object RestActionBuilderV3 {
return dtoSchemas.map { dtoCache[it]!!.copy() }
}


private fun handleOperation(
actionCluster: MutableMap<String, Action>,
verb: HttpVerb,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ abstract class AbstractRestFitness<T> : HttpWsFitness<T>() where T : Individual
val rcr = RestCallResult()
actionResults.add(rcr)

if(actionResults.size == 1) { //it's the first action
if(config.epaCalculation && actionResults.size == 1) { //it's the first action
handleInitialEnabledEndpoints(rcr)
}

Expand Down Expand Up @@ -506,8 +506,10 @@ abstract class AbstractRestFitness<T> : HttpWsFitness<T>() where T : Individual
else -> throw e
}
}
handleEnabledEndpoints(rcr, a)
rcr.setStatusCode(response.status)
if (config.epaCalculation) {
handleEnabledEndpoints(rcr, a)
rcr.setStatusCode(response.status)
}

handlePossibleConnectionClose(response)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ abstract class AbstractRestSampler : HttpWsSampler<RestIndividual>() {
}

actionCluster.clear()

val skip = EndpointFilter.getEndpointsToSkip(config, swagger, infoDto)
RestActionBuilderV3.addActionsFromSwagger(swagger, actionCluster, skip, RestActionBuilderV3.Options(config))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ class Archive<T> where T : Individual {
In case of same, then look at the extra heuristics.
If all the same, then do prefer shorter tests.
*/

list.sortWith(compareBy<EvaluatedIndividual<T>>
{ it.fitness.getHeuristic(target) }
.thenComparator { a, b -> a.fitness.compareExtraToMinimize(target, b.fitness, config.secondaryObjectiveStrategy) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ abstract class SearchAlgorithm<T> where T : Individual {
writeTestsSnapshot(partialSolution, lastSnapshot.toString())
}
}

handleAfterSearch()

return archive.extractSolution()
Expand Down