OCAT: Object Capture based Automated Testing (ISSTA 2010)

Sung Kim
Sung KimAssociate Prof.
OCAT: Object Capture based
        Automated Testing


                       Hojun Jaygarl, Carl K. Chang
                                       Iowa State University
                                          Sunghun Kim
        The Hong Kong University of Science and Technology
                                                 Tao Xie
                             North Carolina State University


                                        ISSTA 2010
Problem




          Generating object inputs is hard
     in Object-Oriented (OO) unit testing




2
Automated Test Generation (ATG)



    Automatically generate test inputs for a unit.


    Reduce manual efforts in OO unit testing.




3
Two Main Types of ATG Techniques
   Direct object construction
       Directly assign values to object fields of the object instance
       E.g., Korat [ISSTA'02]


   Method sequence generation
       Generate method sequences that can produce an object
        instance under construction
       E.g., Randoop [ICSE’07], Pex [TAP'08]
Results of the State of the Arts in ATG
       Pex
           Pex automatically generates test inputs.
           Dynamic Symbolic Execution
           21% of branch coverage [Thummalapenta et al. FSE '09] for
            QuickGraph, a C# graph library.
       Randoop
           Randoop automatically generates method sequences
           Random but feedback directed
           58% of branch coverage [Thummalapenta et al. FSE '09]
           45% according to our evaluation for Apache Common Collections
            3.2
    5
Case of not-covered branches
Cause of not-                   # of branches             Explanation
covered branches
Insufficient object             135 (46.3%)               unable to generate desirable object instances
                                                          required to cover certain branches.
String comparison               61 (20.9%)                Difficult to randomly find a desirable string to satisfy
                                                          such constraints, since the input space of string type
                                                          values is huge.

Container object access 39 (13.4%)                        Not easy to create a certain size of a container with
                                                          necessary elements.

Array comparison                25 (8.6%)                 Not easy to create a certain size of an array with
                                                          necessary elements.

Exception branches              18 (6.1%)                 These branches have a particularity of exception
                                                          handling code that handles run-time errors

Environmental setting           9 (3.1%)
                                                                    Almost 90%
                                                          Hard to get environment variables and file-system
                                                          structure.

Non-deterministic               4 (1.3%)                  Hard to handle multi-threading and user interactions
branch


 6              Run Randoop for three projects Apache Commons, XML Security, and JSAP
                 We randomly selected 10 source code files from each subject and investigated the causes of uncovered branches.
Not-Covered Branch Example




                             Checks the
                             validity of
                               “doc”




7
Limitations of Current Approaches
       Korat
           Require manual efforts for writing class invariants and value
            domains.
       Pex
           Pex uses built-in simple heuristics for generating fixed
            sequences, which are often ineffective.
       Randoop
           Random approach cannot generate relevant sequences that
            produce desirable object instances.


    8
Idea
       Practical approach (high coverage)


       Reflect real usage


       Easier process

                             Object capture based
                              Automated Testing

    9
OCAT Overview




10
Capturing Process

    Instrument the target program


    Capture objects
        From program execution
        From system test execution




    11
Instrumentation
    Byte code instrumentation




    12
Serialization
    Get a type and a concrete state of captured objects.


    Prune redundant objects.


    A concrete state representation for the state-equality
     checking [Xie et al. ASE’04]




    13
Serialized Object Example
    A list that has bank accounts




    14
Object Generation
    Feed captured objects to an existing automated method
     sequence generation technique.


                                 Method
          Object                             Sequences
                                Sequences                Execution
         Capturing   Captured   Generation
                      objects
                                             Generated
                                              objects




    15
Usage of Captured Objects
    Captured objects are de-serialized and used as test inputs.
    Evolved Objects

                Captured         foo(A)                    New
              instance of A     returns A             instance of A


        Indirect usage

              Captured            bar(A)                  New
            instance of A        returns B            instance of B




    16
Method Sequence with Captured Objects




17
Evaluation - Setup




18
Evaluation - Captured Objects
    Q1 How much can OCAT
     improve code coverage
     through captured object
     instances?


    19.0% improved from
     45.2%




    19
Evaluation- Captured Objects
    28.5% and 17.3% improved from 29.6% and 54.1%




    20
Object Mutation
Approach – Object Mutation (MTT)
AbstractReferenceMap




 22
Evaluation- Mutated Objects
    Q2 How much can mutated object instances further improve
     code coverage?




    23
Evaluation- Total
    25.5% improved on average, with maximum 32.7%
                             32.7%

22.9%


                                              20.9%




    24
Why is It a Feasible Idea?
   Reflect real usage


   Potential for being desirable inputs in
    achieving new branch coverage


   Capturing objects is easy


25
Discussion
    Object Capturing Process
        Problem: OCAT’s coverage depends on captured objects
        Capturing objects is an easy process (but we still need to
         capture “good-enough” objects).


    Captured Objects and Software Evolution
        Problem: software evolves and objects are changing.
        Captured object instances may be obsolete and not be valid
         anymore.

    26
Discussion
        Branches to Cover
         Problem: Still not-covered branches are more than 20%.
         Cross-system object capturing
             objects can be captured from system A and used for system B.
         Static analysis
             currently we use a simple static analysis.
         Iterative process
             two phases, object generation and object mutation, can be
              iteratively applied



    27
Threats to Validity
    Software under test might not be representative
        Our three subjects may yield better or worse OCAT
         coverage than that of other software projects.


    Our object capturing relies on the existing tests
        OCAT test coverage reported in this paper depends on
         the quality and quantity of existing tests.




    28
Conclusions
    Problem
         Hard to generate desirable object instances in OO unit
          testing.


        OCAT approach
         Capture objects from program execution.
         Generate more objects with method sequence generation.
         Mutate directly the captured objects to try to cover those
          not-yet-covered branches.


    29
Conclusions
    Results
        OCAT helps Randoop to achieve high branch coverage
         averagely 68.5%
        25.5% improved (with maximum 32.7%) from only 43.0%
         achieved by Randoop alone.
    Future work
        Enhance static analysis part
        Apply captured objects to other state-of-the-art techniques
         (e.g., parameterized unit testing, concolic testing, and
         model checking approaches).
     
    30
         Release the tool.
Thank you!




31
1 of 31

Recommended

Online Workflow Management and Performance Analysis with Stampede by
Online Workflow Management and Performance Analysis with StampedeOnline Workflow Management and Performance Analysis with Stampede
Online Workflow Management and Performance Analysis with StampedeDan Gunter
1.1K views35 slides
Testing of Cyber-Physical Systems: Diversity-driven Strategies by
Testing of Cyber-Physical Systems: Diversity-driven StrategiesTesting of Cyber-Physical Systems: Diversity-driven Strategies
Testing of Cyber-Physical Systems: Diversity-driven StrategiesLionel Briand
362 views41 slides
Moving Object Detection And Tracking Using CNN by
Moving Object Detection And Tracking Using CNNMoving Object Detection And Tracking Using CNN
Moving Object Detection And Tracking Using CNNNITISHKUMAR1401
345 views19 slides
Metamorphic Security Testing for Web Systems by
Metamorphic Security Testing for Web SystemsMetamorphic Security Testing for Web Systems
Metamorphic Security Testing for Web SystemsLionel Briand
441 views35 slides
Automating System Test Case Classification and Prioritization for Use Case-Dr... by
Automating System Test Case Classification and Prioritization for Use Case-Dr...Automating System Test Case Classification and Prioritization for Use Case-Dr...
Automating System Test Case Classification and Prioritization for Use Case-Dr...Lionel Briand
373 views30 slides
The relationship between test and production code quality (@ SIG) by
The relationship between test and production code quality (@ SIG)The relationship between test and production code quality (@ SIG)
The relationship between test and production code quality (@ SIG)Maurício Aniche
1.1K views29 slides

More Related Content

What's hot

STAR: Stack Trace based Automatic Crash Reproduction by
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSung Kim
7K views99 slides
Software Defect Prediction on Unlabeled Datasets by
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSung Kim
16.7K views86 slides
Mining Assumptions for Software Components using Machine Learning by
Mining Assumptions for Software Components using Machine LearningMining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine LearningLionel Briand
1.3K views47 slides
Testing Machine Learning-enabled Systems: A Personal Perspective by
Testing Machine Learning-enabled Systems: A Personal PerspectiveTesting Machine Learning-enabled Systems: A Personal Perspective
Testing Machine Learning-enabled Systems: A Personal PerspectiveLionel Briand
1.2K views96 slides
Dissertation Defense by
Dissertation DefenseDissertation Defense
Dissertation DefenseSung Kim
17K views87 slides
Applications of Machine Learning and Metaheuristic Search to Security Testing by
Applications of Machine Learning and Metaheuristic Search to Security TestingApplications of Machine Learning and Metaheuristic Search to Security Testing
Applications of Machine Learning and Metaheuristic Search to Security TestingLionel Briand
697 views56 slides

What's hot(20)

STAR: Stack Trace based Automatic Crash Reproduction by Sung Kim
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash Reproduction
Sung Kim7K views
Software Defect Prediction on Unlabeled Datasets by Sung Kim
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
Sung Kim16.7K views
Mining Assumptions for Software Components using Machine Learning by Lionel Briand
Mining Assumptions for Software Components using Machine LearningMining Assumptions for Software Components using Machine Learning
Mining Assumptions for Software Components using Machine Learning
Lionel Briand1.3K views
Testing Machine Learning-enabled Systems: A Personal Perspective by Lionel Briand
Testing Machine Learning-enabled Systems: A Personal PerspectiveTesting Machine Learning-enabled Systems: A Personal Perspective
Testing Machine Learning-enabled Systems: A Personal Perspective
Lionel Briand1.2K views
Dissertation Defense by Sung Kim
Dissertation DefenseDissertation Defense
Dissertation Defense
Sung Kim17K views
Applications of Machine Learning and Metaheuristic Search to Security Testing by Lionel Briand
Applications of Machine Learning and Metaheuristic Search to Security TestingApplications of Machine Learning and Metaheuristic Search to Security Testing
Applications of Machine Learning and Metaheuristic Search to Security Testing
Lionel Briand697 views
Heterogeneous Defect Prediction (

ESEC/FSE 2015) by Sung Kim
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Sung Kim2.2K views
System Testing of Timing Requirements based on Use Cases and Timed Automata by Lionel Briand
System Testing of Timing Requirements based on Use Cases and Timed AutomataSystem Testing of Timing Requirements based on Use Cases and Timed Automata
System Testing of Timing Requirements based on Use Cases and Timed Automata
Lionel Briand650 views
A Search-based Testing Approach for XML Injection Vulnerabilities in Web Appl... by Lionel Briand
A Search-based Testing Approach for XML Injection Vulnerabilities in Web Appl...A Search-based Testing Approach for XML Injection Vulnerabilities in Web Appl...
A Search-based Testing Approach for XML Injection Vulnerabilities in Web Appl...
Lionel Briand587 views
IRJET- Object Detection and Recognition using Single Shot Multi-Box Detector by IRJET Journal
IRJET- Object Detection and Recognition using Single Shot Multi-Box DetectorIRJET- Object Detection and Recognition using Single Shot Multi-Box Detector
IRJET- Object Detection and Recognition using Single Shot Multi-Box Detector
IRJET Journal54 views
Scalable Software Testing and Verification of Non-Functional Properties throu... by Lionel Briand
Scalable Software Testing and Verification of Non-Functional Properties throu...Scalable Software Testing and Verification of Non-Functional Properties throu...
Scalable Software Testing and Verification of Non-Functional Properties throu...
Lionel Briand478 views
Joshua bloch effect java chapter 3 by Kamal Mukkamala
Joshua bloch effect java   chapter 3Joshua bloch effect java   chapter 3
Joshua bloch effect java chapter 3
Kamal Mukkamala3.4K views
Automated Testing of Autonomous Driving Assistance Systems by Lionel Briand
Automated Testing of Autonomous Driving Assistance SystemsAutomated Testing of Autonomous Driving Assistance Systems
Automated Testing of Autonomous Driving Assistance Systems
Lionel Briand1.5K views
Automated and Scalable Solutions for Software Testing: The Essential Role of ... by Lionel Briand
Automated and Scalable Solutions for Software Testing: The Essential Role of ...Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Lionel Briand355 views
Cross-project Defect Prediction Using A Connectivity-based Unsupervised Class... by Feng Zhang
Cross-project Defect Prediction Using A Connectivity-based Unsupervised Class...Cross-project Defect Prediction Using A Connectivity-based Unsupervised Class...
Cross-project Defect Prediction Using A Connectivity-based Unsupervised Class...
Feng Zhang480 views
OCLR: A More Expressive, Pattern-Based Temporal Extension of OCL by Lionel Briand
OCLR: A More Expressive, Pattern-Based Temporal Extension of OCLOCLR: A More Expressive, Pattern-Based Temporal Extension of OCL
OCLR: A More Expressive, Pattern-Based Temporal Extension of OCL
Lionel Briand613 views
Keynote SBST 2014 - Search-Based Testing by Lionel Briand
Keynote SBST 2014 - Search-Based TestingKeynote SBST 2014 - Search-Based Testing
Keynote SBST 2014 - Search-Based Testing
Lionel Briand2.3K views
Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ... by Lionel Briand
Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ...Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ...
Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ...
Lionel Briand156 views
A practical guide for using Statistical Tests to assess Randomized Algorithms... by Lionel Briand
A practical guide for using Statistical Tests to assess Randomized Algorithms...A practical guide for using Statistical Tests to assess Randomized Algorithms...
A practical guide for using Statistical Tests to assess Randomized Algorithms...
Lionel Briand281 views
Transfer defect learning by Sung Kim
Transfer defect learningTransfer defect learning
Transfer defect learning
Sung Kim3.2K views

Viewers also liked

Crowd debugging (FSE 2015) by
Crowd debugging (FSE 2015)Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)Sung Kim
1.9K views33 slides
A Survey on Automatic Software Evolution Techniques by
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesSung Kim
1.1K views51 slides
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria... by
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...Sung Kim
2.5K views16 slides
Random testing & prototyping by
Random testing & prototypingRandom testing & prototyping
Random testing & prototypingVipul Rastogi
569 views18 slides
Tensor board by
Tensor boardTensor board
Tensor boardSung Kim
8.4K views17 slides
Time series classification by
Time series classificationTime series classification
Time series classificationSung Kim
5.7K views29 slides

Viewers also liked(6)

Crowd debugging (FSE 2015) by Sung Kim
Crowd debugging (FSE 2015)Crowd debugging (FSE 2015)
Crowd debugging (FSE 2015)
Sung Kim1.9K views
A Survey on Automatic Software Evolution Techniques by Sung Kim
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
Sung Kim1.1K views
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria... by Sung Kim
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
Sung Kim2.5K views
Random testing & prototyping by Vipul Rastogi
Random testing & prototypingRandom testing & prototyping
Random testing & prototyping
Vipul Rastogi569 views
Tensor board by Sung Kim
Tensor boardTensor board
Tensor board
Sung Kim8.4K views
Time series classification by Sung Kim
Time series classificationTime series classification
Time series classification
Sung Kim5.7K views

Similar to OCAT: Object Capture based Automated Testing (ISSTA 2010)

Icsm08a.ppt by
Icsm08a.pptIcsm08a.ppt
Icsm08a.pptYann-Gaël Guéhéneuc
24 views29 slides
Anomaly Detection with Azure and .NET by
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETMarco Parenzan
203 views43 slides
Anomaly Detection with Azure and .net by
Anomaly Detection with Azure and .netAnomaly Detection with Azure and .net
Anomaly Detection with Azure and .netMarco Parenzan
116 views42 slides
Introduction to Snabbkaffe by
Introduction to SnabbkaffeIntroduction to Snabbkaffe
Introduction to SnabbkaffeEMQ
62 views46 slides
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap... by
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...knowdiff
487 views41 slides
Testing survey by_directions by
Testing survey by_directionsTesting survey by_directions
Testing survey by_directionsTao He
670 views47 slides

Similar to OCAT: Object Capture based Automated Testing (ISSTA 2010)(20)

Anomaly Detection with Azure and .NET by Marco Parenzan
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
Marco Parenzan203 views
Anomaly Detection with Azure and .net by Marco Parenzan
Anomaly Detection with Azure and .netAnomaly Detection with Azure and .net
Anomaly Detection with Azure and .net
Marco Parenzan116 views
Introduction to Snabbkaffe by EMQ
Introduction to SnabbkaffeIntroduction to Snabbkaffe
Introduction to Snabbkaffe
EMQ62 views
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap... by knowdiff
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
knowdiff487 views
Testing survey by_directions by Tao He
Testing survey by_directionsTesting survey by_directions
Testing survey by_directions
Tao He670 views
Enabling Automated Software Testing with Artificial Intelligence by Lionel Briand
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial Intelligence
Lionel Briand380 views
The Status of ML Algorithms for Structure-property Relationships Using Matb... by Anubhav Jain
The Status of ML Algorithms for Structure-property Relationships Using Matb...The Status of ML Algorithms for Structure-property Relationships Using Matb...
The Status of ML Algorithms for Structure-property Relationships Using Matb...
Anubhav Jain88 views
Android Malware 2020 (CCCS-CIC-AndMal-2020) by Indraneel Dabhade
Android Malware 2020 (CCCS-CIC-AndMal-2020)Android Malware 2020 (CCCS-CIC-AndMal-2020)
Android Malware 2020 (CCCS-CIC-AndMal-2020)
Indraneel Dabhade451 views
findbugs Bernhard Merkle by bmerkle
findbugs Bernhard Merklefindbugs Bernhard Merkle
findbugs Bernhard Merkle
bmerkle2.3K views
Accelerated test case - Anish bhanu by Roopa Nadkarni
Accelerated test case - Anish bhanuAccelerated test case - Anish bhanu
Accelerated test case - Anish bhanu
Roopa Nadkarni788 views
Product defect detection based on convolutional autoencoder and one-class cla... by IAESIJAI
Product defect detection based on convolutional autoencoder and one-class cla...Product defect detection based on convolutional autoencoder and one-class cla...
Product defect detection based on convolutional autoencoder and one-class cla...
IAESIJAI28 views
IEEE 2015 Java Projects by Vijay Karan
IEEE 2015 Java ProjectsIEEE 2015 Java Projects
IEEE 2015 Java Projects
Vijay Karan285 views
IEEE 2015 Java Projects by Vijay Karan
IEEE 2015 Java ProjectsIEEE 2015 Java Projects
IEEE 2015 Java Projects
Vijay Karan90 views
QTP/UFT Overview and Installation by Murageppa-QA
QTP/UFT Overview and InstallationQTP/UFT Overview and Installation
QTP/UFT Overview and Installation
Murageppa-QA100 views
A framework and approaches to develop an in-house CAT with freeware and open ... by Tetsuo Kimura
A framework and approaches to develop an in-house CAT with freeware and open ...A framework and approaches to develop an in-house CAT with freeware and open ...
A framework and approaches to develop an in-house CAT with freeware and open ...
Tetsuo Kimura1.9K views
Automated Machine Learning Applied to Diverse Materials Design Problems by Anubhav Jain
Automated Machine Learning Applied to Diverse Materials Design ProblemsAutomated Machine Learning Applied to Diverse Materials Design Problems
Automated Machine Learning Applied to Diverse Materials Design Problems
Anubhav Jain533 views

More from Sung Kim

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning by
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningSung Kim
1.3K views23 slides
Deep API Learning (FSE 2016) by
Deep API Learning (FSE 2016)Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)Sung Kim
1.4K views25 slides
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015) by
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Sung Kim
1.6K views24 slides
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014) by
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Sung Kim
1.9K views65 slides
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2... by
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...Sung Kim
2.2K views34 slides
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014) by
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)Sung Kim
6.4K views31 slides

