JMLAutoTest and Its Double- phase Testing Way Guoqing Xu Com Sci., East China Normal Univ. Shanghai 200062, PRC FATES 2003, Montreal, Canada, Oct.6th 2003.

Slides:



Advertisements
Similar presentations
Korat Automated Testing Based on Java Predicates Chandrasekhar Boyapati, Sarfraz Khurshid, Darko Marinov MIT ISSTA 2002 Rome, Italy.
Advertisements

Random Forest Predrag Radenković 3237/10
Max Cut Problem Daniel Natapov.
CPSC 502, Lecture 15Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 15 Nov, 1, 2011 Slide credit: C. Conati, S.
Fast Algorithms For Hierarchical Range Histogram Constructions
1 Video Processing Lecture on the image part (8+9) Automatic Perception Volker Krüger Aalborg Media Lab Aalborg University Copenhagen
Dept. of Computer Science A Runtime Assertion Checker for the Java Modeling Language (JML) Yoonsik Cheon and Gary T. Leavens SERP 2002, June 24-27, 2002.
Evaluation.
Decision Tree Algorithm
Evaluation.
Ensemble Learning: An Introduction
Evaluating Hypotheses
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Experimental Evaluation
The Calibration Process
Lehrstuhl für Informatik 2 Gabriella Kókai: Maschine Learning 1 Evaluating Hypotheses.
Cmpt-225 Simulation. Application: Simulation Simulation  A technique for modeling the behavior of both natural and human-made systems  Goal Generate.
“There are three types of lies: Lies, Damn Lies and Statistics” - Mark Twain.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
1/23/2003University of Virginia1 Korat: Automated Testing Based on Java Predicates CS751 Presentation by Radu Stoleru C.Boyapaty, S.Khurshid, D.Marinov.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing
Test Design Techniques
MS Access: Database Concepts Instructor: Vicki Weidler.
Natural Language Processing Lab Northeastern University, China Feiliang Ren EBMT Based on Finite Automata State Transfer Generation Feiliang Ren.
1/20 Symbolic Execution and Program Testing Charngki PSWLAB Symbolic Execution and Program Testing James C.King IBM Thomas J.Watson Research Center.
1 Academic Skills Tips for Essay Writing. 2 Outline of today’s lecture Academic skills Essay writing Paraphrasing Summarizing.
Introduction Telerik Software Academy Software Quality Assurance.
Chapter 2 Modeling and Finding Abnormal Nodes. How to define abnormal nodes ? One plausible answer is : –A node is abnormal if there are no or very few.
Presented by Tienwei Tsai July, 2005
07 Coding Conventions. 2 Demonstrate Developing Local Variables Describe Separating Public and Private Members during Declaration Explore Using System.exit.
Model Programs for Preserving Composite Invariants SAVCBS 2008 Challenge Problem Solution by Steve Shaner, Hridesh Rajan, Gary T. Leavens Iowa State and.
HW/SW PARTITIONING OF FLOATING POINT SOFTWARE APPLICATIONS TO FIXED - POINTED COPROCESSOR CIRCUITS - Nalini Kumar Gaurav Chitroda Komal Kasat.
Economics 173 Business Statistics Lecture 7 Fall, 2001 Professor J. Petry
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 6: Exhaustive Bounded Testing and Feedback-Directed Random Testing.
A Novel Approach to Unit Test: The Aspect-Oriented Way Guoqing Xu and Zongyuan Yang Software Engineering Lab (SEL) East China Normal University
Copyright © Curt Hill Query Evaluation Translating a query into action.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
More About Classes Ranga Rodrigo. Information hiding. Copying objects.
JCMP: Linking Architecture with Component Building Guoqing Xu, Zongyuan Yang and Haitao Huang Software Engineering Lab, East China Normal University SACT-01,
Black-box Testing.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Lyra – A service-oriented and component-based method for the development of communicating systems (by Sari Leppänen, Nokia/NRC) Traditionally, the design,
Lecture 5 1.What is a variable 2.What types of information are stored in a variable 3.Getting user input from the keyboard 1.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
DeepDive Model Dongfang Xu Ph.D student, School of Information, University of Arizona Dec 13, 2015.
JAOUT: Automated Generation of Aspect Oriented Unit Test Guoqing Xu, Z. Yang, H. Huang, Q. Chen, L. Chen and F. Xu Software Engineering Lab (SEL) East.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
CSSE501 Object-Oriented Development. Chapter 10: Subclasses and Subtypes  In this chapter we will explore the relationships between the two concepts.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Quicksort This is probably the most popular sorting algorithm. It was invented by the English Scientist C.A.R. Hoare It is popular because it works well.
Data Structures and Algorithms Instructor: Tesfaye Guta [M.Sc.] Haramaya University.
1 Overview of Query Evaluation Chapter Outline  Query Optimization Overview  Algorithm for Relational Operations.
Packet Classification Using Multi- Iteration RFC Author: Chun-Hui Tsai, Hung-Mao Chu, Pi-Chung Wang Publisher: 2013 IEEE 37th Annual Computer Software.
IP Addressing. A 32-bit logical naming convention A dotted-decimal notation is used: – –Each number represents 8 bits. Number is Part.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
+ Chapter 9 Testing a Claim 9.1Significance Tests: The Basics 9.2Tests about a Population Proportion 9.3Tests about a Population Mean.
Chapter 9: Testing a Claim
Parallel Density-based Hybrid Clustering
The Calibration Process
Accessible Formal Methods A Study of the Java Modeling Language
Programming Languages 2nd edition Tucker and Noonan
Machine Learning: Lecture 3
Chapter 9: Testing a Claim
Cross-validation Brenda Thomson/ Peter Fox Data Analytics
Chapter 9: Testing a Claim
Unit 5: Hypothesis Testing
Programming Languages 2nd edition Tucker and Noonan
Evaluation David Kauchak CS 158 – Fall 2019.
Presentation transcript:

