Running example source code

Running example source code

Source publication
Preprint
Full-text available
Behavioural models are a valuable tool for software verification, testing, monitoring, publishing etc. However, they are rarely provided by the software developers and have to be extracted either from the source or from the compiled code. In the context of Java programs, a number of approaches exist for building behavioural models. Most of these ap...

Contexts in source publication

Context 1
... all conditions used in branching statements (if, while etc.) are Boolean expressions referring exclusively to comparisons of values and the contains() and isEmpty() operations on collections (2) the source code is formatted in such a manner that there is at most one operator per line, all branching statements have all their openning and closing braces and the closing braces are placed on separate lines from any other operators (cf. the example in Figure 1) (3) there are only two types-collections and values-and any value can be stored in any collection (4) all loops terminate. ...
Context 2
... that all operators of the method are numbered sequentially from 1 to í µí±›, with the numbering of branching operators corresponding to their closing braces (cf. Figure 1). For each predicate í µí± ∈ í µí±ƒ and each í µí±– ∈ [0, í µí±›], we define a Boolean variable í µí± í µí±– corresponding to the valuation of í µí± after the execution of the operator í µí±–. ...
Context 3
... that, if í µí¼‘ 0 is unsatisfiable, we have í µí±” = false. Applying this approach to the example in Figure 1 we obtain the FSMs in Figures 2 and 3. We do so using the set of all concrete states, in which each state is a combination of predicates from í µí±ƒ (predicates forming the states could be selected to tune the level of the model's abstraction, e.g in our example we rely on the empty í µí± predicate even though í µí±ƒ is not limited by it. The common context for the HashSet version of the example is ({idSet}, ∅). ...

Similar publications

Preprint
Full-text available
Software developers study and reuse existing source code to understand how to properly use application programming interfaces (APIs). However, manually finding sufficient and adequate code examples for a given API is a difficult and a time-consuming activity. Existing approaches to find or generate examples assume availability of a reasonable set o...