The In Vivo Testing Approach Christian Murphy, Gail Kaiser, Ian Vo, Matt Chu Columbia University.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Detecting Bugs Using Assertions Ben Scribner. Defining the Problem  Bugs exist  Unexpected errors happen Hardware failures Loss of data Data may exist.
D. Tam, R. Azimi, L. Soares, M. Stumm, University of Toronto Appeared in ASPLOS XIV (2009) Reading Group by Theo 1.
1 Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-Associative Cache and Prefetch Buffers By Sreemukha Kandlakunta Phani Shashank.
INTROPERF: TRANSPARENT CONTEXT- SENSITIVE MULTI-LAYER PERFORMANCE INFERENCE USING SYSTEM STACK TRACES Chung Hwan Kim*, Junghwan Rhee, Hui Zhang, Nipun.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
Metamorphic Testing Techniques to Detect Defects in Applications without Test Oracles Christian Murphy Thesis Defense April 12, 2010.
1 Application of Metamorphic Testing to Supervised Classifiers Xiaoyuan Xie, Tsong Yueh Chen Swinburne University of Technology Christian Murphy, Gail.
Concurrency. What is Concurrency Ability to execute two operations at the same time Physical concurrency –multiple processors on the same machine –distributing.
Automatic System Testing of Programs without Test Oracles
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
On Effective Testing of Health Care Simulation Software Christian Murphy, M.S. Raunak, Andrew King, Sanjian Chen, Christopher Imbriano, Gail Kaiser, Insup.
Performance Evaluation
1 Improving Hash Join Performance through Prefetching _________________________________________________By SHIMIN CHEN Intel Research Pittsburgh ANASTASSIA.
Using JML Runtime Assertion Checking to Automate Metamorphic Testing in Applications without Test Oracles Christian Murphy, Kuang Shen, Gail Kaiser Columbia.
Toward Optimal Network Fault Correction via End-to-End Inference Patrick P. C. Lee, Vishal Misra, Dan Rubenstein Distributed Network Analysis (DNA) Lab.
Distributed In Vivo Testing of Software Applications Matt Chu, Christian Murphy, Gail Kaiser Columbia University.
Parameterizing Random Test Data According to Equivalence Classes Chris Murphy, Gail Kaiser, Marta Arias Columbia University.
Automatic Detection of Previously-Unseen Application States for Deployment Environment Testing and Analysis Chris Murphy, Moses Vaughan, Waseem Ilahi,
Efficiently Sharing Common Data HTCondor Week 2015 Zach Miller Center for High Throughput Computing Department of Computer Sciences.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
Grid Computing Exposing the myths of desktop scavenging grids John Easton – IBM Grid computing
Using Runtime Testing to Detect Defects in Applications without Test Oracles Chris Murphy Columbia University November 10, 2008.
Options for User Input Options for getting information from the user –Write event-driven code Con: requires a significant amount of new code to set-up.
0 Deterministic Replay for Real- time Software Systems Alice Lee Safety, Reliability & Quality Assurance Office JSC, NASA Yann-Hang.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
Coverage tools Program is typically compiled with special options, to add extra source or object code. –Additional data structures, such as a flow graph,
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Testing Michael Ernst CSE 140 University of Washington.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Chapter 6: Iteration Part 1. To be able to program loops with the while, for, and do statements To avoid infinite loops and off-by-one errors To understand.
Bug Localization with Machine Learning Techniques Wujie Zheng
Today’s Agenda  HW #1  Finish Introduction  Input Space Partitioning Software Testing and Maintenance 1.
A User-Lever Concurrency Manager Hongsheng Lu & Kai Xiao.
MICHALIS POLYCHRONAKIS(COLUMBIA UNIVERSITY,USA), KOSTAS G. ANAGNOSTAKIS(NIOMETRICS, SINGAPORE), EVANGELOS P. MARKATOS(FORTH-ICS, GREECE) ACSAC,2010 Comprehensive.
1 Context-dependent Product Line Practice for Constructing Reliable Embedded Systems Naoyasu UbayashiKyushu University, Japan Shin NakajimaNational Institute.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
From lecture slides for Computer Organization and Architecture: Designing for Performance, Eighth Edition, Prentice Hall, 2010 CS 211: Computer Architecture.
Copyright © 2005, SAS Institute Inc. All rights reserved. JDBC, SAS and Multi-user Update Mitchel Soltys Manager Open Data Access.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Java Thread and Memory Model
Exceptions Chapter 16 This chapter explains: What as exception is Why they are useful Java exception facilities.
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
ApproxHadoop Bringing Approximations to MapReduce Frameworks
Model Counting with Applications to CodeHunt Willem Visser Stellenbosch University South Africa.
High-level Interfaces for Scalable Data Mining Ruoming Jin Gagan Agrawal Department of Computer and Information Sciences Ohio State University.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
Agenda  Quick Review  Finish Introduction  Java Threads.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
Introduction to Computer Programming using Fortran 77.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Introduction to Performance Tuning Chia-heng Tu PAS Lab Summer Workshop 2009 June 30,
Practical Hadoop: do’s and don’ts by example Kacper Surdy, Zbigniew Baranowski.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Testing Tutorial 7.
Configuration Fuzzing for Software Vulnerability Detection
Breakout Session 3 Alex, Mirco, Vojtech, Juraj, Christoph
Chapter 8 – Software Testing
Eclat: Automatic Generation and Classification of Test Inputs
ColdFusion Performance Troubleshooting and Tuning
Android Topics UI Thread and Limited processing resources
CSE 451 Autumn 2003 Section 3 October 16.
Chapter 10 – Software Testing
Landon Cox January 17, 2018 January 22, 2018
Lecture 34: Testing II April 24, 2017 Selenium testing script 7/7/2019
Presentation transcript:

