1 / 1

Contributions

A Case for White-box Testing Using Declarative Specification Danhua Shao Sarfraz Khurshid Dewayne E. Perry Department of Electrical and Computer Engineering The University of Texas at Austin, Austin, TX 78712 {dshao, khurshid, perry}@ece.utexas.edu. Introduction

kassia
Download Presentation

Contributions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Case for White-box Testing Using Declarative SpecificationDanhua Shao Sarfraz Khurshid Dewayne E. PerryDepartment of Electrical and Computer EngineeringThe University of Texas at Austin, Austin, TX 78712 {dshao, khurshid, perry}@ece.utexas.edu • Introduction • White-box testing and black-box testing are two commonly used and complementary techniques in automatic testing. • The specification-based black-box testing, such as TestEra, is not efficient in generating tests for code coverage. • We propose Whispec to extend the specification-based testing to support white-box testing. • Key idea: integration of both preconditions and path conditions with relational logic so that they are solved together for test generation. • Contributions • Specification-based white-box approach: Under the relational logic model, conjunct preconditions with path conditions in test generation. • Implementation: During the execution of one test case, Whispec does Breadth First Search to cover different branches as early as possible. • Evaluation: Compared with TestEra, Whispec will generate fewer test cases to achieve the same branch coverage. • Experiment • We compared the Whispec with TestEra using a variety of data structure implementations from the Java libraries. • Given the limit on the size of data structures and path conditions, we run Whispec and TestEra to generate tests to maximize branch coverage. • The results show that, under the same branch coverage, Whispec generates significantly smaller test suites than TestEra. • Framework • In Whispec, the constraints are written in Alloy, a first-order language based on relations. • Given the precondition constraint, we first solve it using the Alloy Analyzer and concretize the solution into a test input. • We execute the method on that input and build path conditions for the resulting execution path. • After abstraction, the path condition is translated into new path conditions representing previously unexplored paths. • We run the analyzer on a conjunction of the precondition and a new path condition. • The solution is concretize into a new test input and triggers next round test generation. • The iterative execution of Whispec can systematically enumerate inputs that maximize code coverage.

More Related