Capítulo de livro Acesso aberto

Automated Test Generation for Java Generics

2014; Springer Science+Business Media; Linguagem: Inglês

10.1007/978-3-319-03602-1_12

ISSN

1865-1356

Autores

Gordon Fraser, Andrea Arcuri,

Tópico(s)

Real-time simulation and control systems

Resumo

Software testing research has resulted in effective white-box test generation techniques that can produce unit test suites achieving high code coverage. However, research prototypes usually only cover subsets of the basic programming language features, thus inhibiting practical use and evaluation. One feature commonly omitted are Java's generics, which have been present in the language since 2004. In Java, a generic class has type parameters and can be instantiated for different types; for example, a collection can be parameterized with the type of values it contains. To enable test generation tools to cover generics, two simple changes are required to existing approaches: First, the test generator needs to use Java's extended reflection API to retrieve the little information that remains after type erasure. Second, a simple static analysis can identify candidate classes for type parameters of generic classes. The presented techniques are implemented in the EvoSuite test data generation tool and their feasibility is demonstrated with an example.

Referência(s)