The In Vivo Testing Approach Christian Murphy, Gail Kaiser, Ian Vo, Matt Chu Columbia University

2 Chris Murphy, Columbia University Problem Statement It is infeasible to fully test a large system prior to deployment considering:  different runtime environments  different configuration options  different patterns of usage This problem may be compounded by moving apps from single-CPU machines to multi-core processors

3 Chris Murphy, Columbia University Our Solution Continually test applications executing in the field (in vivo) as opposed to only testing in the development environment (in vitro) Conduct the tests in the context of the running application Do so without affecting the system’s users

4 Chris Murphy, Columbia University int main ( ) {... foo(x); int main ( ) {... foo(x); test_foo(x); }...

5 Chris Murphy, Columbia University Contributions A new testing approach called in vivo testing designed to execute tests in the deployment environment A new type of tests called in vivo tests An implementation framework called Invite

6 Chris Murphy, Columbia University Related Work Perpetual testing [Clarke SAS’00] Skoll [Memon ICSE’04] Gamma [Orso ISSTA’02] CBI [Liblit PLDI’03] Distributed In Vivo Testing [Chu ICST’08]

7 Chris Murphy, Columbia University Example of Defect: Cache private int numItems = 0, currSize = 0; private int maxCapacity = 1024; // in bytes public int getNumItems() { return numItems; } public boolean addItem(CacheItem i) throws... { numItems++; add(i); currSize += i.size; return true; } if (currSize + i.size < maxCapacity) { } else { return false; } Should only be incremented within “if” block Number of items in the cache Their size (in bytes) Maximum capacity

8 Chris Murphy, Columbia University Insufficient Unit Test public void testAddItem() { Cache c = new Cache(); assert(c.addItem(new CacheItem())) assert(c.getNumItems() == 1); assert(c.addItem(new CacheItem())) assert(c.getNumItems() == 2); } 1. Assumes an empty/new cache 2. Doesn’t take into account various states that the cache can be in

9 Chris Murphy, Columbia University Defects Targeted 1. Unit tests that make incomplete assumptions about the state of objects in the application 2. Possible field configurations that were not tested in the lab 3. A legal user action that puts the system in an unexpected state 4. A sequence of unanticipated user actions that breaks the system 5. Defects that only appear intermittently

10 Chris Murphy, Columbia University Applications Targeted Applications that produce calculations or results that may not be obviously wrong  “Non-testable programs”  Simulations Applications in which exta-functional behavior may be wrong even if output is correct  Caching systems  Scheduling of tasks

11 Chris Murphy, Columbia University In Vivo Testing: Process 1. Create test code (using existing unit tests or new In Vivo tests) 2. Instrument application using Invite testing framework 3. Configure framework 4. Deploy/execute application in the field

12 Chris Murphy, Columbia University Model of Execution Function is about to be executed NO Execute function Yes Run a test? Create sandbox Run test Fork Stop Rest of program continues

13 Chris Murphy, Columbia University Writing In Vivo Tests /* Method to be tested */ public boolean addItem(CacheItem i) {... } /* JUnit style test */ public void testAddItem() { Cache c = new Cache(); if (c.addItem(new CacheItem())) assert (c.getNumItems() == 1); } CacheItem i) { int oldNumItems = getNumItems(); this; boolean In Vivo returnoldNumItems+1; else return true; i))

