Automated Testing of System Software (Virtual Machine Monitors) Tao Xie Department of Computer Science North Carolina State University

Slides:



Advertisements
Similar presentations
Tutorial Pex4Fun: Teaching and Learning Computer Science via Social Gaming Nikolai Tillmann, Jonathan de Halleux, Judith Bishop, Michal.
Advertisements

Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Towards Self-Testing in Autonomic Computing Systems Tariq M. King, Djuradj Babich, Jonatan Alava, and Peter J. Clarke Software Testing Research Group Florida.
Kai Pan, Xintao Wu University of North Carolina at Charlotte Generating Program Inputs for Database Application Testing Tao Xie North Carolina State University.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Software Engineering Techniques for the Development of System of Systems Seminar of “Component Base Software Engineering” course By : Marzieh Khalouzadeh.
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Pexxxx White Box Test Generation for
Software Testing and Quality Assurance
1 Software Testing and Quality Assurance Lecture 30 - Introduction to Software Testing.
1 Welcome & Overview 2 nd Annual Workshop “What are National Security Threats?” Kathleen D. Morrison Co-Director, JTAC Professor of Anthropology Director,
Introduction to Systems Analysis and Design
Introduction to Software Testing
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
Sales Force Automation. SFA – Sales Force Automation  Focus on cultivating customer relationships and  Improving customer satisfaction  Scenario Number.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Automating Software Testing Using Program Analysis -Patrice Godefroid, Peli de Halleux, Aditya V. Nori, Sriram K. Rajamani,Wolfram Schulte, and Nikolai.
Software Faults and Fault Injection Models --Raviteja Varanasi.
IT Project Management Cheng Li, Ph.D. August 2003.
Separation of Concerns Tao Xie Peking University, China North Carolina State University, USA In collaboration with Nikolai Tillmann, Peli de Halleux, Wolfram.
Tao Xie North Carolina State University Supported by CACC/NSA Related projects supported in part by ARO, NSF, SOSI.
Tao Xie (North Carolina State University) Nikolai Tillmann, Jonathan de Halleux, Wolfram Schulte (Microsoft Research, Redmond WA, USA)
Managing the development and purchase of information systems (Part 1)
‘One Sky for Europe’ EUROCONTROL © 2002 European Organisation for the Safety of Air Navigation (EUROCONTROL) Page 1 VALIDATION DATA REPOSITORY Overview.
CPIS 357 Software Quality & Testing
Tao Xie Automated Software Engineering Group Department of Computer Science North Carolina State University
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
Teaching and Learning Programming and Software Engineering via Interactive Gaming Tao Xie University of Illinois at Urbana-Champaign In collaboration with.
Atkins New PSR Reporting Solution Using Actuate e.Spreadsheet October 2007.
OBJECT ORIENTED SYSTEM ANALYSIS AND DESIGN. COURSE OUTLINE The world of the Information Systems Analyst Approaches to System Development The Analyst as.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Test Driven Development Arrange, Act, Assert… Awesome Jason Offutt Software Engineer Central Christian Church
Tao Xie North Carolina State University Nikolai Tillmann, Peli de Halleux, Wolfram Schulte Microsoft Research.
Code Contracts Parameterized Unit Tests Tao Xie. Example Unit Test Case = ? Outputs Expected Outputs Program + Test inputs Test Oracles 2 void addTest()
1 Introduction to Software Engineering Lecture 1.
Information Systems Engineering. Lecture Outline Information Systems Architecture Information System Architecture components Information Engineering Phases.
CS527 Topics in Software Engineering (Software Testing and Analysis) Darko Marinov September 22, 2011.
Tao Xie (North Carolina State University) Peli de Halleux, Nikolai Tillmann, Wolfram Schulte (Microsoft Research)
Mining Gigabytes of Dynamic Traces for Test Generation Suresh Thummalapenta North Carolina State University Peli de Halleux and Nikolai Tillmann Microsoft.
White Box-based Coverage Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 111 W. Eric Wong Department of Computer Science The.
Computer Science Automated Software Engineering Research ( Mining Exception-Handling Rules as Conditional Association.
Alattin: Mining Alternative Patterns for Detecting Neglected Conditions Suresh Thummalapenta and Tao Xie Department of Computer Science North Carolina.
Nikolai Tillmann, Jonathan de Halleux Tao Xie Microsoft Research Univ. Illinois at Urbana-Champaign.
Sales Force Automation. SFA – Sales Force Automation  Focus on cultivating customer relationships and  Improving customer satisfaction  Scenario Number.
Exploiting Code Search Engines to Improve Programmer Productivity and Quality Suresh Thummalapenta Advisor: Dr. Tao Xie Department of Computer Science.
Computer Science 1 Mining Likely Properties of Access Control Policies via Association Rule Mining JeeHyun Hwang 1, Tao Xie 1, Vincent Hu 2 and Mine Altunay.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Cooperative Developer Testing: Tao Xie North Carolina State University In collaboration with Xusheng ASE and Nikolai Tillmann, Peli de
Page 1 APAC ANNUAL TRAINING 2011 “Integration of specialist skills into AGSA regularity audits for greater oversight impact” 2- 3 Aug 2011 Presenter: Ms.
Computer Science 1 Test Selection and Augmentation of Regression System Tests for Security Policy Evolution JeeHyun Hwang, Tao Xie, and collaborators at.
Tao Xie (North Carolina State University) Nikolai Tillmann, Peli de Halleux, Wolfram Schulte (Microsoft Research)
A Test Case + Mock Class Generator for Coding Against Interfaces Mainul Islam, Christoph Csallner Software Engineering Research Center (SERC) Computer.
Parameterized Unit Testing in the Open Source Wild Wing Lam (U. Illinois) In collaboration with Siwakorn Srisakaokul, Blake Bassett, Peyman Mahdian and.
1 Exposing Behavioral Differences in Cross-Language API Mapping Relations Hao Zhong Suresh Thummalapenta Tao Xie Institute of Software, CAS, China IBM.
MTA EXAM Software Testing Fundamentals : OBJECTIVE 6 Automate Software Testing.
1. October 25, 2011 Louis Everett & John Yu Division of Undergraduate Education National Science Foundation October 26, 2011 Don Millard & John Yu Division.
Improving Structural Testing of Object-Oriented Programs via Integrating Evolutionary Testing and Symbolic Execution Kobi Inkumsah Tao Xie Dept. of Computer.
Software Production ( ) Lecture 3: Dr. Samer Odeh Hanna (PhD) office: 318.
Symstra: A Framework for Generating Object-Oriented Unit Tests using Symbolic Execution Tao Xie, Darko Marinov, Wolfram Schulte, and David Notkin University.
Test Automation Steffen Goerlitz Barry Lange Mitchell Meerman Harry Schultz Trevor Spees.
1 Visual Computing Institute | Prof. Dr. Torsten W. Kuhlen Virtual Reality & Immersive Visualization Till Petersen-Krauß | GUI Testing | GUI.
Dynamic Symbolic Execution
Chapter 8 – Software Testing
MIGRATING TO NEW TECHNOLOGY
A Test Case + Mock Class Generator for Coding Against Interfaces
Managing the development of information systems (Part 1)
Introduction to Software Testing
Fundamental Test Process
Presentation transcript:

Automated Testing of System Software (Virtual Machine Monitors) Tao Xie Department of Computer Science North Carolina State University

Automated System Software Testing  Purpose: automated testing of system code bases (e.g., virtual machine monitors) for robustness, security, functionality, coverage..  Often highly environment-dependent software  Challenges Code bases are complex  Heavily interact with system APIs; system behavior depends on environment state, e.g., open("/dev/tty",O_WRONLY) Testing requires sophisticated system setup

Testing Environment-Dependent Software  Test inputs: method arguments, receiver object state & input environment state  Test outputs: method return values, receiver object state & output environment state  Sufficient & safe testing of software generate high-covering tests cause no threat to the environment

Application of Automated Testing Tools  Dynamic symbolic execution tools generate input method arguments and receiver object state Microsoft Pex (C#) and CREST (C)  Empirical study: applied these tools to test Xen, CodePlex Client, and NUnit framework Heavily interact with the file-system environment  Observed results: test generation tools failed to generate high-covering test inputs  Identified problem: required input environment states

Problems  P1: Generating input environment state is beyond the scope of test-generation tools.  P2: Arbitrary program inputs generated by test-generation tools can lead to pollution/threat of the environment states. Example code under test // Code Coverage – Many cases – Environment state 01: public void Add(string localPath, bool recursive,SourceItemCallback callback) 02: { 03: Guard.ArgumentNotNullOrEmpty(localPath, "localPath"); 04: if ( fileSystem.DirectoryExists(localPath) ) 05: AddFolder(localPath, recursive, callback, true); 06: else if ( fileSystem.FileExists(localPath) ) 07: AddFile(localPath, callback, true); // Safe testing – delete directory 01: bool OnBeforeAddItem(SourceItem item) 02: { : if (item.ItemType == ItemType.File) 10: File.Delete(item.LocalName); 11: else 12 : Directory.Delete(item.LocalName); 13: : return (answer == "y" || answer == "a"); 15: }

Outline  Mock objects as a solution to the identified problems  Challenges  Proposed approach  Preliminary results  Future work

Mock Objects  Used to simulate the required environment, avoiding interacting with the real environment  Benefits: Enable unit testing Increase code coverage Ensure safe testing  Challenge: Non-trivial to implement a mock object // Code under test in Mock object based testing approach 01: public void Add(string localPath, bool recursive,SourceItemCallback callback) 02: { 03: Guard.ArgumentNotNullOrEmpty(localPath, "localPath"); 04: if ( mockFileSystem.DirectoryExists (localPath)) 05: AddFolder(localPath, recursive, callback, true); 06: else if ( mockFileSystem.FileExists (localPath)) 07: AddFile(localPath, callback, true);......

Mock Objects (cont.)  Incomplete/incorrect implementation causes false alarms  Non-trivial to implement sophisticated mock object  Tedious task!  Our solution: Systematic approach to build a mock object to pass given tests failed due to insufficient mock object //incorrect implementation public bool DirectoryExists(string path) { return false; } public void CreateDirectory(string path) { listOfCreatedDir.Add(path); } //correct implementation public bool DirectoryExists(string path){ if (listOfCreatedDir.Contains(path)) return true; return false; } public void CreateDirectory(string path){ if (listOfCreatedDir.Contains(path)) return; else listOfCreatedDir.Add(path); }

Approach  Moca (MOCk Assistant) follows Test-Driven Development (TDD) to systematically build a high- quality mock object that is sufficient to achieve effective testing of the code under test without causing any false alarms  Moca makes use of PUTs (Parameterized Unit Tests)  PUTs = unit tests (TUTs) with parameters, including functional specifications  Microsoft research tool, Pex, accepts these PUTs and generates high-covering tests

Approach (cont.)  Input to Moca A set of conventional unit tests (failing due to an insufficient mock object) An environment that needs to be mocked A set of PUTs  Moca assists developers in building a mock object that can be used to replace the real-environment interactions

Approach (cont.) TUT – Conventional unit tests CUM – Class to mock ENV – Environment MUM – Method to mock CUT – Code under test

Preliminary Results  Application on a real-world application, CodePlex Client  Results: Moca can assist developers in building a mock object Effective in achieving high coverage, w/o false alarms Sufficient when compared to a naive implementation, Less complex and thus incurring less effort than a manual sophisticated implementation

Summary  Identified problems with automated testing of environment-dependent software  Conducted empirical study to show benefits of using mock objects and indentify challenges in building mock objects  Proposed an approach based on TDD methodology to build mock objects  Demonstrated the feasibility and benefits of the proposed approach  Also developed new techniques for test generation

Key Outcomes Relevance to military/DoD:  An undergraduate student, Justin Gorham, is working as a summer intern at the Fort Hood Army Electronic Proving Ground (EPG) team in applying Pex and our extensions on Army code bases.  A PhD student, Kunal Taneja, is working as a summer intern at FDA in applying Pex and our extensions on DoD code base for regulatory purposes (mocking databases). Publications:  [AST 09] Madhuri R Marri, Tao Xie, Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte. An Empirical Study of Testing File-System-Dependent Software with Mock Objects. In Proceedings of the 4th International Workshop on Automation of Software Test (AST 2009), Business and Industry Case Studies, pp , May  [Mutation 09] Tao Xie, Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte. Mutation Analysis of Parameterized Unit Tests. In Proceedings of the 4th International Workshop on Mutation Analysis (Mutation 2009), pp , April  [SUITE 09] Madhuri R Marri, Suresh Thummalapenta, and Tao Xie. Improving Software Quality via Code Searching and Mining. In Proceedings of the First International Workshop on Search-Driven Development – Users, Infrastructure, Tools and Evaluation (SUITE 2009), pp , May  [DSN 09] Tao Xie, Nikolai Tillmann, Peli de Halleux, and Wolfram Schulte. Fitness-Guided Path Exploration in Dynamic Symbolic Execution. To appear in Proceedings of the 39th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN 2009), June-July  [ESEC/FSE 09] Suresh Thummalapenta, Tao Xie, Nikolai Tillmann, Peli de Halleux, and Wolfram Schulte. MSeqGen: Object-Oriented Unit-Test Generation via Mining Source Code. To appear in Proceedings of the 7th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE 2009), August 2009.

