liora
Uploaded by
8 SLIDES
227 VIEWS
80LIKES

Testing List Deletion in C with Erlang: A Case Study from Quviq and Chalmers

DESCRIPTION

This study explores the principles of debugging and testing C functions using Erlang in the context of list deletion. We investigate the properties of `gdsl_list_delete` and validate its behavior against the standard list operations in Erlang. Through randomized testing, we demonstrate how to ensure that the deletion of elements from a list maintains integrity. Our exploration also touches on real-world challenges, including a known GCC bug related to complex data types. Join us as we detail our findings and methodologies in software testing.

1 / 8

Download Presentation

Testing List Deletion in C with Erlang: A Case Study from Quviq and Chalmers

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. Debugging C with Erlang John Hughes Quviq AB/Chalmers University

  2. Testing gdsl_list_delete prop_list_delete() -> ?FORALL(L,non_empty(list(int()), ?FORALL(X,elements(L), equals(from_gdsl_list( gdsl_list_delete(X,to_gdsl_list(L))), lists:delete(X,L) )). prop_list_delete() -> ?FORALL(L,non_empty(list(int()), ?FORALL(X,elements(L), begin New = from_gdsl_list( gdsl_list_delete(X,to_gdsl_list(L))), New == lists:delete(X,L) orelse New == reverse(lists:delete(X,reverse(L))) end)). reverse(lists:delete(X,reverse(L))) Failed! [0,10,0,10] 10 [0,10,0] /= [0,0,10] Failed! [6,0,6] 6 [0,6] /= [6,0]

  3. Testing the link to C • For a randomtype T, generate • …and test identity(x)==x T identity(T x) { return x; } struct s {int a; complexfloat b;}

  4. GCC Bugzilla Bug 39678 • Summary: ”complex type isn't passed correctly” • Reported: 7 April 2009 • Our counterexample found: 9 April • Patch posted: 9 April • 818 lines of comments in Bugzilla • Once the bug was simplified, a patch was quick to write

  5. Want to try? quviq-licencer.com/promotion.html

More Related