-
Notifications
You must be signed in to change notification settings - Fork 444
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
[p4Tools and p4Testgen] New exploration strategy for test generation #3566
Conversation
48ecec8
to
2007047
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, can not comment too much on the core algorithm.
/// path. | ||
using Callback = std::function<bool(const FinalState&)>; | ||
|
||
using Branch = ExplorationStrategy::Branch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redeclaring these types is not needed iirc.
@@ -84,11 +85,14 @@ int Testgen::mainImpl(const IR::P4Program* program) { | |||
auto symExec = [&solver, &programInfo, seed]() -> ExplorationStrategy* { | |||
std::string explorationStrategy = TestgenOptions::get().explorationStrategy; | |||
if (explorationStrategy.compare("randomAccessStack") == 0) { | |||
// If the user mistakenly specifies an invalid popLevel, we set it to 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also emit a warning here? For all these cases where the user is mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I was actually referring to the line below, which silently overrides the inputs.
d0ea5d5
to
ed3c770
Compare
backends/p4tools/testgen/testgen.cpp
Outdated
@@ -97,6 +104,14 @@ int Testgen::mainImpl(const IR::P4Program* program) { | |||
if (explorationStrategy.compare("maxCoverage") == 0) { | |||
return new IncrementalMaxCoverageStack(solver, *programInfo, seed); | |||
} | |||
if (explorationStrategy.compare("randomAccessMaxCoverage") == 0) { | |||
// If the user mistakenly sets and invalid saddlePoint, we set it to 5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If the user mistakenly sets and invalid saddlePoint, we set it to 5. | |
// If the user mistakenly sets an invalid saddlePoint, we set it to 5. |
} | ||
|
||
// If there's no element in bufferUnexploredBranches with the particular coverage | ||
// we calculate, we'll insert a new key at bufferUnexploredBranches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing dot, this time for real.
… random access max coverage [no-jira]
[no-jira]
[no-jira]
[no-jira]
5f0d047
to
8e6e97f
Compare
New exploration strategy combining random exploration and max coverage.
[no-jira]