Information Technology Reference
In-Depth Information
implementation must provide sufficient information to the tester otherwise the expres-
sive power of the testing language cannot be utilised.
For example, the Ruby/Watir framework uses the Internet Explorer's Component
Object Model (COM) interface to access objects of interest. However if the HTML
does not name the objects it is often difficult to pick the right object [16] and verify
its state. In object-oriented approaches information hiding can restrict the ability of a
tester to control and observe the state of the computation [2]. The implementation must
provide an interface which can be used to inspect the values of relevant variables in the
testing process.
In the present paper no particular testing language is assumed, though the constraints
just mentioned will play a deciding role.
3.2
Action Words
The approach taken here to linking the specification and implementation is that of 'ac-
tion words' due to Buwalda and Kasdorp [5,6]. It may be described, in the current
context, as follows.
The atomic input action pd ?: Pass is interpreted in the implementation as a succes-
sion of keyboard inputs, via a web page, as defined by a finite automaton. The automa-
ton ensures that the password has length within an allowable range and so is legal.
Whilst the abstract event is atomic its concrete translation is not, since it now has
several states (to reflect the length of legal passwords) and the possibility of being inter-
rupted. Nonetheless the result is a bijective representation of Pa ss , that forms the link
which is animated by code.
Before providing examples, the appropriate notion of oracle must be defined.
3.3
Oracle
An operation applied inside its precondition and producing a result within its post-
condition is thought of as forming a 'positive' transition whilst one applied outside its
precondition or producing a result outside its postcondition is 'negative'. Extending that
idea to sequences of operations defines the oracle, which provides the required notion
of a test that passes (all components in the trace are positive) and one that fails (at least
one is negative).
For example, the (positive) transition login(u,up) indicates that one can log in
as u with password up . For this, the initial web page must be at starting page and the
result must be the page that is displayed after a successful login. As indicated above, the
link between the model and the implementation translates the user name u and putative
password up to appropriate text fields and the process of logging in involves clicking
the button. It also links input of up to a succession of keystrokes (and perhaps to an
acknowledging output, audible and visible). For this link to be useful in test automation,
methods to access the text fields and buttons are assumed to be made available by the
COM structure.
The model also contains (negative) transitions of the form loginFail(i,p) which
indicate that the user i with putative password p fails the login. While the link for
the process of logging in is the same as for login , the linking of the results is quite
Search WWH ::




Custom Search