More from Sung Kim(20)

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning by Sung Kim
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
Sung Kim1.3K views
Deep API Learning (FSE 2016) by Sung Kim
Deep API Learning (FSE 2016)Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)
Sung Kim1.4K views
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015) by Sung Kim
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Sung Kim1.6K views
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014) by Sung Kim
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Automatically Generated Patches as Debugging Aids: A Human Study (FSE 2014)
Sung Kim1.9K views
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2... by Sung Kim
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
Sung Kim2.2K views
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014) by Sung Kim
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
Sung Kim6.4K views
Source code comprehension on evolving software by Sung Kim
Source code comprehension on evolving softwareSource code comprehension on evolving software
Source code comprehension on evolving software
Sung Kim1.6K views
A Survey on Dynamic Symbolic Execution for Automatic Test Generation by Sung Kim
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
Sung Kim3.1K views
Survey on Software Defect Prediction by Sung Kim
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect Prediction
Sung Kim14.1K views
MSR2014 opening by Sung Kim
MSR2014 openingMSR2014 opening
MSR2014 opening
Sung Kim17K views
Personalized Defect Prediction by Sung Kim
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect Prediction
Sung Kim3.7K views
Automatic patch generation learned from human written patches by Sung Kim
Automatic patch generation learned from human written patchesAutomatic patch generation learned from human written patches
Automatic patch generation learned from human written patches
Sung Kim9.2K views
The Anatomy of Developer Social Networks by Sung Kim
The Anatomy of Developer Social NetworksThe Anatomy of Developer Social Networks
The Anatomy of Developer Social Networks
Sung Kim835 views
A Survey on Automatic Test Generation and Crash Reproduction by Sung Kim
A Survey on Automatic Test Generation and Crash ReproductionA Survey on Automatic Test Generation and Crash Reproduction
A Survey on Automatic Test Generation and Crash Reproduction
Sung Kim2.1K views
How Do Software Engineers Understand Code Changes? FSE 2012 by Sung Kim
How Do Software Engineers Understand Code Changes? FSE 2012How Do Software Engineers Understand Code Changes? FSE 2012
How Do Software Engineers Understand Code Changes? FSE 2012
Sung Kim1.8K views
Defect, defect, defect: PROMISE 2012 Keynote by Sung Kim
Defect, defect, defect: PROMISE 2012 Keynote Defect, defect, defect: PROMISE 2012 Keynote
Defect, defect, defect: PROMISE 2012 Keynote
Sung Kim4.5K views
Predicting Recurring Crash Stacks (ASE 2012) by Sung Kim
Predicting Recurring Crash Stacks (ASE 2012)Predicting Recurring Crash Stacks (ASE 2012)
Predicting Recurring Crash Stacks (ASE 2012)
Sung Kim1.6K views
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz... by Sung Kim
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Sung Kim1.8K views
Software Development Meets the Wisdom of Crowds by Sung Kim
Software Development Meets the Wisdom of CrowdsSoftware Development Meets the Wisdom of Crowds
Software Development Meets the Wisdom of Crowds
Sung Kim1.4K views
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009) by Sung Kim
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)
Sung Kim2.1K views

