skip to main content
10.1109/ICSE.2007.37acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

Feedback-Directed Random Test Generation

Published: 24 May 2007 Publication History

Abstract

We present a technique that improves random test generation by incorporating feedback obtained from executing test inputs as they are created. Our technique builds inputs incrementally by randomly selecting a method call to apply and finding arguments from among previously-constructed inputs. As soon as an input is built, it is executed and checked against a set of contracts and filters. The result of the execution determines whether the input is redundant, illegal, contract-violating, or useful for generating more inputs. The technique outputs a test suite consisting of unit tests for the classes under test. Passing tests can be used to ensure that code contracts are preserved across program changes; failing tests (that violate one or more contract) point to potential errors that should be corrected. Our experimental results indicate that feedback-directed random test generation can outperform systematic and undirected random test generation, in terms of coverage and error detection. On four small but nontrivial data structures (used previously in the literature), our technique achieves higher or equal block and predicate coverage than model checking (with and without abstraction) and undirected random generation. On 14 large, widely-used libraries (comprising 780KLOC), feedback-directed random test generation finds many previously-unknown errors, not found by either model checking or undirected random generation.

References

[1]
{1} T. Ball. A theory of predicate-complete test coverage and generation. In FMCO, pages 1-22, 2004.
[2]
{2} K. Claessen and J. Hughes. QuickCheck: A lightweight tool for random testing of Haskell programs. In ICFP, pages 268- 279, Sept. 2000.
[3]
{3} C. Csallner and Y. Smaragdakis. JCrasher: an automatic robustness tester for Java. Software: Practice and Experience, 34(11):1025-1050, Sept. 2004.
[4]
{4} C. Csallner and Y. Smaragdakis. Check 'n' Crash: Combining static checking and testing. In ICSE, pages 422-431, May 2005.
[5]
{5} C. Csallner and Y. Smaragdakis. DSD-Crasher: A hybrid analysis tool for bug finding. In ISSTA, pages 245-254, July 2006.
[6]
{6} M. d'Amorim, C. Pacheco, D. Marinov, T. Xie, and M. D. Ernst. An empirical comparison of automated generation and classification techniques for object-oriented unit testing. In ASE, Sept. 2006.
[7]
{7} R. DeMillo, R. Lipton, and F. Sayward. Hints on test data selection: Help for the practicing programmer. IEEE Computer , 4(11):34-41, Apr. 1978.
[8]
{8} J. W. Duran and S. C. Ntafos. An evaluation of random testing. IEEE TSE, 10(4):438-444, July 1984.
[9]
{9} R. Ferguson and B. Korel. The chaining approach for software test data generation. ACM TOSEM, 5(1):63-86, Jan. 1996.
[10]
{10} J. E. Forrester and B. P. Miller. An empirical study of the robustness of Windows NT applications using random testing. In 4th USENIX Windows System Symposium, pages 59-68, Seattle, WA, USA, Aug. 2000.
[11]
{11} P. Godefroid, N. Klarlund, and K. Sen. Dart: Directed automated random testing. In PLDI, June 2005.
[12]
{12} W. Grieskamp, N. Tillmann, C. Campbell, W. Schulte, and M. Veanes. Action machines - towards a framework for model composition, exploration and conformance testing based on symbolic computation. In QSIC 2005: Quality Software International Conference, Sept. 2005.
[13]
{13} A. Groce and W. Visser. Heuristics for model checking Java programs. STTT, 6(4):260-276, 2004.
[14]
{14} D. Hamlet. Random testing. In Encyclopedia of Software Engineering. John Wiley and Sons, 1994.
[15]
{15} D. Hamlet and R. Taylor. Partition testing does not inspire confidence. IEEE TSE, 16(12):1402-1411, Dec. 1990.
[16]
{16} A. Hartman. Personal communication, July 2006.
[17]
{17} J. Henkel and A. Diwan. Discovering algebraic specifications from Java classes. In ECOOP, pages 431-456, July 2003.
[18]
{18} D. Marinov, A. Andoni, D. Daniliuc, S. Khurshid, and M. Rinard. An evaluation of exhaustive testing for data structures. Technical Report MIT/LCS/TR-921, MIT Lab for Computer Science, Sept. 2003.
[19]
{19} B. P. Miller, L. Fredriksen, and B. So. An empirical study of the reliability of UNIX utilities. CACM, 33(12):32-44, Dec. 1990.
[20]
{20} S. Ntafos. On random and partition testing. In ISSTA, pages 42-48, Mar. 1998.
[21]
{21} J. Offutt and R. H. Untch. Mutation 2000: Uniting the orthogonal. In Mutation 2000: Mutation Testing in the Twentieth and the Twenty First Centuries, pages 45-55, San Jose, CA, Oct. 2000.
[22]
{22} C. Oriat. Jartege: A tool for random generation of unit tests for Java classes. In QoSA/SOQUA, pages 242-256, Sept. 2005.
[23]
{23} C. Pacheco and M. D. Ernst. Eclat: Automatic generation and classification of test inputs. In ECOOP, pages 504-527, July 2005.
[24]
{24} C. Pacheco, S. Lahiri, M. Ernst, and T. Ball. Feedback-directed random test generation. Technical Report MSR-TR- 2006-125, Microsoft Research, Sept. 2006.
[25]
{25} K. Sen and G. Agha. CUTE and jCUTE: Concolic unit testing and explicit path model-checking tools. In CAV, pages 419-423, Aug. 2006.
[26]
{26} W. Visser, K. Havelund, G. Brat, S. Park, and F. Lerda. Model checking programs. ASE, 10(2):203-232, 2003.
[27]
{27} W. Visser, C. S. Pasareanu, and S. Khurshid. Test input generation with Java PathFinder. In ISSTA, pages 97-107, July 2004.
[28]
{28} W. Visser, C. S. Pasareanu, and R. Pelánek. Test input generation for Java containers using state matching. In ISSTA, pages 37-48, July 2006.
[29]
{29} T. Xie. Personal communication, Aug. 2006.
[30]
{30} T. Xie, D. Marinov, and D. Notkin. Rostra: A framework for detecting redundant object-oriented unit tests. In ASE, pages 196-205, Nov. 2004.
[31]
{31} T. Xie, D. Marinov, W. Schulte, and D. Notkin. Symstra: A framework for generating object-oriented unit tests using symbolic execution. In TACAS, pages 365-381, Apr. 2005.

