cuberite / CuberitePluginChecker

Automated script for CI-checking Cuberite plugins
The Unlicense
3 stars 3 forks source link

Implement intelligent command fuzzing #15

Open madmaxoft opened 8 years ago

madmaxoft commented 8 years ago

Command fuzzing could be made much more intelligently:

  1. Execute a command with (unique) random parameters
  2. If the handler just outputs a message to the player, try to see if it contains the command name, if so, try to parse usage (number of parameters) from it, otherwise just retry a few times with a different count of parameters
  3. If the command handler accesses special APIs, take note which parameter is used for the API call and use a proper value for the next retry.
    • cRoot:GetWorld() -> the param is a world name
    • cWorld:GetPlayer(), cWorld:DoWithPlayer() -> the param is a player name
    • tonumber -> a number is expected for this param
  4. Retry a few times with params adjusted based on the heuristics in step 3.
NiLSPACE commented 8 years ago

Perhaps we can improve the Info.lua file to include the parameter combinations?

madmaxoft commented 8 years ago

That is a possibility, but that would be already a bit too "chatty" for a description file. If we can auto-detect the param usage, that should be enough.

It's still possible to test individual commands using the Scenario file's playerCommand action, after all.