Skip to main content

SearchGEM5: Towards Reliable Gem5 with Search Based Software Testing and Large Language Models

  • Conference paper
  • First Online:
Search-Based Software Engineering (SSBSE 2023)

Abstract

We introduce a novel automated testing technique that combines LLM and search-based fuzzing. We use ChatGPT to parameterise C programs. We compile the resultant code snippets, and feed compilable ones to SearchGEM5, our extension to AFL++ fuzzer with customised new mutation operators. We run thus created 4005 binaries through our system under test, gem5, increasing its existing test coverage by more than 1000 lines. We discover 244 instances where gem5 simulation of the binary differs from the binary’s expected behaviour.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Data Availability Statement

SearchGEM5, the LLMs prompt and the experimental infrastructure, data, and results are freely available via [2, 11].

References

  1. AFL compiler fuzzer. https://github.com/agroce/afl-compiler-fuzzer

  2. Artifact of SearchGEM5. Zenodo (2023). https://doi.org/10.5281/zenodo.8316685

  3. Aschermann, C., Frassetto, T., Holz, T., Jauernig, P., Sadeghi, A.R., Teuchert, D.: NAUTILUS: fishing for deep bugs with grammars. In: NDSS (2019)

    Google Scholar 

  4. Binkert, N., et al.: The gem5 simulator. ACM SIGARCH Comput. Archit. News 39(2), 1–7 (2011)

    Article  Google Scholar 

  5. Biswas, S.: Role of ChatGPT in computer programming: ChatGPT in computer programming. Mesopotamian J. Comput. Sci. 2023, 8–16 (2023)

    Article  Google Scholar 

  6. Bossuet, L., Grosso, V., Lara-Nino, C.A.: Emulating side channel attacks on gem5: lessons learned. In: EuroS &PW, pp. 287–295. IEEE (2023)

    Google Scholar 

  7. Bruns, N., Herdt, V., Große, D., Drechsler, R.: Toward RISC-V CSR compliance testing. IEEE Embed. Syst. Lett. 13(4), 202–205 (2021)

    Article  Google Scholar 

  8. Destefanis, G., Bartolucci, S., Ortu, M.: A preliminary analysis on the code generation capabilities of GPT-3.5 and Bard AI models for java functions (2023)

    Google Scholar 

  9. Fioraldi, A., et al.: AFL++ : Combining incremental steps of fuzzing research. In: USENIX Workshop at WOOT 20. USENIX Association (2020)

    Google Scholar 

  10. Git repository of gfauto. https://github.com/google/graphicsfuzz.git

  11. Git repository of searchGEM5. https://github.com/karineek/SearchGEM5/

  12. Kersten, R., Luckow, K., Păsăreanu, C.S.: POSTER: AFL-based fuzzing for java with kelinci. In: SIGSAC, pp. 2511–2513. CCS 2017. ACM (2017)

    Google Scholar 

  13. Langdon, W.B., Yoo, S., Harman, M.: Inferring automatic test oracles. In: SBST, pp. 5–6. Buenos Aires, Argentina (2017)

    Google Scholar 

  14. Lund, B.D., Wang, T.: Chatting about ChatGPT: how may AI and GPT impact academia and libraries? Library Hi Tech News 40(3), 26–29 (2023)

    Article  Google Scholar 

  15. Menéndez, H.D., Suárez-Tangil, G.: ObfSec: measuring the security of obfuscations from a testing perspective. Expert Syst. Appl. 210, 118298 (2022)

    Article  Google Scholar 

  16. Pham, V.T., Böhme, M., Roychoudhury, A.: AFLNET: a greybox fuzzer for network protocols. In: ICST, pp. 460–465 (2020)

    Google Scholar 

  17. AFL’s’ fork for fuzzing pure Python. https://github.com/jwilk/python-afl

  18. Zalewski, M.: Technical “whitepaper” for afl-fuzz. Accessed 21 Apr 2023. http://lcamtuf.coredump.cx/afl/technical_details.txt

Download references

Acknowledgments

Authors are listed in alphabetical order. This work was supported by the UKRI EPSRC grant no. EP/P023991/1 and the UKRI TAS Hub grant no. EP/V00784X/1 and EP/V026801/2.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Aidan Dakhama , Karine Even-Mendoza , W.B. Langdon , Hector Menendez or Justyna Petke .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Dakhama, A., Even-Mendoza, K., Langdon, W., Menendez, H., Petke, J. (2024). SearchGEM5: Towards Reliable Gem5 with Search Based Software Testing and Large Language Models. In: Arcaini, P., Yue, T., Fredericks, E.M. (eds) Search-Based Software Engineering. SSBSE 2023. Lecture Notes in Computer Science, vol 14415. Springer, Cham. https://doi.org/10.1007/978-3-031-48796-5_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-48796-5_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-48795-8

  • Online ISBN: 978-3-031-48796-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics