Testing and Debugging Concurrent Code

Slides:



Advertisements
Similar presentations
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
Advertisements

CSE 331 SOFTWARE DESIGN & IMPLEMENTATION DEBUGGING Autumn 2011 Bug-Date: Sept 9, 1947.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
Well-behaved objects 4.0 Testing. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main concepts to.
UCoM Software Architecture Universal Communicator Research UCoM Programming Model The Problem  Multi-threaded code is difficult to write.
SE 450 Software Processes & Product Metrics 1 Defect Removal.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University, St. Louis
Timing and Race Condition Verification of Real-time Systems Yann–Hang Lee, Gerald Gannod, and Karam Chatha Dept. of Computer Science and Eng. Arizona State.
1 Testing Concurrent Programs Why Test?  Eliminate bugs?  Software Engineering vs Computer Science perspectives What properties are we testing for? 
CSE 532: Midterm Review CSE 532 Fall 2013 Midterm Exam 80 minutes, during the usual lecture/studio time: 10:10am to 11:30am on Monday October 21, 2013.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
Scalable Statistical Bug Isolation Authors: B. Liblit, M. Naik, A.X. Zheng, A. Aiken, M. I. Jordan Presented by S. Li.
By Ian Jackman Davit Stepanyan.  User executed untested code.  The order in which statements were meant to be executed are different than the order.
Functional Verification Figure 1.1 p 6 Detection of errors in the design Before fab for design errors, after fab for physical errors.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
CIS 842: Specification and Verification of Reactive Systems Lecture 1: Course Overview Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The.
Debugging Threaded Applications By Andrew Binstock CMPS Parallel.
Objects First With Java A Practical Introduction Using BlueJ Well-behaved objects 2.1.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
Agenda  Quick Review  Finish Introduction  Java Threads.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Kendo: Efficient Deterministic Multithreading in Software M. Olszewski, J. Ansel, S. Amarasinghe MIT to be presented in ASPLOS 2009 slides by Evangelos.
ICS Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources 6.2 Approaches to the Deadlock Problem 6.3 A System Model –Resource Graphs –State.
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
C++11 Atomic Types and Memory Model
Process Management Deadlocks.
Component Configurator
Introduction to Generic Programming in C++
OPERATING SYSTEMS CS 3502 Fall 2017
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Presented by: Daniel Taylor
Regression Testing with its types
Event Handling Patterns Asynchronous Completion Token
Software Testing.
Wrapper Façade Pattern
Chapter 8 – Software Testing
Concurrency.
Verification and Validation Overview
Department of Computer Science and Engineering
Overview of the Lab 2 Assignment: Linux Scheduler Profiling
Overview of the Lab 3 Assignment: Kernel Module Concurrent Memory Use
Software What Is Software?
Semester Review Chris Gill CSE 422S - Operating Systems Organization
runtime verification Brief Overview Grigore Rosu
The Active Object Pattern
Kernel Synchronization II
CSE 522S Advanced Operating Systems Course Introduction
COS 260 DAY 16 Tony Gauvin.
CS 501: Software Engineering Fall 1999
Half-Sync/Half-Async (HSHA) and Leader/Followers (LF) Patterns
Monitor Object Pattern
Kernel Synchronization I
Linux Block I/O Layer Chris Gill, Brian Kocoloski
Andy Wang Operating Systems COP 4610 / CGF 5765
Test Tools Tools can be useful but are they worth it? Cost
Andy Wang Operating Systems COP 4610 / CGF 5765
Sarah Diesburg Operating Systems COP 4610
CSE 542: Operating Systems
Rich Model Toolkit – An Infrastructure for Reliable Computer Systems
Presentation transcript:

Testing and Debugging Concurrent Code E81 CSE 532S: Advanced Multi-Paradigm Software Development Testing and Debugging Concurrent Code Chris Gill Department of Computer Science and Engineering Washington University in St. Louis cdgill@cs.wustl.edu Title slide

Concurrency Related Bugs Deadlock occurs when a thread never unblocks Complete deadlock occurs when no thread ever unblocks Blocking I/O can be problematic (e.g., if input never arrives) Livelock is similar but involves futile effort Threads are not blocked, but never make real progress E.g., if a condition never occurs, or with protocol bugs Data races and broken invariants Can corrupt data, dangle pointers, double free, leak data Lifetime of thread relative to its data also matters If thread exits without freeing resources they can leak If resources are freed before thread is done with them (or even gains access to them) behavior may be undefined

Locating Concurrency Related Bugs Inspection can be useful but easily misses subtle bugs Any possible sequence of relevant actions may matter Explanation/modeling can be even more powerful Speculate about how different sequences can manifest Even (or especially) unlikely ones: what if another thread…? Gain experience with different races, deadlocks Try those on for size with respect to code you’re testing E.g., ABA issues, circular waits, etc. Hypothesize, predict, instrument & observe, repeat The scientific method is the most powerful debugging tool Develop concurrency related regression test suites Invest in testing harnesses that drive event sequeneces, etc. (e.g., boost statecharts may let you automate some of this)

Design for Testability Consider doing formal modeling of concurrency E.g., for model checking of temporal or timed temporal logic Good tools exist to help with this (SPIN, UPPAAL, IF, etc.) At least consider what tests you’ll run as part of design Can help you avoid concurrency design mistakes initially Can help you maintain regression tests as code evolves: e.g. how likely will you spot a newly introduced race in old code? Design for pluggable concurrency Single threaded vs. logically vs. physically concurrent A pluggable scheduler and modular units of work can help Taken to its extreme do combination simulation testing Combining all of the above potentially lets you explore, test, and then reproduce different concurrency scenarios reliably