arrow
Return

Dynamic Human-in-the-Loop Assertion Generation

delete2023-04-01
delete2
PRE
AI
L
Lucas Zamprogno
B
Braxton Hall
R
Reid Holmes *
J
Joanne M. Atlee
DOI:10.1109/TSE.2022.3217544delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Test cases use assertions to check program behaviour. While these assertions may not be complex, they are themselves code that must be written correctly in order to determine whether a test case should pass or fail. We claim that most test assertions are relatively repetitive and straight-forward, making their construction well suited to automation and that this automation can reduce developer effort while improving assertion quality. Examining 33,873 assertions from 105 projects revealed that developer-written assertions fall into twelve high-level categories, confirming that the vast majority (>90%) of test assertions are fairly simple in practice. We created AutoAssert, a human-in-the-loop tool to fit naturally into a developer's test-writing workflow by automatically generating assertions for JavaScript and TypeScript test cases. A developer invokes AutoAssert by identifying the variable they want validated; AutoAssert uses dynamic analysis to generate assertions relevant for this variable and its runtime values, injecting the assertions into the test case for the developer to accept, modify, delete. Comparing AutoAssert's assertions to those written by developers, we found that the assertions generated by AutoAssert are the same kind of assertion as was written by developers 84% of the time in a sample of over 1,000 assertions. Additionally we validated the utility of AutoAssert-generated assertions with 17 developers who found the majority of generated assertions to be useful and expressed considerable interest in using such a tool for their own projects.
Keywords:
Complexity theory
Codes
Semantics
Human in the loop
Testing
Runtime
Libraries

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.8K
Citations:
1.1W

Organization

U
University of Waterloo
Scholars:
2.2W
Papers: 2.3W
Citations: 3.3W
U
University of British Columbia
Scholars:
7.0W
Papers: 6.1W
Citations: 8.6W
Cited Papers

Cited Papers

Performance analysis of a mechanical vapor recompression zero-emission system with water-injected compressor
err2018-10-01
err0
errOAAI
errHanzhi Wang; Shuaiqi Li; Chong Huang; Shihui He; Wenji Song; Ziping Feng
errShare
errSave
Model-based asessment of an in-vivo predictive relationship from CA1 to CA3 in the rodent hippocampus
err2014-09-27
err0
errOAAI
errRoman A. Sandler; Dong Song; Robert E. Hampson; Sam A. Deadwyler; Theodore W. Berger; Vasilis Z. Marmarelis
errShare
errSave
Metallo-Organic Decomposition (MOD) Films for Electronic Packaging
err2011-02-25
err0
PREAI
errGeraldine M. Vest; V. P. Cone; C. J. Herzfeld; A. K. Bhansali
errShare
errSave
Risk factors associated with disease progression and mortality in chronic kidney disease of uncertain etiology: a cohort study in Medawachchiya, Sri Lanka
err2011-09-01
err0
errOAAI
errLalantha Senevirathna; Tilak Abeysekera; Shanika Nanayakkara; Rohana Chandrajith; Neelakanthi Ratnatunga; Kouji H. Harada; Toshiaki Hitomi; Toshiyuki Komiya; Eri Muso; Akio Koizumi
errShare
errSave
Accuracy of Self-Reported Weight Collected Through a Web-Based Platform in a Weight Loss Trial: Validation Study of the POEmaS Clinical Trial
err2019-01-01
err0
PREAI
errBeleigoli Alline M.; Andrade Andre Q.; de Fátima H. Diniz Maria; Alvares Roberta S.; Ferreira Marina H.; Silva Leticia A.; Rodrigues Marcia C.; Jacomassi Luma; Cerqueira Amanda G.; Ribeiro Antonio L.
errShare
errSave
Sources of software development task friction
err2022-09-20
err1
PREAI
errBradley, Nick C.; Fritz, Thomas; Holmes, Reid
errShare
errSave
Regression testing in an industrial environment
err1998-05-01
err96
errOAAI
errOnoma, AK; Tsai, WT; Poonawala, MH; Suganuma, H
errShare
errSave
researcher View more