Other Related Funding Related new funding over the SOSI project period:  NSF CAREER Award: 5 years (Aug 09-July 14) $425,000 “Cooperative Developer Testing with Test Intentions” Other ongoing supports  ARO Award: 3 years (Sept 08-Aug 11) $300,000 “ Mining Program Source Code for Improving Software Quality”  NSF SoD Award: 3 years (Jan 08-Dec 10) $245,000 “Collaborative Research: SoD-TEAM: Designing Tests for Evolving Software Systems”  NSF CyberTrust Award: 3 years (Aug 07-July 10) $227,275 “CT-ISG: Collaborative Research: A New Approach to Testing and Verification of Security Policies”

Future Directions  Test generation Guided exploration of paths [DSN 09] Method-sequence generation [ESEC/FSE 09] Security (attack)/access control test generation (w/ NIST) Performance testing Embedded/network/db/SOA-app test generation  Dealing with environments Fully automate Moca Domain-specific mock object tools/libraries (e.g., file system, database, network, hardware environments)  Test oracles Detection of insufficiency of assertions Inference of normal behavior as approximate oracles

Questions? More info on research of NCSU Automated Software Engineering Group:    Recent industry impact Our Fitnex strategy [DSN 09] integrated in Microsoft Research Pex as its default strategy (second half of 2008, download count of 5,600)