You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, SAGE does not have any tests. Below are some ideas for potential test cases.
Regression tests
Keep the "ground truth" version of the attack graphs (the dot files). Before every merge to main, run the new implementation and compare the AGs to the "ground truth". An example using the scripts from my Research Project repository:
In this test file, AGs are compared with the "ground truth" based on the nodes and edges present (diff-ags.sh) and node stats (stats-nodes-ags.sh), and the episode traces passed to FlexFringe are also compared with the "ground truth".
This would be very useful for PRs related to refactoring and changing minor parts of the code that do not affect the resulting AGs.
The disadvantage, however, is that the "ground truth" files will have to be updated if the AGs change. On the other hand, the graphs can be compared to the latest SAGE version on the main branch.
Sinks in FlexFringe vs sinks in AGs
As mentioned in #14, sinks in AGs can be compared with the sinks in the json files generated by FlexFringe. Here no "ground truth" is necessary as FlexFringe output (the S-PDFA) is taken as the "ground truth".
_get_episodes method has test cases for episode creation that are commented out. A better solution would be to move these commented tests into a separate test file
Cutting episode sequences
Cutting episode sequences into episode subsequences could also potentially be tested.
Episode sequences vs state sequences
Depending on whether implementation allows this or not, episode sequences could be compared with state sequences for consistency.
The text was updated successfully, but these errors were encountered:
Currently, SAGE does not have any tests. Below are some ideas for potential test cases.
Regression tests
Keep the "ground truth" version of the attack graphs (the dot files). Before every merge to
main
, run the new implementation and compare the AGs to the "ground truth". An example using the scripts from my Research Project repository:In this test file, AGs are compared with the "ground truth" based on the nodes and edges present (
diff-ags.sh
) and node stats (stats-nodes-ags.sh
), and the episode traces passed to FlexFringe are also compared with the "ground truth".This would be very useful for PRs related to refactoring and changing minor parts of the code that do not affect the resulting AGs.
The disadvantage, however, is that the "ground truth" files will have to be updated if the AGs change. On the other hand, the graphs can be compared to the latest SAGE version on the
main
branch.Sinks in FlexFringe vs sinks in AGs
As mentioned in #14, sinks in AGs can be compared with the sinks in the
json
files generated by FlexFringe. Here no "ground truth" is necessary as FlexFringe output (the S-PDFA) is taken as the "ground truth".Episode generation
_get_episodes
method has test cases for episode creation that are commented out. A better solution would be to move these commented tests into a separate test fileCutting episode sequences
Cutting episode sequences into episode subsequences could also potentially be tested.
Episode sequences vs state sequences
Depending on whether implementation allows this or not, episode sequences could be compared with state sequences for consistency.
The text was updated successfully, but these errors were encountered: