Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICSE43902.2021.00015acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

JEST: N+1-version Differential Testing of Both JavaScript Engines and Specification

Published: 05 November 2021 Publication History

Abstract

Modern programming follows the continuous integration (CI) and continuous deployment (CD) approach rather than the traditional waterfall model. Even the development of modern programming languages uses the CI/CD approach to swiftly provide new language features and to adapt to new development environments. Unlike in the conventional approach, in the modern CI/CD approach, a language specification is no more the oracle of the language semantics because both the specification and its implementations (interpreters or compilers) can co-evolve. In this setting, both the specification and implementations may have bugs, and guaranteeing their correctness is non-trivial.
In this paper, we propose a novel N+1-version differential testing to resolve the problem. Unlike the traditional differential testing, our approach consists of three steps: 1) to automatically synthesize programs guided by the syntax and semantics from a given language specification, 2) to generate conformance tests by injecting assertions to the synthesized programs to check their final program states, 3) to detect bugs in the specification and implementations via executing the conformance tests on multiple implementations, and 4) to localize bugs on the specification using statistical information. We actualize our approach for the JavaScript programming language via JEST, which performs N+1-version differential testing for modern JavaScript engines and ECMAScript, the language specification describing the syntax and semantics of JavaScript in a natural language. We evaluated JEST with four JavaScript engines that support all modern JavaScript language features and the latest version of ECMAScript (ES11, 2020). JEST automatically synthesized 1,700 programs that covered 97.78% of syntax and 87.70% of semantics from ES11. Using the assertion-injected JavaScript programs, it detected 44 engine bugs in four different engines and 27 specification bugs in ES11.

References

