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

fixing automatic test generation #16

Open
andrewbutterfield opened this issue Jan 17, 2023 · 7 comments
Open

fixing automatic test generation #16

andrewbutterfield opened this issue Jan 17, 2023 · 7 comments
Assignees

Comments

@andrewbutterfield
Copy link
Owner

Currently this relies on putting config data into Promela comments.

This should be moved to YAML files

@andrewbutterfield
Copy link
Owner Author

Step 1:
Replace .pml files whose only content is a comment with XML-like stuff inside with .yml file
Then remove comment_filter

@andrewbutterfield
Copy link
Owner Author

As side-effect of this will be to remove any remaining Coconut, so I plan to close #15 now.

@andrewbutterfield
Copy link
Owner Author

Need to go through other coconut sources to see what dependencies are.
See what is using comment filter stuff

GH-James added a commit that referenced this issue Mar 19, 2023
This enables automatic test generation using yml configuration instead of xml-like promela comments
GH-James added a commit that referenced this issue Mar 20, 2023
This still requires some promela markup-like language to avoid errors (lines 19, 75, 84 of testsuites_spfreechain01.yml)
I havent found where that is being parsed out
@GH-James
Copy link
Collaborator

GH-James commented Mar 20, 2023

I've been working based on the model in proto/freecchain-src/

There are 2 refine files which seem to use different methods for refinement, as well as have different resulting c test files

  • proto/freecchain-src/refine_validation/testsuites_spfreechain.rfn
  • proto/freecchain-src/refine_sptests/testsuites_spfreechain.rfn

The first appears to work more similarly to the methods im familiar with
It seems to be based on prints in the trail beginning with @@@
It generates test code as in attached: generated_c_method_1.txt

Im unsure how the second method works/what it intends to do.
It generates test code as in attached: generated_c_method_2.txt

If method 1 produces code as is required, that will make creating config files much more similar to the testbuilder process.
generated_c_method_2.txt
generated_c_method_1.txt

@GH-James
Copy link
Collaborator

Following from this, if we want code such as in generated_c_method_1.txt I would be much more confident converting remaining promela config files into yaml.

Assuming I can do the above, I wonder if it would make sense to remove the ability to pass in promela-comment-syntax config files, and only allow yaml files?
It may allow for some further code cleanup.

@andrewbutterfield
Copy link
Owner Author

They both seem a but of a mix from my perspective, and would need some modificaiton downstream.

Focus on method 1 for now, and only allow yaml files for config (does that affect method 2)

@GH-James
Copy link
Collaborator

It would affect method 2 as far as I can tell.

The promela comment/annotation language allows multiple keys with the same value, while yaml does not.

eg

no_annotation_at \<open>show_chain0\<close>
no_annotation_at\<open>show_chain1\<close>

I made an equivalent, which I'm not fond of that basically becomes

dict:
- no_annotation_at: show_chain0
- no_annotation_at: show_chain1

The full original refine_sptests/testsuits_spfreechain.rfn and attempted yaml equivalent refine_sptests/testsuits_spfreechain.yml were added in commit: 322f76f on the AutomaticTestGeneration branch.

The parsed object is quite unusual, and although I believe the yaml generates the equivalent parsed object of the promela annotation, the c files are silently not generated.

Thus far, the limitation of yaml files only appears to affect method 2.

GH-James added a commit that referenced this issue Apr 1, 2023
This removes any coconut usage in automatic test generation
Currently only generates pml files with relevant negations
Requires refactoring, config, and test generation
GH-James added a commit that referenced this issue Apr 6, 2023
Un-nest unncecessary nested functions
GH-James added a commit that referenced this issue Apr 6, 2023
Significant refactoring
GH-James added a commit that referenced this issue Apr 6, 2023
Removed cons_pair and dest_pair lambdas
GH-James added a commit that referenced this issue Apr 6, 2023
Added dataclass to replace nested tuples containing program parts
GH-James added a commit that referenced this issue Apr 10, 2023
…tbuilder.py #16

automatic_testgen_template.yml
- generate promela files
- generate spin files
- generate test files
- clean
- compile
- run
GH-James added a commit that referenced this issue Apr 11, 2023
…estbuilder.py #16

- tested genpmls, spin, gentests, clean commands
- added archive, copy commands
- removed run command, should be handled by testbuilder?
- added automatic_testgen.help
- added local and global config similar to testbuilder.py
- commands can run from any directory
GH-James added a commit that referenced this issue Apr 11, 2023
Issue only occured when Init contains an assertion
Was processed as Proctype, and format as
```
Assert[0] proctype init(args){
...
}
```
in output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants