diff --git a/README.md b/README.md index f61efff..aca0a53 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # GUI State Machine API +[![Build Status](https://travis-ci.com/retest/gui-state-machine-api.svg?branch=master)](https://travis-ci.com/retest/gui-state-machine-api) +[![Code Coverage](https://img.shields.io/codecov/c/github/retest/gui-state-machine-api/master.svg)](https://codecov.io/github/retest/gui-state-machine-api?branch=master) + API for the creation and modification of incomplete state machines which represent the exploration of a GUI application. The states represent the GUI elements and the transitions represent the GUI actions. This is a small code example of creating a new state machine, adding two states connected with a transition and saving the state machine: + ```scala import de.retest.guistatemachine.api.GuiStateMachineApi import de.retest.guistatemachine.api.GuiStateMachineSerializer @@ -23,11 +27,6 @@ GuiStateMachineSerializer.gml(stateMachine).save("mystatemachine.gml") State machines can be saved as and loaded from files using Java object serialization/deserialization. Besides, they can be saved as [GML](https://en.wikipedia.org/wiki/Graph_Modelling_Language) files which can be visualized by editors like [yEd](https://www.yworks.com/products/yed). -## Automatic Build with TravisCI - -[![Build Status](https://travis-ci.com/retest/gui-state-machine-api.svg?branch=master)](https://travis-ci.com/retest/gui-state-machine-api) -[![Code Coverage](https://img.shields.io/codecov/c/github/retest/gui-state-machine-api/master.svg)](https://codecov.io/github/retest/gui-state-machine-api?branch=master) - ## Build Credentials Define the Nexus password in the environment variable `TRAVIS_NEXUS_PW`. @@ -47,19 +46,19 @@ Otherwise, the build will fail! * `sbt 'release cross with-defaults'` to create a release with a new version number which is added as tag. This command does also publish the artifacts. * `sbt publish` publishes the artifacts in ReTest's Nexus. Requires a `$HOME/.sbt/.credentials` file with the correct credentials. This command can be useful to publish SNAPSHOT versions. -## NFA for the Representation of Tests +## NFA for the Representation of GUI Behavior -A nondeterministic finite automaton represents the states of the GUI during the test. -The actions executed by the user on the widgets are represented by transitions. -If an action has not been executed yet from a state, it leads to an unknown state. +A nondeterministic finite automaton (NFA) represents the states of the GUI during testing. +The actions executed by the user on GUI elements are represented by transitions. +If an action has not been executed yet from a state, it leads to the so-called unknown state *s?*. The unknown state is a special state from which all actions could be executed. -The NFA is based on the UI model from [Search-Based System Testing: High Coverage, No False Alarms](http://www.specmate.org/papers/2012-07-Search-basedSystemTesting-HighCoverageNoFalseAlarms.pdf) (section "4.5 UI Model"). -Whenever an unknown state is replaced by a newly discovered state, the NFA has to be updated. +Whenever an action, which previously led to *s?*, is being executed and then leads to a newly discovered state, the NFA has to be updated. + +The NFA is based on the UI model from ["Search-Based System Testing: High Coverage, No False Alarms"](http://www.specmate.org/papers/2012-07-Search-basedSystemTesting-HighCoverageNoFalseAlarms.pdf) (section "4.5 UI Model"). Originally, it has been used together with a genetic algorithm for search-based system testing, where it served two purposes: -The NFA is used to generate test cases (sequence of UI actions) with the help of a genetic algorithm. -For example, whenever a random action is executed with the help of monkey testing, it adds a transition to the state machine. -After running the genetic algorithm, the state machine is then used to create a test suite. +1. Population initialization: to give precedence to unexplored actions. +2. Mutation: to repair test cases. ## Concurrency -The creation and modification of state machines should be threadsafe. +The creation and modification of state machines should be thread-safe.