Mutation Operators for Java Streams

  • Manoel Aranda III UFAL
  • Elvys Soares IFAL / UFPE
  • Márcio Ribeiro UFAL
  • Fabiano Ferrari UFSCar
  • Rohit Gheyi UFCG
  • Arthur Lima UFAL

Resumo


Mutation testing analyzes test suites to verify their capability to detect artificially injected faults. Mutation testing tools rely on mutation operators to simulate those faults by modifying language constructs. The popularization of Streaming APIs, which enable parallel processing of native data structures with relatively succinct constructs, presents challenges related to functional programming, and faults from the APIs’ misuse are already objects of study. However, no comprehensive mutation operators have been defined for this purpose. We propose seven mutation operators to simulate stream-related faults. To evaluate our operators, we mined 22 open-source projects from different domains (i.e., applications for smart cities and messaging frameworks) to identify faults our operators could simulate. We analyzed 357 commits, raising 91 fixes for stream-related faults in GitHub Java projects. Our operators can simulate 96.7% of the analyzed faults, and we verified five of our proposals in practice. Our mutation operators can enhance the capabilities of current mutation testing tools and help developers to improve their test suites by avoiding stream-related faults.
Palavras-chave: mutation testing, mutation analysis, Java, streams
Publicado
03/10/2022
ARANDA III, Manoel; SOARES, Elvys; RIBEIRO, Márcio; FERRARI, Fabiano; GHEYI, Rohit; LIMA, Arthur. Mutation Operators for Java Streams. In: SIMPÓSIO BRASILEIRO DE TESTES DE SOFTWARE SISTEMÁTICO E AUTOMATIZADO (SAST), 7. , 2022, Uberlândia. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2022 . p. 59–68.