[1]
(2012) Mark Zuckerberg's Letter to Investors: 'The Hacker Way'. [Online]. Available: https://www.wired.com/2012/02/zuck-letter/
[2]
(2020) What is CI/CD? Continuous integration and continuous delivery explained. [Online]. Available: https://www.infoworld.com/article/3271126/what-is-cicd-continuous-integration-and-continuous-delivery-explained.html
[3]
(2020) Node.js - A JavaScript runtime built on Chrome's V8 JavaScript engine. [Online]. Available: https://nodejs.org/
[4]
(2020) Moddable - Tools to create open IoT products using standard JavaScript on low cast microcontrollers. [Online]. Available: https://www.moddable.com/
[5]
(2020) Espruino - JavaScript for Microcontrollers. [Online]. Available: https://www.espruino.com/
[6]
(2020) Tessel 2 - a robust IoT and robotics development platform. [Online]. Available: https://tessel.io/
[7]
(2015) Standard ECMA-262 6th Edition ECMAScript 2015 Language Specification. [Online]. Available: https://ecma-international.org/ecma-262/6.0/
[8]
Solidity. (2019) Official solidity documentation. [Online]. Available:https://solidity.readthedocs.io/en/v0.5.7/
[9]
S. Hwang and S. Ryu, "Gap between theory and practice: An empirical study of security patches in solidity," in Proceedings of the ACM/IEEE International Conference on Software Engineering, 2020.
[10]
W. M. McKeeman, "Differential testing for software," Digital Technical Journal, vol. 10, no. 1, pp. 100--107, 1998.
[11]
J. Park, J. Park, S. An, and S. Ryu, "JISET: Javascript ir-based semantics extraction toolchain," in Proceedings of ACM International Conference on Automated Software Engineering, 2020.
[12]
H. Nguyen, "Automatic extraction of x86 formal semantics from its natural language description," Information Science, 2018.
[13]
A. V. Vu and M. Ogawa, "Formal semantics extraction from natural language specifications for arm," in International Symposium on Formal Methods. Springer, 2019, pp. 465--483.
[14]
(2020) Google's open source high-performance JavaScript and WebAssembly engine, written in C++. [Online]. Available: https://v8.dev/
[15]
(2020) A high performance implementation of the JavaScript programming language. Built on the GraalVM by Oracle Labs. [Online]. Available: https://github.com/graalvm/graaljs
[16]
(2020) A small and embeddable Javascript engine by Fabrice Bellard and Charlie Gordon. [Online]. Available: https://bellard.org/quickjs/
[17]
(2020) The JavaScript engine at the center of the Moddable SDK. [Online]. Available: https://github.com/Moddable-OpenSource/moddable
[18]
W. E. Wong, R. Gao, Y. Li, R. Abreu, and F. Wotawa, "A survey on software fault localization," IEEE Transactions on Software Engineering, vol. 42, no. 8, pp. 707--740, 2016.
[19]
B. McKenzie, "Generating strings at random from a context free grammar," Department of Computer Science, University of Canterbury, Tech. Rep. TR-COSC 10/97, 1997.
[20]
X. Xie, T. Y. Chen, F.-C. Kuo, and B. Xu, "A theoretical analysis of the risk evaluation formulas for spectrum-based fault localization," ACM Transactions on Software Engineering and Methodology (TOSEM), vol. 22, no. 4, pp. 1--40, 2013.
[21]
J. Sohn and S. Yoo, "Fluccs: Using code and change metrics to improve fault localization," in Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM, 2017, pp. 273--283.
[22]
Y. Chen, T. Su, C. Sun, Z. Su, and J. Zhao, "Coverage-directed differential testing of jvm implementations," in proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2016, pp. 85--99.
[23]
T. Petsios, A. Tang, S. Stolfo, A. D. Keromytis, and S. Jana, "Nezha: Efficient domain-independent differential testing," in Proceedings of IEEE Symposium on Security and Privacy, 2017, pp. 615--632.
[24]
Y. Chen and Z. Su, "Guided differential testing of certificate validation in ssl/tls implementations," in Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, 2015, pp. 793--804.
[25]
M. Georgiev, S. Iyengar, S. Jana, R. Anubhai, D. Boneh, and V. Shmatikov, "The most dangerous code in the world: validating ssl certificates in non-browser software," in Proceedings of the 2012 ACM conference on Computer and communications security, 2012, pp. 38--49.
[26]
P. Chapman and D. Evans, "Automated black-box detection of side-channel vulnerabilities in web applications," in Proceedings of the 18th ACM conference on Computer and communications security, 2011, pp. 263--274.
[27]
S. Kim, M. Faerevaag, M. Jung, S. Jung, D. Oh, J. Lee, and S. K. Cha, "Testing intermediate representations for binary analysis," in Proceedings of ACM International Conference on Automated Software Engineering, 2017, pp. 353--364.
[28]
H. Han and S. K. Cha, "Imf: Inferred model-based fuzzer," in Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017, pp. 2345--2358.
[29]
C. Holler, K. Herzig, and A. Zeller, "Fuzzing with code fragments," in Presented as part of the 21st {USENIX} Security Symposium ({USENIX} Security 12), 2012, pp. 445--458.
[30]
X. Yang, Y. Chen, E. Eide, and J. Regehr, "Finding and understanding bugs in c compilers," in Proceedings of the ACM Conference on Programming Language Design and Implementation, 2011, pp. 283--294.
[31]
S. K. Cha, M. Woo, and D. Brumley, "Program-adaptive mutational fuzzing," in 2015 IEEE Symposium on Security and Privacy. IEEE, 2015, pp. 725--741.
[32]
A. Rebert, S. K. Cha, T. Avgerinos, J. Foote, D. Warren, G. Grieco, and D. Brumley, "Optimizing seed selection for fuzzing," in 23rd {USENIX} Security Symposium ({USENIX} Security 14), 2014, pp. 861--875.
[33]
M. Woo, S. K. Cha, S. Gottlieb, and D. Brumley, "Scheduling blackbox mutational fuzzing," in Proceedings of the 2013 ACM SIGSAC conference on Computer & communications security, 2013, pp. 511--522.
[34]
A. Wirfs-Brock and B. Eich, "Javascript: the first 20 years," in Proceedings of the ACM on Programming Languages, vol. 4, 2020, pp. 1--189.
[35]
P. Godefroid, A. Kiezun, and M. Y. Levin, "Grammar-based whitebox fuzzing," in Proceedings of the ACM Conference on Programming Language Design and Implementation, 2008, pp. 206--215.
[36]
H. Han, D. Oh, and S. K. Cha, "CodeAlchemist: Semantics-aware code generation to find vulnerabilities in javascript engines." in Proceedings of the Network and Distributed System Security Symposium, 2019.
[37]
J. Wang, B. Chen, L. Wei, and Y. Liu, "Superion: Grammar-aware greybox fuzzing," in 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE). IEEE, 2019, pp. 724--735.
[38]
S. Park, W. Xu, I. Yun, D. Jang, and T. Kim, "Fuzzing javascript engines with aspect-preserving mutation," in 2020 IEEE Symposium on Security and Privacy (SP). IEEE, 2020, pp. 1629--1642.
[39]
S. Lee, H. Han, S. K. Cha, and S. Son, "Montage: A neural network language model-guided javascript engine fuzzer," 2020.
[40]
J. A. Jones, M. J. Harrold, and J. Stasko, "Visualization of test information to assist fault localization," in Proceedings of the 24th International Conference on Software Engineering. ICSE 2002. IEEE, 2002, pp. 467--477.
[41]
J. A. Jones, M. J. Harrold, and J. T. Stasko, "Visualization for fault localization," in in Proceedings of ICSE 2001 Workshop on Software Visualization. Citeseer, 2001.
[42]
V. Dallmeier, C. Lindig, and A. Zeller, "Lightweight bug localization with ample," in Proceedings of the sixth international symposium on Automated analysis-driven debugging, 2005, pp. 99--104.
[43]
T. Janssen, R. Abreu, and A. J. van Gemund, "Zoltar: A toolset for automatic fault localization," in 2009 IEEE/ACM International Conference on Automated Software Engineering. IEEE, 2009, pp. 662--664.
[44]
L. Naish, H. J. Lee, and K. Ramamohanarao, "A model for spectra-based software diagnosis," ACM Transactions on software engineering and methodology (TOSEM), vol. 20, no. 3, pp. 1--32, 2011.
[45]
W. E. Wong, Y. Qi, L. Zhao, and K.-Y. Cai, "Effective fault localization using code coverage," in 31st Annual International Computer Software and Applications Conference (COMPSAC 2007), vol. 1. IEEE, 2007, pp. 449--456.