Recently uploaded

CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueShapeBlue
135 views13 slides
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...ShapeBlue
173 views15 slides
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
147 views23 slides
The Power of Generative AI in Accelerating No Code Adoption.pdf by
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdfSaeed Al Dhaheri
32 views18 slides
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueShapeBlue
222 views7 slides
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...ShapeBlue
139 views29 slides

Recently uploaded(20)

CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue135 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue173 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri32 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue222 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue139 views
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... by BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada41 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue106 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10123 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays33 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software176 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE79 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10139 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li85 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash158 views

OCAT: Object Capture based Automated Testing (ISSTA 2010)

  • 1. OCAT: Object Capture based Automated Testing Hojun Jaygarl, Carl K. Chang Iowa State University Sunghun Kim The Hong Kong University of Science and Technology Tao Xie North Carolina State University ISSTA 2010
  • 2. Problem Generating object inputs is hard in Object-Oriented (OO) unit testing 2
  • 3. Automated Test Generation (ATG) Automatically generate test inputs for a unit. Reduce manual efforts in OO unit testing. 3
  • 4. Two Main Types of ATG Techniques  Direct object construction  Directly assign values to object fields of the object instance  E.g., Korat [ISSTA'02]  Method sequence generation  Generate method sequences that can produce an object instance under construction  E.g., Randoop [ICSE’07], Pex [TAP'08]
  • 5. Results of the State of the Arts in ATG  Pex  Pex automatically generates test inputs.  Dynamic Symbolic Execution  21% of branch coverage [Thummalapenta et al. FSE '09] for QuickGraph, a C# graph library.  Randoop  Randoop automatically generates method sequences  Random but feedback directed  58% of branch coverage [Thummalapenta et al. FSE '09]  45% according to our evaluation for Apache Common Collections 3.2 5
  • 6. Case of not-covered branches Cause of not- # of branches Explanation covered branches Insufficient object 135 (46.3%) unable to generate desirable object instances required to cover certain branches. String comparison 61 (20.9%) Difficult to randomly find a desirable string to satisfy such constraints, since the input space of string type values is huge. Container object access 39 (13.4%) Not easy to create a certain size of a container with necessary elements. Array comparison 25 (8.6%) Not easy to create a certain size of an array with necessary elements. Exception branches 18 (6.1%) These branches have a particularity of exception handling code that handles run-time errors Environmental setting 9 (3.1%) Almost 90% Hard to get environment variables and file-system structure. Non-deterministic 4 (1.3%) Hard to handle multi-threading and user interactions branch 6  Run Randoop for three projects Apache Commons, XML Security, and JSAP We randomly selected 10 source code files from each subject and investigated the causes of uncovered branches.
  • 7. Not-Covered Branch Example Checks the validity of “doc” 7
  • 8. Limitations of Current Approaches  Korat  Require manual efforts for writing class invariants and value domains.  Pex  Pex uses built-in simple heuristics for generating fixed sequences, which are often ineffective.  Randoop  Random approach cannot generate relevant sequences that produce desirable object instances. 8
  • 9. Idea  Practical approach (high coverage)  Reflect real usage  Easier process Object capture based Automated Testing 9
  • 11. Capturing Process  Instrument the target program  Capture objects  From program execution  From system test execution 11
  • 12. Instrumentation  Byte code instrumentation 12
  • 13. Serialization  Get a type and a concrete state of captured objects.  Prune redundant objects.  A concrete state representation for the state-equality checking [Xie et al. ASE’04] 13
  • 14. Serialized Object Example  A list that has bank accounts 14
  • 15. Object Generation  Feed captured objects to an existing automated method sequence generation technique. Method Object Sequences Sequences Execution Capturing Captured Generation objects Generated objects 15
  • 16. Usage of Captured Objects  Captured objects are de-serialized and used as test inputs.  Evolved Objects Captured foo(A) New instance of A returns A instance of A  Indirect usage Captured bar(A) New instance of A returns B instance of B 16
  • 17. Method Sequence with Captured Objects 17
  • 19. Evaluation - Captured Objects  Q1 How much can OCAT improve code coverage through captured object instances?  19.0% improved from 45.2% 19
  • 20. Evaluation- Captured Objects  28.5% and 17.3% improved from 29.6% and 54.1% 20
  • 22. Approach – Object Mutation (MTT) AbstractReferenceMap 22
  • 23. Evaluation- Mutated Objects  Q2 How much can mutated object instances further improve code coverage? 23
  • 24. Evaluation- Total  25.5% improved on average, with maximum 32.7% 32.7% 22.9% 20.9% 24
  • 25. Why is It a Feasible Idea?  Reflect real usage  Potential for being desirable inputs in achieving new branch coverage  Capturing objects is easy 25
  • 26. Discussion  Object Capturing Process  Problem: OCAT’s coverage depends on captured objects  Capturing objects is an easy process (but we still need to capture “good-enough” objects).  Captured Objects and Software Evolution  Problem: software evolves and objects are changing.  Captured object instances may be obsolete and not be valid anymore. 26
  • 27. Discussion  Branches to Cover  Problem: Still not-covered branches are more than 20%.  Cross-system object capturing  objects can be captured from system A and used for system B.  Static analysis  currently we use a simple static analysis.  Iterative process  two phases, object generation and object mutation, can be iteratively applied 27
  • 28. Threats to Validity  Software under test might not be representative  Our three subjects may yield better or worse OCAT coverage than that of other software projects.  Our object capturing relies on the existing tests  OCAT test coverage reported in this paper depends on the quality and quantity of existing tests. 28
  • 29. Conclusions  Problem  Hard to generate desirable object instances in OO unit testing.  OCAT approach  Capture objects from program execution.  Generate more objects with method sequence generation.  Mutate directly the captured objects to try to cover those not-yet-covered branches. 29
  • 30. Conclusions  Results  OCAT helps Randoop to achieve high branch coverage averagely 68.5%  25.5% improved (with maximum 32.7%) from only 43.0% achieved by Randoop alone.  Future work  Enhance static analysis part  Apply captured objects to other state-of-the-art techniques (e.g., parameterized unit testing, concolic testing, and model checking approaches).  30 Release the tool.

