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

Write tests for new STIX 2.1 objects #80

Closed
emmanvg opened this issue Oct 11, 2017 · 5 comments
Closed

Write tests for new STIX 2.1 objects #80

emmanvg opened this issue Oct 11, 2017 · 5 comments
Assignees
Milestone

Comments

@emmanvg
Copy link
Contributor

emmanvg commented Oct 11, 2017

As we move forward with the new STIX 2.1 objects. He have to make sure they work as intended and also keep our code coverage scores in par.

@gtback gtback added this to the STIX 2.1 milestone Oct 11, 2017
@gtback gtback removed the stix2.1 label Oct 11, 2017
@emmanvg emmanvg self-assigned this Oct 18, 2017
@emmanvg
Copy link
Contributor Author

emmanvg commented Nov 2, 2017

Would it make sense to use some of the same tests to check STIX 2.1 aside from only adding tests for the new objects?

Some areas have potential to be extended using @parametrize and use it to create instances from X version.

@emmanvg
Copy link
Contributor Author

emmanvg commented Nov 2, 2017

It can help to keep coverage high. Recent local testing showed coverage lowering to 94%...

@emmanvg emmanvg removed their assignment Apr 23, 2018
@gtback
Copy link
Contributor

gtback commented Jun 18, 2018

Rather than how the current tests will test only the newest version of the objects, we should have separate tests for both the v20 and v21 objects.

@emmanvg
Copy link
Contributor Author

emmanvg commented Jul 3, 2018

I have been working on the STIX2.1 branch update. A problem that I see arising is the datastores. Essentially, anywhere we use parse() or Bundle() we need to make a decision on what version to call/use or re-visit the current approach.

Among the approaches, we can check the spec_version property for SDO/SROs since it is a required property for 2.1 and if not present it is implicitly 2.0. It may be a bit more challenging, but using a combination of that and checking the Bundle we might be able to figure out which version to use in the parse(obj, version='...') call when a Bundle is received in a datastore object.

Now, another issue is that internally we make use of the Bundle class in all three datastores. My initial though says that we should add another argument to specify in which version you want to serialize, but it may be the case we are working with SDOs/SROs of mixed spec versions. Thus, we should spend some time thinking on the best way to move forward with this.

This is just for awareness as I go through the code update... @gtback, @clenk, @mbastian1135

@gtback
Copy link
Contributor

gtback commented Jul 3, 2018

And here I was, thinking that supporting 2.0 and 2.1 at the same time wouldn't be that hard. ☹️

Thanks, @emmanvg . We'll need to think through this some more.

emmanvg added a commit that referenced this issue Jul 13, 2018
@emmanvg emmanvg modified the milestones: 2.0.0, 1.1.0 Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants