autowebcompat icon indicating copy to clipboard operation
autowebcompat copied to clipboard

Instead of randomly choosing an element to interact with, choose all possible elements

Open marco-c opened this issue 7 years ago • 7 comments

Currently, we are choosing elements to interact with in a random fashion. Instead, we should explore all possible paths (up to a maximum level that we need to decide).

marco-c avatar Feb 08 '18 14:02 marco-c

does it mean that we have to interact with all elements which are present in the website and get rid of the usage of random.shuffle() from collect.py?

marxmit7 avatar Feb 09 '18 09:02 marxmit7

Yes, probably a depth-first search with a limit on the number of nodes (and instead of backtracking, restart from the beginning).

marco-c avatar Feb 09 '18 10:02 marco-c

@marco-c I want to work on this issue! What should be the maximum level?

sagarvijaygupta avatar Feb 16 '18 17:02 sagarvijaygupta

Currently it's 7, let's see if that works for this new approach too. Ideally define it in a global variable at the beginning of collect.py (e.g. MAX_INTERACTION_DEPTH = 7).

marco-c avatar Feb 17 '18 00:02 marco-c

@marco-c I started working on this issue. According to the naming convention that is being followed it won't be possible to implement the given idea. Also the text file generated will have to be changed accordingly for a given bug. Any naming convention you would prefer? For the text file I was thinking to make it like a tree. Something like this.

elem_attributes:
    elem_attributes:
          elem_attributes:
    elem_attributes:
          elem_attributes:
                elem_attributes:
          elem_attributes:
                elem_attributes:
                      elem_attributes:

And naming convention for images to be of type WEBCOMPATID_lineNumberOfStep1_lineNumberOfStep2_lineNumberOfStep3_....._browser.png where lineNumber is the line number in the text file.

sagarvijaygupta avatar Feb 20 '18 06:02 sagarvijaygupta

Regarding the text file, there are three options:

  1. The solution you proposed;
  2. Write a separate text file for each tree;
  3. Write a tree after another in the text file, separated via a newline:
elem_attributes1
elem_attributes2
elem_attributes3

elem_attributes1
elem_attributes2
elem_attributes4
elem_attributes5

The name of the screenshot can either be: WEBCOMPATID_lineNumberOfStep1_lineNumberOfStep2_lineNumberOfStep3_..._browser.png or: WEBCOMPATID_treeNumber_stepNumberInTree_browser.png

Feel free to choose the solution you prefer, whatever you find simpler between these.

Note that #62 will probably land before the PR fixing this, so you have to take into account that code too.

marco-c avatar Feb 20 '18 09:02 marco-c

Reopened as we need to have a script to migrate the old data to the new naming scheme.

marco-c avatar Jul 30 '18 18:07 marco-c