14 Chris Murphy, Columbia University Instrumentation /* Method to be tested */ public boolean __addItem(CacheItem i) {... } /* In Vivo style test */ public boolean testAddItem(CacheItem i) {... } public boolean addItem(CacheItem i) { if (Invite.runTest(“Cache.addItem”)) { Invite.createSandboxAndFork(); if (Invite.isTestProcess()) { if (testAddItem(i) == false) Invite.fail(); else Invite.succeed(); Invite.destroySandboxAndExit(); } return __addItem(i); }

15 Chris Murphy, Columbia University Configuration Each instrumented method has a set probability ρ with which its test(s) will run To avoid bottlenecks, can also configure:  Maximum allowed performance overhead  Maximum number of simultaneous tests Also, what action to take when a test fails

16 Chris Murphy, Columbia University Case Studies Applied testing approach to two caching systems  OSCache  Apache JCS 1.3 Both had known defects that were found by users (no corresponding unit tests for these defects) Goal: demonstrate that “traditional” unit tests would miss these but In Vivo testing would detect them

17 Chris Murphy, Columbia University Experimental Setup An undergraduate student created unit tests for the methods that contained the defects These tests passed in “development” Student was then asked to convert the unit tests to In Vivo tests Driver created to simulate real usage in a “deployment environment”

18 Chris Murphy, Columbia University Discussion In Vivo testing revealed all defects, even though unit testing did not Some defects only appeared in certain states, e.g. when the cache was at full capacity  These are the very types of defects that In Vivo testing is targeted at However, the approach depends heavily on the quality of the tests themselves

19 Chris Murphy, Columbia University Performance Evaluation We instrumented three C and two Java applications with the framework and varied the value ρ (probability that a test is run) Applications were run with real-world inputs on a dual-core 3GHz server with 1GB RAM No restraints were placed on maximum allowable overhead or simultaneous tests

20 Chris Murphy, Columbia University Experimental Results 0% 25% 50% 75% 100% percent of function calls resulting in tests Time (seconds)

21 Chris Murphy, Columbia University Discussion Percent overhead is not a meaningful metric since it depends on the number of tests run  More tests = more overhead  Short-running programs with lots of tests will have significantly more “overhead” than long- running programs For C, the overhead was 1.5ms per test For Java, around 5.5ms per test

22 Chris Murphy, Columbia University Future Work Ensure that test does not affect the external system state (database, network, etc.) Adjust frequency of test execution based on context or resource availability (CPU usage, number of threads, etc.) Apply approach to certain domains, e.g. security testing

23 Chris Murphy, Columbia University Conclusion We have presented a new testing approach called in vivo testing designed to execute tests in the deployment environment We have also presented an implementation framework called Invite In Vivo testing is an effective technique at detecting defects not caught in the lab

The In Vivo Testing Approach Christian Murphy, Gail Kaiser, Ian Vo, Matt Chu Columbia University

25 Chris Murphy, Columbia University Distributed In Vivo Testing [Chu ICST’08] Testing load is distributed to members of an “application community” Each of the N members perform 1/N th of the testing so as to reduce overhead We have also considered an “autonomic” approach that balances testing load according to usage profile