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

TAP 7: Add return code rationale #40

Merged

Conversation

awwad
Copy link
Contributor

@awwad awwad commented Jun 5, 2017

I added a very brief blurb in the TAP on why we're going with two expected return values (from the Wrapper's `updateinstead of many. Here's more of my thinking, for reference. Also caught in this PR are two minor cleaning edits in commit e5c9921.

Argument 1: We don't need specific error codes.
I can't think of a case where we actually need specific error codes to test behavior. We're testing updaters, so we can always ask the question "Did it update without manipulation X and not update with manipulation X?"

Argument 2: Many error codes may be onerous.
To demand that an updater issue distinct errors that percolate up through the code may be an onerous requirement on an implementer, and we want people to not hesitate to use the conformance tester. I'd rather we do extra work in one place to construct good test cases than every implementer work to adapt their updaters to issue error codes that exactly match our expectations.

Argument 2.5: Many error codes encourages test mode divergence from live code.
While test mode could be required for some implementations, the more logic we demand of it, the further it could drift from their live, production code. In the ideal solution, a Wrapper module is thin and it is possible to have conformance tests run with every build of live code, but that can only work if we can test live code or test with only minimal modifications, preferably contained in a static Wrapper module.

Argument 3: Many error codes requires detailed and precise specification of behavior.
The expected behavior if an updater contacts one mirror with invalid metadata and one mirror with valid metadata is simply to update, right? Even the reference implementation throws errors from other mirrors away if one mirror works out. Is that what we expect, or do we expect to get an array of responses per mirror?
A dictionary of responses per mirror means we're specifying that format. It's one more hoop for implementers to jump through.
In the absence of a successful update from one mirror, it might be perfectly sensible for a given Updater not to protest if it finds invalid metadata, but just not accept it and try again a few times or contact the most authoritative source.
I'm sure there would be debates about which error code is more appropriate in a particular scenario.

tap7.md Outdated
threshold number of signatures, etc.) in order to simplify work for Updater
implementers. This will entail more test and control cases, but should make it
easier for implementers to use the Conformance Tester without having to make
substantial changes to Updaters or having to too much extra work in writing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One too many to too ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@vladimir-v-diaz vladimir-v-diaz self-assigned this Jun 5, 2017
Copy link
Contributor

@vladimir-v-diaz vladimir-v-diaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vladimir-v-diaz vladimir-v-diaz merged commit 47c9dc1 into theupdateframework:master Jun 5, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants