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

Add POST monkey testing #6

Open
morris opened this issue Feb 2, 2017 · 1 comment
Open

Add POST monkey testing #6

morris opened this issue Feb 2, 2017 · 1 comment

Comments

@morris
Copy link
Contributor

morris commented Feb 2, 2017

Notes:

  • POSTs are possibly destructive
  • A whitelist of hosts may be beneficial to prevent running POST monkey tests against a production environment
@morris morris added the v2 label Jul 19, 2017
@morris
Copy link
Contributor Author

morris commented Jul 19, 2017

v2 will focus on more intelligent monkey testing. Payload/body generation in POST and PUT is quite involved:

  1. Payloads may be generated by traversing a schema and randomly using memorized properties.
  2. Properties may be generated by inspecting its type and name and randomly generating value (e.g. dates, person names, etc.).
  3. Payloads can be derived from known request-response pairs and examples.
  4. Array lengths are hard to determine.
  5. Tree structure depth must be limited and is also hard to determine.
  6. Payload data is often coupled, so (1) and (2) probably have low chances of generating business-valid payloads.

First attempt may look something like this:

  1. Randomly select a memorized object similar to the parameter schema*. Prefer examples.
  2. If none is found, start with an empty object.
  3. Generate missing properties by using memorized properties, randomly.
  4. Generate missing properties by using random properties generated from name/type.
  5. For missing inner objects and arrays, descend.
  6. Use random array lengths of 0-5.
  7. Limit tree depth to 5.

(*) Here we'll need some sort of JSON structural diff. It should compare all keys and sub-keys, but ignore values and order.

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

1 participant