Cited By

View all
  • (2024)A Coq Mechanization of JavaScript Regular Expression SemanticsProceedings of the ACM on Programming Languages10.1145/36746668:ICFP(1003-1031)Online publication date: 15-Aug-2024
  • (2024)Wapplique: Testing WebAssembly Runtime via Execution Context-Aware Bytecode MutationProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680340(1035-1047)Online publication date: 11-Sep-2024
  • (2024)Cross-Language Differential Testing of JSON ParsersProceedings of the 19th ACM Asia Conference on Computer and Communications Security10.1145/3634737.3657003(1117-1127)Online publication date: 1-Jul-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '21: Proceedings of the 43rd International Conference on Software Engineering
May 2021
1768 pages
ISBN:9781450390859

Sponsors

Publisher

IEEE Press

Publication History

Published: 05 November 2021

Check for updates

Badges

Author Tags

  1. JavaScript
  2. conformance test generation
  3. differential testing
  4. mechanized specification

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

ICSE '21
Sponsor:

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)9
  • Downloads (Last 6 weeks)2
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)A Coq Mechanization of JavaScript Regular Expression SemanticsProceedings of the ACM on Programming Languages10.1145/36746668:ICFP(1003-1031)Online publication date: 15-Aug-2024
  • (2024)Wapplique: Testing WebAssembly Runtime via Execution Context-Aware Bytecode MutationProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3680340(1035-1047)Online publication date: 11-Sep-2024
  • (2024)Cross-Language Differential Testing of JSON ParsersProceedings of the 19th ACM Asia Conference on Computer and Communications Security10.1145/3634737.3657003(1117-1127)Online publication date: 1-Jul-2024
  • (2023)FuzzJITProceedings of the 32nd USENIX Conference on Security Symposium10.5555/3620237.3620342(1865-1882)Online publication date: 9-Aug-2023
  • (2023)Feature-Sensitive Coverage for Conformance Testing of Programming Language ImplementationsProceedings of the ACM on Programming Languages10.1145/35912407:PLDI(493-515)Online publication date: 6-Jun-2023
  • (2022)Automatically deriving JavaScript static analyzers from specifications using Meta-level static analysisProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3549097(1022-1034)Online publication date: 7-Nov-2022

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media