On the costs of applying logic-based criteria to mobile applications: An empirical analysis of predicates in real-world Objective-C and Swift applications

  • Juliana Botelho UFLA
  • Vinicius H. S. Durelli UFSJ
  • Simone S. Borges USP
  • Andre T. Endo UTFPR
  • Marcelo M. Eler USP
  • Marcio E. Delamaro USP
  • Rafael S. Durelli UFLA

Resumo


The proliferation of mobile devices has given rise to an increasing demand for software that is well-suited to this particular environment. However, ensuring the quality of mobile applications is challenging. Much of the overall complexity of mobile applications stems from logic expressions, i.e., predicates, which appear in control-flow statements (e.g., if, if--else, while, and do--while) and define much of the behavior of software. Thus, testing predicates is key to ensuring the quality of mobile applications. We argue that an apt way to test predicates is by leveraging well-established logic-based criteria. Many logic-based criteria have been devised, e.g., the active clause coverage (ACC) and modified condition/decision coverage (MCDC). Given that ACC/MCDC are considered expensive, we set out to examine the cost of applying these criteria to mobile applications. We probed into a basic, but relevant, proxy for cost: the complexity of predicates, i.e., number of clauses in predicates. We examined 35 open-source mobile applications implemented in Objective-C and Swift ranging from 129 to 58,140 lines of code with a total of 19,345 predicates. We looked at the frequency and percentage of predicates. We also analyzed the relationship between overall measures of size and the frequency of predicates. We found that, although about 99% of the predicates in mobile application have at most three clauses, there is a significant positive linear correlation between overall measures of size and the number of predicates with four or more clauses. We conclude that mobile applications do not have many multi-clause predicates and hence sophisticated logic-based criteria are needed on only a small portion of the predicates.
Palavras-chave: Replication study, Modified condition-decision coverage, Logic-based test criteria, Active clause coverage (ACC) criteria
Publicado
18/09/2017
BOTELHO, Juliana; DURELLI, Vinicius H. S.; BORGES, Simone S.; ENDO, Andre T.; ELER, Marcelo M.; DELAMARO, Marcio E.; DURELLI, Rafael S.. On the costs of applying logic-based criteria to mobile applications: An empirical analysis of predicates in real-world Objective-C and Swift applications. In: SIMPÓSIO BRASILEIRO DE TESTES DE SOFTWARE SISTEMÁTICO E AUTOMATIZADO (SAST), 2. , 2017, Fortaleza/CE. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2017 . p. 31-39.