TESTARtool / TESTAR_dev

TESTAR, automated testing through the Graphical User Interface
http://www.testar.org
BSD 3-Clause "New" or "Revised" License
37 stars 24 forks source link

State Model UnvisitedActions does not consider that a new sequence starts #325

Closed ferpasri closed 1 year ago

ferpasri commented 1 year ago

ImprovedUnvisitedActionSelector

Calculates a executionPath of actions to navigate the abstract model to reach and execute an unvisited action (A1 -> A2 -> A3 -> AU). TESTAR removes the first entry in every navigation step when moving to the desired unvisited action (executionPath.removeFirst()).

However, this path of actions could not be effective anymore if TESTAR completes the total number of actions executed and starts a new sequence, changing the current state and starting in the initial state.

Example with Notepad:

  1. The desired unvisited action is 3 clicks away executionPath(Format -> Font -> Accept)

  2. If TESTAR clicks Format, remove it from the list (Font -> Accept) and stop and start a new sequence.

  3. In the next initial state, the unvisited actions expect: executionPath(Font -> Accept) Click the Font button is the next action in the Notepad Initial State, but it is impossible.

Possible solution: A possible solution is to reset the executionPath when TESTAR starts a new sequence, then a new path of actions will be calculated from the initial state.

ModelManager

    @Override
    public void notifyTestSequencedStarted() {
        sequenceManager.startNewSequence();
        actionSelector.notifyNewSequence();
    }

ImprovedUnvisitedActionSelector

    @Override
    public void notifyNewSequence() {
        executionPath = new LinkedList<>();
        System.out.println("Reset State Model execution path due to new sequence starting");
    }
ferpasri commented 1 year ago

https://github.com/TESTARtool/TESTAR_dev/commit/f2611b9d31e0484086fc1566d0c04af61c3a7ee6#diff-d60cb53658d029553a251eef6e4c103aea35ab3bbef168e5acb18d3d25c49de3