JMLAutoTest and Its Double- phase Testing Way Guoqing Xu Com Sci., East China Normal Univ. Shanghai , PRC FATES 2003, Montreal, Canada, Oct.6th 2003

Introduction to the current JML testing framework The main idea in the JML and JUnit framework: specification as test oracle. It can generate codes from formal specifications for unit test by translating pre- and post-conditions of a method into test oracles. It has solved the problem that it is hard to write unit test code by hand.

Problems Writing codes for generating test cases, especially those with a linked data structure is still a labor-intensive job. Meaningless test cases can not be avoided in the test, thus much time might be used to explore meaningless test inputs.

Problems (more) Some formal approach based testing frameworks require programmer to write special predicates to check the validity of test cases (i.e. Korat). However they can not be used in a black-box test since testers may know little about the details in the program to be tested.

Goals of our new framework Generate test cases automatically including those with a linked data structure. Prevent meaningless test cases from being processed in the final test instead of only identifying them.

The test case generation Set Value Domain for Fields of the Input class. Make a finitization of all cases by combining each value in the domain specified by testers. Verify the validity of a test case by checking the run-time state of instance invariant specified in its class.

Double-phase testing Goals: 1. Prevent meaningless test cases being processed in the final test, therefore saving the time. 2. Do not require testers to know the details of the program to be tested, thus making the black-box test possible.

Key steps in double-phase testing

Operational Profile Operational Profile is a standard made by the tester to divide the generated test case space into several partitions. the validity of double-phase testing is based on the quality of the operational profile. it is a good idea to start out with several models and evaluate their predictive accuracy before settling on one.

The first phase Take a relatively small number (e.g. 10%) of test cases out from each partition according to the average distribution. Run these groups of cases respectively. Make statistics on the number of meaningless test cases appeared in each group.

The second phase Calculate and determine the probability of meaningless test cases existing in each partition. Reorganize the test cases according to the inverse proportion of meaningless cases in each partition. (e.g. take 80% of cases from the partition which produces 20% of meaningless ones in the first phase.) Run the final test.

Experimental results Target Method to be tested: public requires parentTree!=null && thisNode!=null (\exists Node n; n.ID== assignable ensures \result.root.ID == thisNode.ID BinaryTree findSubTree(BinaryTree parentTree, Node thisNode)

Test case generation The pre-condition of the method says that neither of its arguments can be null and there must be a node in parentTree whose ID equals the ID of thisNode. We generate the test case space of type BinaryTree with a few nodes. We also generate the case space of type Node which contains 12 nodes whose IDs are from 0 to 11.

Divide the test case space For the test case space of type BinaryTree, we do not divide it and leave it as the only partition. For the space of type Node, We divide it into two partitions. The first one contains nodes whose ID varies from 0 to 5 and the second one contains the rest.

Test Results Table 1. Performance of JMLAutoTest for testing the method findSubTree with arguments “-pre 0.25”. nodes in binary tree generated binary trees candidates considered meaningful test cases in the final test total test cases in the final test

Test Results Table 2. Performance comparison between the double-phase testing in JMLAutoTest and the conventional way in JMLUnit testing framework. nodes in binary tree meaningful /total in final test time in the first phase (s) total time of the test (s) meaningful /total in final test time in the first phase (s) total time of the test (s) 5410/ / / / / / / / Double-phase way Conventional way

Conclusions JMLAutoTest provides interfaces for testers to automatically generate test cases, even those with a linked data structure. a) Set value domain for fields b) Finitization c) Verify validity of a test case by checking the instance invariant specified in its class

Conclusions (more) Based on statistical principle, JMLAutoTest uses the double-phase testing way to filter out meaningless test cases before the final test is run. a) Make an Operational Profile b) Determine the proportion ofmeaningless test cases of each partition in the first phase. c) Reorganize the test cases according the distribution if meaningless cases and run the final test

Acknowledgement We would like to thank Professor Gary T. Leavens in Iowa State University who gave us help on both JML and the testing framework.