To Call, or Not to Call: Contrasting Direct and Indirect Branch Coverage in Test Generation
To Call, or Not to Call: Contrasting Direct and Indirect Branch Coverage in Test Generation
复制标题
DOI:
10.1145/3194718.3194719
复制
发表时间:
2018-05
期刊:
影响因子:
--
通讯作者:
Gregory Gay
中科院分区:
文献类型:
--
作者:
Gregory Gay
While adequacy criteria offer an end-point for testing, they do not mandate how targets are covered. Branch Coverage may be attained through direct calls to methods, or through indirect calls between methods. Automated generation is biased towards the rapid gains offered by indirect coverage. Therefore, even with the same end-goal, humans and automation produce very different tests. Direct coverage may yield tests that are more understandable, and that detect faults missed by traditional approaches. However, the added burden for the generation framework may result in lower coverage and faults that emerge through method interactions may be missed. To compare the two approaches, we have generated test suites for both, judging efficacy against real faults. We have found that requir- ing direct coverage results in lower achieved coverage and likelihood of fault detection. However, both forms of Branch Coverage cover code and detect faults that the other does not. By isolating methods, Direct Branch Coverage is less constrained in the choice of input. However, traditional Branch Coverage is able to leverage method interactions to discover faults. Ultimately, both are situationally applicable within the context of a broader testing strategy.