Information Technology Reference
In-Depth Information
on one transition can affect the execution frequency of many others in quite
non-obvious ways. We have therefore developed an optimization criterion for
weighting (which essentially tries to distribute test effort as evenly as possible
across the transitions in the state diagram), and an approximation algorithm
for assigning weights automatically. Although the algorithm is not optimal (and
finding an optimal solution appears to be NP-hard), it usually produces good
results.
The weight assignment algorithm can take priorities into account - for exam-
ple, if the user specified that testing the lock transaction is 10x as important
as testing others (for example, because it contains new code), then the weight
assignment algorithm results in the distribution to the left. Note that unlock is
also assigned a higher weight necessary, since without an unlock, we can never
perform more than one lock in a test case. The new library has now been released
as a part of Quviqs product.
4R to ing
Our second strand of work addresses software evolution and the way that this
impacts on testing, and in particular property-based testing. The Wrangler refac-
toring tool [LT08, ST08], developed at Kent, is used to support refactorings of
tests, test-aware refactorings and property discovery.
Initial work has investigated the impact of various refactorings on testing as
practised in three systems:
- EUnit (for unit testing of Erlang systems),
- Quviq QuickCheck (for property-based testing of Erlang systems), and
- Common Test / OTP Test Server (for system testing)
and we describe a selection of work below.
4.1
Duplicate/Similar Code Detection in Wrangler
Duplicated/similar code is common in software, especially in test cases. For
example, in industrial test suites, some test case functions only differ in an atom
and a record definition. It would be desirable to have a generalised abstraction
of these similar test case functions, and make each test case an instance of the
generalised abstraction.
Wrangler's support for ”duplicated code detection” and ”expression search”
is able to report code fragments that are syntactically identical after semantic-
preserving renaming of variable names, ignoring variations in literals, layout and
comments.
The requirement of ”syntactic identity” is somehow restrictive because it could
not detect code fragments that look similar but are not syntactically identical.
For instance, Wrangler's original ”expression search” would not report the fol-
lowing two pieces of code as clones because of the slight syntactical difference in
the record field ”codec” though they look very similar.
Search WWH ::




Custom Search