Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3395363.3397380acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article
Open access

Discovering discrepancies in numerical libraries

Published: 18 July 2020 Publication History

Abstract

Numerical libraries constitute the building blocks for software applications that perform numerical calculations. Thus, it is paramount that such libraries provide accurate and consistent results. To that end, this paper addresses the problem of finding discrepancies between synonymous functions in different numerical libraries as a means of identifying incorrect behavior. Our approach automatically finds such synonymous functions, synthesizes testing drivers, and executes differential tests to discover meaningful discrepancies across numerical libraries. We implement our approach in a tool named FPDiff, and provide an evaluation on four popular numerical libraries: GNU Scientific Library (GSL), SciPy, mpmath, and jmat. FPDiff finds a total of 126 equivalence classes with a 95.8% precision and 79% recall, and discovers 655 instances in which an input produces a set of disagreeing outputs between function synonyms, 150 of which we found to represent 125 unique bugs. We have reported all bugs to library maintainers; so far, 30 bugs have been fixed, 9 have been found to be previously known, and 25 more have been acknowledged by developers.

References

[1]
2019. IEEE Standard for Floating-Point Arithmetic. IEEE Std 754-2019 (Revision of IEEE 754-2008) (July 2019 ), 1-84. https://doi.org/10.1109/IEEESTD. 2019.8766229
[2]
E. Anderson, Z. Bai, J. Dongarra, A. Greenbaum, A. McKenney, J. Du Croz, S. Hammarling, J. Demmel, C. Bischof, and D. Sorensen. 1990. LAPACK: A Portable Linear Algebra Library for High-performance Computers. In Proceedings of the 1990 ACM/IEEE Conference on Supercomputing (Supercomputing '90). IEEE Computer Society Press, Los Alamitos, CA, USA, 2-11. http://dl.acm.org/citation. cfm?id= 110382. 110385
[3]
Douglas N Arnold. 2000. The Explosion of the Ariane 5. ( 2000 ). http://wwwusers.math.umn.edu/~arnold/disasters/ariane.html
[4]
Douglas N Arnold. 2000. The Patriot Missile Failure. ( 2000 ). http://wwwusers.math.umn.edu/~arnold/disasters/patriot.html
[5]
Roberto Bagnara, Matthieu Carlier, Roberta Gori, and Arnaud Gotlieb. 2013. Symbolic Path-Oriented Test Data Generation for Floating-Point Programs. In Sixth IEEE International Conference on Software Testing, Verification and Validation, ICST 2013, Luxembourg, Luxembourg, March 18-22, 2013. IEEE Computer Society, 1-10. https://doi.org/10.1109/ICST. 2013.17
[6]
Tao Bao and Xiangyu Zhang. 2013. On-the-fly detection of instability problems in floating-point program execution. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2013, part of SPLASH 2013, Indianapolis, IN, USA, October 26-31, 2013, Antony L. Hosking, Patrick Th. Eugster, and Cristina V. Lopes (Eds.). ACM, 817-832. https://doi.org/10.1145/2509136.2509526
[7]
Earl T. Barr, Thanh Vo, Vu Le, and Zhendong Su. 2013. Automatic detection of lfoating-point exceptions. In The 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '13, Rome, Italy-January 23-25, 2013, Roberto Giacobazzi and Radhia Cousot (Eds.). ACM, 549-560. https: //doi.org/10.1145/2429069.2429133
[8]
Farnaz Behrang and Alessandro Orso. 2018. Automated test migration for mobile apps. In Proceedings of the 40th International Conference on Software Engineering: Companion Proceeedings, ICSE 2018, Gothenburg, Sweden, May 27-June 03, 2018, Michel Chaudron, Ivica Crnkovic, Marsha Chechik, and Mark Harman (Eds.). ACM, 384-385. https://doi.org/10.1145/3183440.3195019
[9]
Florian Benz, Andreas Hildebrandt, and Sebastian Hack. 2012. A dynamic program analysis to find floating-point accuracy problems. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ' 12, Beijing, China-June 11-16, 2012, Jan Vitek, Haibo Lin, and Frank Tip (Eds.). ACM, 453-462. https://doi.org/10.1145/2254064.2254118
[10]
Phelim Boyle and Alex Potapchik. 2006. Application of high-precision computing for pricing arithmetic asian options. In Symbolic and Algebraic Computation, International Symposium, ISSAC 2006, Genoa, Italy, July 9-12, 2006, Proceedings, Barry M. Trager (Ed.). ACM, 39-46. https://doi.org/10.1145/1145768.1145782
[11]
Nghi D. Q. Bui. 2019. Towards zero knowledge learning for cross language API mappings. In Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019., Gunter Mussbacher, Joanne M. Atlee, and Tevfik Bultan (Eds.). IEEE / ACM, 123-125. https://dl.acm.org/citation.cfm?id= 3339722
[12]
Tsong Yueh Chen, Fei-Ching Kuo, T. H. Tse, and Zhiquan Zhou. 2003. Metamorphic Testing and Beyond. In 11th International Workshop on Software Technology and Engineering Practice (STEP 2003 ), 19-21 September 2003, Amsterdam, The Netherlands. IEEE Computer Society, 94-100. https://doi.org/10.1109/STEP. 2003. 18
[13]
Yuting Chen, Ting Su, and Zhendong Su. 2019. Deep diferential testing of JVM implementations. In Proceedings of the 41st International Conference on Software Engineering, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019, Joanne M. Atlee, Tevfik Bultan, and Jon Whittle (Eds.). IEEE / ACM, 1257-1268. https: //doi.org/10.1109/ICSE. 2019.00127
[14]
Yuting Chen and Zhendong Su. 2015. Guided diferential testing of certificate validation in SSL/TLS implementations. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, Bergamo, Italy, August 30-September 4, 2015, Elisabetta Di Nitto, Mark Harman, and Patrick Heymans (Eds.). ACM, 793-804. https://doi.org/10.1145/2786805.2786835
[15]
Wei-Fan Chiang, Ganesh Gopalakrishnan, and Zvonimir Rakamaric. 2015. Practical Floating-Point Divergence Detection. In Languages and Compilers for Parallel Computing-28th International Workshop, LCPC 2015, Raleigh, NC, USA, September 9-11, 2015, Revised Selected Papers (Lecture Notes in Computer Science), Xipeng Shen, Frank Mueller, and James Tuck (Eds.), Vol. 9519. Springer, 271-286. https://doi.org/10.1007/978-3-319-29778-1_17
[16]
Wei-Fan Chiang, Ganesh Gopalakrishnan, Zvonimir Rakamaric, and Alexey Solovyev. 2014. Eficient search for inputs causing high floating-point errors. In ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP '14, Orlando, FL, USA, February 15-19, 2014, José E. Moreira and James R. Larus (Eds.). ACM, 43-52. https://doi.org/10.1145/2555243.2555265
[17]
Daniel DeFreez, Aditya V. Thakur, and Cindy Rubio-González. 2018. Path-based function embedding and its application to error-handling specification mining, See, 423-433. https://doi.org/10.1145/3236024.3236059
[18]
Saikat Dutta, Owolabi Legunsen, Zixin Huang, and Sasa Misailovic. 2018. Testing probabilistic programming systems, See, 574-586. https://doi.org/10.1145/ 3236024.3236057
[19]
Anthony Di Franco, Hui Guo, and Cindy Rubio-González. 2017. A comprehensive study of real-world numerical bug characteristics. In Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, ASE 2017, Urbana, IL, USA, October 30-November 03, 2017, Grigore Rosu, Massimiliano Di Penta, and Tien N. Nguyen (Eds.). IEEE Computer Society, 509-519. https://doi. org/10.1109/ASE. 2017.8115662
[20]
Zhoulai Fu, Zhaojun Bai, and Zhendong Su. 2015. Automated backward error analysis for numerical code. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, Jonathan Aldrich and Patrick Eugster (Eds.). ACM, 639-654. https://doi.org/10. 1145/2814270.2814317
[21]
Zhoulai Fu and Zhendong Su. 2017. Achieving high coverage for floating-point code via unconstrained programming. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, June 18-23, 2017, Albert Cohen and Martin T. Vechev (Eds.). ACM, 306-319. https://doi.org/10.1145/3062341.3062383
[22]
Zhoulai Fu and Zhendong Su. 2019. Efective floating-point analysis via weakdistance minimization. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2019, Phoenix, AZ, USA, June 22-26, 2019., Kathryn S. McKinley and Kathleen Fisher (Eds.). ACM, 439-452. https://doi.org/10.1145/3314221.3314632
[23]
Amparo Gil, Javier Segura, and Nico M. Temme. 2007. Numerical methods for special functions. SIAM. https://doi.org/10.1137/1.9780898717822
[24]
Brian Gough. 2009. GNU Scientific Library Reference Manual-Third Edition (3rd ed.). Network Theory Ltd.
[25]
Hui Guo and Cindy Rubio-González. 2020. Eficient Generation of Error-Inducing Floating-Point Inputs via Symbolic Execution (To Appear). In International Conference on Software Engineering (ICSE).
[26]
Fredrik Johansson et al. 2013. mpmath: a Python library for arbitrary-precision lfoating-point arithmetic (version 0.18). http://mpmath.org/.
[27]
Eric Jones, Travis Oliphant, Pearu Peterson, et al. 2001-. SciPy: Open source scientific tools for Python. (2001-). http://www.scipy.org/
[28]
Upulee Kanewala and James M. Bieman. 2013. Using machine learning techniques to detect metamorphic relations for programs without test oracles. In IEEE 24th International Symposium on Software Reliability Engineering, ISSRE 2013, Pasadena, CA, USA, November 4-7, 2013. IEEE Computer Society, 1-10. https://doi.org/10. 1109/ISSRE. 2013.6698899
[29]
Christian Klinger, Maria Christakis, and Valentin Wüstholz. 2019. Diferentially testing soundness and precision of program analyzers. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2019, Beijing, China, July 15-19, 2019, Dongmei Zhang and Anders Møller (Eds.). ACM, 239-250. https://doi.org/10.1145/3293882.3330553
[30]
Gary T. Leavens, Alessandro Garcia, and Corina S. Pasareanu (Eds.). 2018. Proceedings of the 2018 ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/SIGSOFT FSE 2018, Lake Buena Vista, FL, USA, November 04-09, 2018. ACM. http://dl.acm.org/citation.cfm?id= 3236024
[31]
Daniel Lehmann and Michael Pradel. 2018. Feedback-directed diferential testing of interactive debuggers, See, 610-620. https://doi.org/10.1145/3236024. 3236037
[32]
A. D. MacDonald and Sanborn C. Brown. 1949. High Frequency Gas Discharge Breakdown in Helium. Phys. Rev. 75 (Feb 1949 ), 411-418. Issue 3. https://doi.org/ 10.1103/PhysRev.75.411
[33]
Osni Marques, Christof Vömel, James Demmel, and Beresford N. Parlett. 2008. Algorithm 880: A testing infrastructure for symmetric tridiagonal eigensolvers. ACM Trans. Math. Softw. 35, 1 ( 2008 ), 8 : 1-8 : 13. https://doi.org/10.1145/1377603. 1377611
[34]
William M. McKeeman. 1998. Diferential Testing for Software. Digital Technical Journal 10, 1 ( 1998 ), 100-107. http://www.hpl.hp.com/hpjournal/dtj/vol10num1/ vol10num1art9.pdf
[35]
Trong Duc Nguyen, Anh Tuan Nguyen, and Tien N. Nguyen. 2016. Mapping API elements for code migration with vector representations. In Proceedings of the 38th International Conference on Software Engineering, ICSE 2016, Austin, TX, USA, May 14-22, 2016-Companion Volume, Laura K. Dillon, Willem Visser, and Laurie Williams (Eds.). ACM, 756-758. https://doi.org/10.1145/2889160.2892661
[36]
Trong Duc Nguyen, Anh Tuan Nguyen, Hung Dang Phan, and Tien N. Nguyen. 2017. Exploring API embedding for API usages and applications. In Proceedings of the 39th International Conference on Software Engineering, ICSE 2017, Buenos Aires, Argentina, May 20-28, 2017, Sebastián Uchitel, Alessandro Orso, and Martin P. Robillard (Eds.). IEEE / ACM, 438-449. https://doi.org/10.1109/ICSE. 2017.47
[37]
Michael Pradel and Koushik Sen. 2018. DeepBugs: a learning approach to namebased bug detection. PACMPL 2, OOPSLA ( 2018 ), 147 : 1-147 : 25. https://doi.org/ 10.1145/3276517
[38]
Xue Qin, Hao Zhong, and Xiaoyin Wang. 2019. TestMig: migrating GUI test cases from iOS to Android. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2019, Beijing, China, July 15-19, 2019., Dongmei Zhang and Anders Møller (Eds.). ACM, 284-295. https: //doi.org/10.1145/3293882.3330575
[39]
Anirudh Santhiar, Omesh Pandita, and Aditya Kanade. 2014. Mining Unit Tests for Discovery and Migration of Math APIs. ACM Trans. Softw. Eng. Methodol. 24, 1 ( 2014 ), 4 : 1-4 : 33. https://doi.org/10.1145/2629506
[40]
Chengnian Sun, Vu Le, and Zhendong Su. 2016. Finding and analyzing compiler warning defects. In Proceedings of the 38th International Conference on Software Engineering, ICSE 2016, Austin, TX, USA, May 14-22, 2016, Laura K. Dillon, Willem Visser, and Laurie Williams (Eds.). ACM, 203-213. https://doi.org/ 10.1145/2884781.2884879
[41]
Enyi Tang, Earl T. Barr, Xuandong Li, and Zhendong Su. 2010. Perturbing numerical calculations for statistical analysis of floating-point program (in)stability. In Proceedings of the Nineteenth International Symposium on Software Testing and Analysis, ISSTA 2010, Trento, Italy, July 12-16, 2010, Paolo Tonella and Alessandro Orso (Eds.). ACM, 131-142. https://doi.org/10.1145/1831708.1831724
[42]
Enyi Tang, Xiangyu Zhang, Norbert Th. Müller, Zhenyu Chen, and Xuandong Li. 2017. Software Numerical Instability Detection and Diagnosis by Combining Stochastic and Infinite-Precision Testing. IEEE Trans. Software Eng. 43, 10 ( 2017 ), 975-994. https://doi.org/10.1109/TSE. 2016.2642956
[43]
Lode Vandevenne. 2014. jmat: Complex special functions, numerical linear algebra and statistics in JavaScript. https://github.com/lvandeve/jmat. ( 2014 ).
[44]
Ran Wang, Daming Zou, Xinrui He, Yingfei Xiong, Lu Zhang, and Gang Huang. 2016. Detecting and fixing precision-specific operations for measuring floatingpoint errors. In Proceedings of the 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, Seattle, WA, USA, November 13-18, 2016, Thomas Zimmermann, Jane Cleland-Huang, and Zhendong Su (Eds.). ACM, 619-630. https://doi.org/10.1145/2950290.2950355
[45]
Eric W Weisstein. [n. d.]. Special Function. ([n. d.]). http://mathworld.wolfram. com/SpecialFunction.html
[46]
Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and understanding bugs in C compilers. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, Mary W. Hall and David A. Padua (Eds.). ACM, 283-294. https://doi.org/10.1145/1993498.1993532
[47]
Yibiao Yang, Yuming Zhou, Hao Sun, Zhendong Su, Zhiqiang Zuo, Lei Xu, and Baowen Xu. 2019. Hunting for bugs in code coverage tools via randomized diferential testing. In Proceedings of the 41st International Conference on Software Engineering, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019, Joanne M. Atlee, Tevfik Bultan, and Jon Whittle (Eds.). IEEE / ACM, 488-498. https://doi.org/10. 1109/ICSE. 2019.00061
[48]
Xin Yi, Liqian Chen, Xiaoguang Mao, and Tao Ji. 2019. Eficient automated repair of high floating-point errors in numerical libraries. PACMPL 3, POPL ( 2019 ), 56 : 1-56 : 29. https://doi.org/10.1145/3290369
[49]
Daming Zou, Ran Wang, Yingfei Xiong, Lu Zhang, Zhendong Su, and Hong Mei. 2015. A Genetic Algorithm for Detecting Significant Floating-Point Inaccuracies. In 37th IEEE/ACM International Conference on Software Engineering, ICSE 2015, Florence, Italy, May 16-24, 2015, Volume 1, Antonia Bertolino, Gerardo Canfora, and Sebastian G. Elbaum (Eds.). IEEE Computer Society, 529-539. https://doi. org/10.1109/ICSE. 2015.70

Cited By

View all
  • (2025)D3: Differential Testing of Distributed Deep Learning With Model GenerationIEEE Transactions on Software Engineering10.1109/TSE.2024.346165751:1(38-52)Online publication date: 1-Jan-2025
  • (2024)Detecting Numerical Deviations in Deep Learning Models Introduced by the TVM Compiler2024 IEEE 35th International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE62328.2024.00018(73-83)Online publication date: 28-Oct-2024
  • (2022)Oracle-free repair synthesis for floating-point programsProceedings of the ACM on Programming Languages10.1145/35633226:OOPSLA2(957-985)Online publication date: 31-Oct-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ISSTA 2020: Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis
July 2020
591 pages
ISBN:9781450380089
DOI:10.1145/3395363
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 July 2020

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. differential testing
  2. floating point
  3. numerical libraries
  4. software testing

Qualifiers

  • Research-article

Funding Sources

Conference

ISSTA '20
Sponsor:

Acceptance Rates

Overall Acceptance Rate 58 of 213 submissions, 27%

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)167
  • Downloads (Last 6 weeks)32
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)D3: Differential Testing of Distributed Deep Learning With Model GenerationIEEE Transactions on Software Engineering10.1109/TSE.2024.346165751:1(38-52)Online publication date: 1-Jan-2025
  • (2024)Detecting Numerical Deviations in Deep Learning Models Introduced by the TVM Compiler2024 IEEE 35th International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE62328.2024.00018(73-83)Online publication date: 28-Oct-2024
  • (2022)Oracle-free repair synthesis for floating-point programsProceedings of the ACM on Programming Languages10.1145/35633226:OOPSLA2(957-985)Online publication date: 31-Oct-2022
  • (2022)Fuzzing deep-learning libraries via automated relational API inferenceProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3549085(44-56)Online publication date: 7-Nov-2022
  • (2022)DocTer: documentation-guided fuzzing for testing deep learning API functionsProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3534220(176-188)Online publication date: 18-Jul-2022
  • (2022)Choosing mathematical function implementations for speed and accuracyProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523452(522-535)Online publication date: 9-Jun-2022
  • (2022)EAGLEProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510165(798-810)Online publication date: 21-May-2022
  • (2021)Themis: Ambiguity-Aware Network Intrusion Detection based on Symbolic Model ComparisonProceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security10.1145/3460120.3484762(3384-3399)Online publication date: 12-Nov-2021
  • (2020)pLinerProceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis10.5555/3433701.3433766(1-14)Online publication date: 9-Nov-2020
  • (2020)PLINER: Isolating Lines of Floating-Point Code for Compiler-Induced VariabilitySC20: International Conference for High Performance Computing, Networking, Storage and Analysis10.1109/SC41405.2020.00053(1-14)Online publication date: Nov-2020

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media