TOGA Article Swipe
YOU?
·
· 2022
· Open Access
·
· DOI: https://doi.org/10.1145/3510003.3510141
· OA: W4284690374
Testing is widely recognized as an important stage of the software\ndevelopment lifecycle. Effective software testing can provide benefits such as\nbug finding, preventing regressions, and documentation. In terms of\ndocumentation, unit tests express a unit's intended functionality, as conceived\nby the developer. A test oracle, typically expressed as an condition, documents\nthe intended behavior of a unit under a given test prefix. Synthesizing a\nfunctional test oracle is a challenging problem, as it must capture the\nintended functionality rather than the implemented functionality.\n In this paper, we propose TOGA (a neural method for Test Oracle GenerAtion),\na unified transformer-based neural approach to infer both exceptional and\nassertion test oracles based on the context of the focal method. Our approach\ncan handle units with ambiguous or missing documentation, and even units with a\nmissing implementation. We evaluate our approach on both oracle inference\naccuracy and functional bug-finding. Our technique improves accuracy by 33\\%\nover existing oracle inference approaches, achieving 96\\% overall accuracy on a\nheld out test dataset. Furthermore, we show that when integrated with a\nautomated test generation tool (EvoSuite), our approach finds 57 real world\nbugs in large-scale Java programs, including 30 bugs that are not found by any\nother automated testing method in our evaluation.\n