Do either assignment a) or assignment b) (not both).

a) Consider the racy C++ program at slide 9; analize it with one of the tools listed at slide 19 (either Valgrind or Google ThreadSanitizer) and report whether the tool is able to detect the race condition, and in the positive case, which settings, which code transformations, which tests… were necessary to enable the tool to detect the race condition. If the tool is not able to handle C++ programs using the <thread> standard library, transform the program into an equivalent C++ or C multithreaded program that the tool is able to handle.

b) Consider the class AvlTree.java provided with the exercises.

  1. Download the Randoop (https://randoop.github.io/randoop/) automatic test case generator, and generate test cases for the public methods of the class AvlTree.java. Use the default settings of Randoop.
  2. Download the Daikon (https://plse.cs.washington.edu/daikon/) invariant detector, and use the test cases generated at point 1 to determine the class invariant and the preconditions/postconditions of the public methods Integer find(int) and void insertElem(int) of the class. Compare the formulas generated by Daikon with the specifications contained in the comments present in the class itself, and classify the clauses produced by Daikon as either contained in the precondition/postcondition/invariant, completely outside the precondition/postcondition/invariant, and partially overlapping the precondition/postcondition/invariant. Determine also the amount of redundant clauses in the formulas generated by Daikon.
  3. Repeat 1 and 2, but instead of Randoop use the EvoSuite (https://www.evosuite.org/) test generator.
  4. Which test generator caused Daikon to infer the best invariants? In general, did you notice any meaningful differences between the invariants inferred by using the tests generated with Randoop and the tests generated by EvoSuite? Repeat the experiment three times with each test generator to compensate for the randomness of the generators themselves.
Ultime modifiche: mercoledì, 5 maggio 2021, 15:50