SlideServe
Menu
Préférences
© SlideServe · v2026

Enhancing Unit Testing for Concurrent Programs: A Novel Probabilistic Approach

hop avatar
18 diapositives · 309 Views · Aug 21, 2014

This seminar by Mathias Ricken at Rice University presents innovative strategies for unit testing concurrent programs. It highlights the challenges posed by non-determinism, synchronization points, and the limitations of existing tools. The proposed probabilistic approach incorporates random delays at synchronization points and call graph analysis to improve error detection in multi-threaded environments. By refining the JUnit framework, the seminar illustrates an effective method to uncover previously undetected issues, ensuring robust program reliability in today's multi-core computational landscape.

Enhancing Unit Testing for Concurrent Programs: A Novel Probabilistic Approach - slide 1
01 / 18Enhancing Unit Testing for Concurrent Programs: A Novel Probabilistic Approach
1 / 17

Télécharger la présentation

Enhancing Unit Testing for Concurrent Programs: A Novel Probabilistic Approach
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Testing Concurrent Programs, A 7-Minute Jargon-Free Introduction Thesis Writing Seminar Mathias Ricken Rice University February 25, 2010

  2. Program bugs Slow computers Computer Annoyances

  3. Unit Testing • Test program parts, not the whole program • Test parts individually, then together • Smaller parts  larger parts • Unit tests are programs • Compare expected result to actual result: assertEquals(12, multiply(3,4));

  4. Moore’s Law Adopted fromSutter 2009

  5. Existing Approaches Fail • Simple Unit Testing Frameworks • Example: JUnit • Assume program is single-threaded • Many errors go undetected Main thread: detected Other thread: not detected

  6. Problem: Non-Determinism • Synchronization points • Information exchanged between threads • Order of threads reaching sync. points is non-deterministic

  7. Problem: Non-Determinism • Synchronization points • Information exchanged between threads • Order of threads reaching sync. points is non-deterministic • Program could succeed in one order but fail in another

  8. Comprehensive Tools: Costly • Model checking or schedule-based execution • Examples: JPF, ExitBlock • Test all arrangements • Too costly t = # of threads s = # of sync. points N = # of arrangements Longer than the universe exists!(if N=1  1 minute)

  9. Probabilistic Approach • Insert random delays before synchronization points to modify the order • Run tests many times with different delays

  10. Probabilistic Approach • Insert random delays before synchronization points to modify the order • Run tests many times with different delays delay

  11. (Proposed) Contributions • Probabilistic Approach • Random delays at synchronization points • Call Graph Analysis • Determine which parts of the program may interact • Only insert delays where necessary • Improved JUnit Framework • Exception handler for all threads • Ensures that all errors in all threads are detected

  12. Evaluation • Tested DrJava with Improved JUnit • Number of unit tests: 900 • Previously unknown problems: 20 • Slowdown: ~1 percent • Other parts still under development

  13. Conclusion • Unit testing of concurrent programs will become more important • Concutest helps… • by improving JUnit’s abilities • by using probabilistic techniques • by using call graph analysis to reduce the number of synchronization points

  14. Image Attribution • Left image on Computer Annoyances:Adapted from Microsoft • Graph on Moore’s Law:Adapted from Herb Sutter 2009 • Top image on Multi-Cores and Concurrency:Adapted from Brian Goetz et al. 2006, Addison Wesley • Bottom image on Multi-Cores and Concurrency:Caption Fridays

  15. Extra Slides

  16. Multi-Cores and Concurrency • Recent trends • Clock speed stagnated • Transistors still increasing • Reason: multi-core CPUs • Implication • Must use concurrency to benefit from modern CPUs • Concurrent programming is difficult

  17. Number of Arrangements • Number of schedules (N) • t: # of threads, s: # of slices per thread • Note: s is # of slices (between synchronization points)

  18. Number of Arrangements Product of s-combinations For thread 1: choose s out of ts time slices For thread 2: choose s out of ts-s time slices … For thread t-1: choose s out of 2s time slices For thread t-1: choose s out of s time slices Writing s-combinations using factorial Cancel out terms in denominator and next numerator Left with (ts)! in numerator and t numerators with s!