Cited By

View all
  • (2024)FinHunter: Improved Search-Based Test Generation for Structural Testing of FinTech SystemsCompanion Proceedings of the 32nd ACM International Conference on the Foundations of Software Engineering10.1145/3663529.3663823(10-20)Online publication date: 10-Jul-2024
  • (2024)Natural Symbolic Execution-Based Testing for Big Data AnalyticsProceedings of the ACM on Software Engineering10.1145/36608251:FSE(2677-2700)Online publication date: 12-Jul-2024
  • (2024)Exploring and Unleashing the Power of Large Language Models in Automated Code TranslationProceedings of the ACM on Software Engineering10.1145/36607781:FSE(1585-1608)Online publication date: 12-Jul-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '07: Proceedings of the 29th international conference on Software Engineering
May 2007
784 pages
ISBN:0769528287

Sponsors

Publisher

IEEE Computer Society

United States

Publication History

Published: 24 May 2007

Check for updates

Qualifiers

  • Article

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)1
Reflects downloads up to 23 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)FinHunter: Improved Search-Based Test Generation for Structural Testing of FinTech SystemsCompanion Proceedings of the 32nd ACM International Conference on the Foundations of Software Engineering10.1145/3663529.3663823(10-20)Online publication date: 10-Jul-2024
  • (2024)Natural Symbolic Execution-Based Testing for Big Data AnalyticsProceedings of the ACM on Software Engineering10.1145/36608251:FSE(2677-2700)Online publication date: 12-Jul-2024
  • (2024)Exploring and Unleashing the Power of Large Language Models in Automated Code TranslationProceedings of the ACM on Software Engineering10.1145/36607781:FSE(1585-1608)Online publication date: 12-Jul-2024
  • (2024)Atlas: Automating Cross-Language Fuzzing on Android Closed-Source LibrariesProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652133(350-362)Online publication date: 11-Sep-2024
  • (2024)Deep Multiple Assertions GenerationProceedings of the 2024 IEEE/ACM First International Conference on AI Foundation Models and Software Engineering10.1145/3650105.3652293(1-11)Online publication date: 14-Apr-2024
  • (2024)Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration ToolsProceedings of the 1st International Workshop on Large Language Models for Code10.1145/3643795.3648396(54-61)Online publication date: 20-Apr-2024
  • (2024)Java JIT Testing with Template ExtractionProceedings of the ACM on Software Engineering10.1145/36437771:FSE(1129-1151)Online publication date: 12-Jul-2024
  • (2024)Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLMProceedings of the ACM on Software Engineering10.1145/36437691:FSE(951-971)Online publication date: 12-Jul-2024
  • (2024)Unleashing the Giants: Enabling Advanced Testing for Infrastructure as CodeProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3643078(300-301)Online publication date: 14-Apr-2024
  • (2024)GenMorph: Automatically Generating Metamorphic Relations via Genetic ProgrammingIEEE Transactions on Software Engineering10.1109/TSE.2024.340784050:7(1888-1900)Online publication date: 1-Jul-2024
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media