Editor's Notes

  1. Nice to meet you. I’m Hojun Jaygarl from Iowa State University. I’m gonna present the paper called OCAT, Object capture-based Automated Testing. Professor Sunghun Kim from HKUST, and Tao Xie from NCSU helped me to publish this paper and Professor Carl Chang is my advisor.
  2. As all people know in this room, generating objects is hard. Object-oriented program are commonly used in these days even in the firmware level. However, many automated test input generating algorithms have low structural coverage (e.g., less than 50% branch coverage) Why? because, search space for object instances is huge. For example, Assume there is target branch that needs an ArrayList which has 500 elements of BankAccount and check 499 th elements of it. It’s very hard to generate it.
  3. As a preliminary experiment, we’ve investigated what’s the main causes of not-covered branches from Randoop. We select 30 source files from 3 open-source projects and categorize the causes.
  4. This is the one example of not-covered branch with insufficient object inputs. As you seen in this source, this is a constructor of Algorithm class and it needs an object input of Document class. a constructor of super class actually checks the validity of Document class, thus without having the Document class, we cannot generate Algorithm instance also, therefore, we cannot test any method in Algorithm class.
  5. Current approaches to generate object input has some limitations. Korat needs manual efforts for writing class invariants and value domains. Pex uses .. Randoop cannot generate..
  6. This slide shows an overview idea of OCAT. First of all, we capture objects from program execution such as system tests, regression tests, normal or planned program execution. After capturing objects, we seed these objects into a method sequence generation technique. By generating method sequences with captured object, more objects can be generated. Since these inputs reflect real usage, capturing these inputs and exploiting them in automated testing provide great potential for being desirable in achieving new branch coverage. After using method sequence generation, we checks not-covered branches. We are doing this because method sequence generation approach might quickly cover most branches, but cannot touch some complex branches. So, we do static analysis of not-covered branches. If we can get a value that needs for the not-covered branches, we directly mutated captured objects based on the SMT solver’s answer. All these captured and generated and mutated objects can be used and test inputs and achieve high code coverage.
  7. Let’s talk about capturing process. First, we need to instrument the target program. And then, by running the target program we can capture objects.
  8. This is an example of captured program. Actually the instrumentation is done in the byte code level of Java. We instrument the code that call our capturing library into entry points of method calls. So now by executing the program that uses this Algorithm class, we can capture Algorithm class as a receiver, and Document instance and string algorithmURI.
  9. If the capture method is called, the method gets a type and a concrete state of an object to be stored. and we keep types and states of all stated objects to maintain an object repository with redundant objects eliminated. We use a concrete state representation for the state-equality checking.
  10. This is an example to show how actually object instances are saved. Assume we captured an array list of bank accounts, that will be saved as an xml file. BankAccount has three fields and we can see the values of fields in the XML.
  11. OCAT generates the more objects by feeding captured objects to an existing automated method sequence generation technique. The captured objects are evolved to achieve high coverage by constructing and executing method sequences.
  12. When captured objects are used for method sequence generation, it uses in two ways. It can be directly used as you see in the first diagram, and it can be used indirectly as you see in the second diagram. If the directly used one generate more objects, it can be used to test other methods.
  13. This is the example of a method sequence that generated with captured objects. Assume there is a target method that needs a input of Map container. Method sequence generator produces method invocations of loading captured objects. TreeMap, String, BeanMap and integer. By generating method sequences, we produce more object instance by evolving capture objects.
  14. Instead of having toy projects for evaluation, we use open-source projects. Apache Commons Collections (ACC) : is an extended collection library that provides new utilities, such as buffer, queue, and map. Apache XML Security (AXS) : is a library implementing the XML Digital Signature Specification and XML Encryption Specification. JSAP : is a command-line argument parser.
  15. Now I’m going to present the first result of our approach. So, how much can OCAT improve code coverage through captured object instance with method sequence generation? The first line is our approach and blue line is Randoop and the dotted line shows a coverage of our execution for capturing objects. We measured based on the number of tests has been generated by both our approach and randoop. As a result, 19% has been improved from 45.2% which Randoop achived.
  16. You can see the result of XML security is significant because this open source project needs lots of legitimate XML inputs. Even if we have strong string constrain solver, it’s difficult to generate inputs like XML data. These results suggest that captured object instances plays an important role to improve code coverage by assisting an existing testing technique. We observe that the captured object instances are influenced by the original set of tests provided with the subject system. However, the OCAT’s achieved coverage is much higher than the coverage achieve by simply executing these original tests because captured object instances can lead a random generation technique to cover more branches.
  17. Captured and generated objects may not be able to cover all branches. CAPTIG mutates captured objects to try to satisfy constraints on conditionals related to not-yet-covered branches. SMT: Satifiability Modulo Theory
  18. This is the example of mutation. In the AbstractReferenceMap class, there is one branch that has not been covered, since ATG cannot generate the instance of AbstractRefereceMap. We already know the true path of this branch has not been covered, so we extract precondition of it by static analysis. We put the extracted precondition into SMT solver, and get a value. Because we have captured objects, we simply change the object instance with the value we got and check whether the new mutated object instance satisfies the branch condition.
  19. OCAT (mutated objects) can still improve approximately 4% of code coverage. This might not be significant since we are using very simple static analysis technique. We still can see the improvement which is not trivial.
  20. Overall, 22.9% of branch coverage improved from for ACC 32.7% “” for AXS and 20.9% for JSAP. On average 25.5% has been increased
  21. The captured object instances reflect real usage of object instances. Capturing these object instances and exploiting them provide great potential for being desirable in achieving new branch coverage Capturing objects is easier than writing a specification or an initial test case.
  22. graphic
  23. graphic
  24. Testing object-oriented (OO) software is critical OO languages have been commonly used. Many automated test input generating algorithms low structural coverage (e.g., less than 50% branch coverage) Challenges search space for object instances is huge. near half of difficult-to-cover branches require desirable objects. The main difference between unit tests of procedural languages (such as C) and object-oriented languages (such as C++ and Java) is that in procedural languages, a tester only needs to prepare input arguments for tested functions plus global variables, but in object-oriented languages, a tester needs to prepare both re- ceiver and argument object instances.