Automatic Generation of Oracles for Exceptional Behaviors

Size: px
Start display at page:

Download "Automatic Generation of Oracles for Exceptional Behaviors"

Transcription

1 Automatic Generation of Oracles for Exceptional Behaviors ISSTA * * Artifact Consistent * Complete * Well Documented * Easy to Reuse * Evaluated * AEC * Alberto Goffi alberto.goffi@usi.ch USI Università della Svizzera italiana (Lugano, Switzerland) Alessandra Gorla IMDEA Software Institute (Madrid, Spain) Michael D. Ernst University of Washington (Seattle, Washington, USA) Mauro Pezzè USI Università della Svizzera italiana (Lugano, Switzerland)

2 The Oracle Problem Automatically generated test cases need oracles Formal specifications are often missing Developers write Javadoc comments Automatically generate oracles from Javadoc comments

3 The Oracle Problem Automatically generated test cases need oracles Developers do not write formal specifications Developers write Javadoc comments Automatically generate oracles from Javadoc comments

4 The Oracle Problem Automatically generated test cases need oracles Developers do not write formal specifications Developers do write Javadoc comments Automatically generate oracles from Javadoc comments

5 The Oracle Problem Automatically generated test cases need oracles Developers do not write formal specifications Developers do write Javadoc comments Automatically generate oracles from Javadoc comments

6 Testers under-test exceptions 100 % covered statements % covered throw statements cli collections compress dbcp io lang math net pool primitives guava average

7 Testers under-test exceptions 100 % covered statements % covered throw statements cli collections compress dbcp io lang math net pool primitives guava average

8 Testers under-test exceptions 100 % covered statements % covered throw statements cli collections compress dbcp io lang math net pool primitives guava average

9 Testers under-test exceptions % covered statements % covered throw statements -25% cli collections compress dbcp io lang math net pool primitives guava average

10 and automatic testing does not help public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } public Object next() { } }

11 and automatic testing does not help public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } public Object next() { } } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); }

12 What does an exception mean? public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } public Object next() { } } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } NullPointerException

13 What does an exception mean? public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } public Object next() { } } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } NullPointerException 1. Expected behavior? 2. Illegal input 3. Implementation bug

14 What does an exception mean? public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } NullPointerException 1. Expected behavior? 2. Illegal input 3. Implementation bug

15 What does an exception mean? public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } NullPointerException 1. Expected behavior 2. Illegal input 3. Implementation bug

16 What does an exception mean? public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } False Alarm public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } NullPointerException 1. Expected behavior 2. Illegal input 3. Implementation bug

17 Consider another implementation public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } No Exceptions 1. Expected behavior bug? 2. Illegal input 3. Implementation

18 Consider another implementation public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } No Exceptions 1. Expected behavior 2. Illegal input 3. Implementation bug

19 Consider another implementation public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } Missed Alarm public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } No Exceptions 1. Expected behavior 2. Illegal input 3. Implementation bug

20 Test public void test { FilterIterator i = new FilterIterator(null, null); i.next(); }

21 Test Documentation public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { }

22 Test + Documentation public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { }

23 Test + Documentation public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } Test + Oracle public void test { FilterIterator i = new FilterIterator(null, null); if (i.getiterator() == null i.getpredicate() == null) { try { i.next(); fail( Expected NPE not thrown ); } catch(nullpointerexception e) { // Expected exception } } else { i.next(); } }

24 Test + Documentation public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } Test + Oracle public void test { FilterIterator i = new FilterIterator(null, null); if (i.getiterator() == null i.getpredicate() == null) { try { i.next(); fail( Expected NPE not thrown ); } catch(nullpointerexception e) { // Expected exception } } else { i.next(); } }

25 Test + Documentation public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } /** NullPointerException if either * the iterator or predicate are null */ public Object next() { } Test + Oracle public void test { FilterIterator i = new FilterIterator(null, null); if (i.getiterator() == null i.getpredicate() == null) { try { i.next(); fail( Expected NPE not thrown ); } catch(nullpointerexception e) { // Expected exception } } else { i.next(); } }

26 Toradocu Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Tests

27 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests

28 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Source 1. Method Signature 2. Expected Exceptions 3. Conditions (Text)

29 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Source 1. Method Signature 2. Expected Exceptions 3. Conditions (Text) /** NullPointerException * if either the iterator * or predicate are null */ public Object next() { } 1. FilterIterator.next() 2. NullPointerException 3. if either the iterator or predicate are null

30 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests 1. Method Signature 2. Expected Exceptions 3. Conditions (Text) 1. Method Signature 2. Expected Exceptions 3. Conditions (Code)

31 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests 1. Method Signature 2. Expected Exceptions 3. Conditions (Text) 1. Method Signature 2. Expected Exceptions 3. Conditions (Code) 1. FilterIterator.next() 2. NullPointerException 3. if either the iterator or predicate are null 1. FilterIterator.next() 2. NullPointerException 3. getiterator() == null getpredicate() == null

32 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Tests 1. FilterIterator.next() 2. NullPointerException 3. getiterator() == null getpredicate() == null

33 Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Tests Test + Oracle = Test + Oracle public void test { FilterIterator i = new FilterIterator(null, null); i.next(); } 1. FilterIterator.next() 2. NullPointerException 3. getiterator() == null getpredicate() == null public void test { FilterIterator i = new FilterIterator(null, null); if (i.getiterator()==null i.getpredicate()==null) { try { i.next(); fail( Expected NPE not thrown ); } catch(nullpointerexception e) { // Expected exception } } else { i.next(); } }

34 Natural Language Condition Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests Java boolean condition

35 if the array is empty Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests array.length == 0

36 if foo is positive Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests foo > 0

37 Natural Language Condition Condition Translator NL Parser Subject Matcher Predicate Matcher Java Condition

38 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null

39 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null Proposition Subject Predicate 1 iterator are null 2 predicate are null

40 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null Proposition Subject Predicate 1 iterator are null 2 predicate are null

41 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null

42 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null or Proposition Subject Predicate 1 iterator are null 2 predicate are null iterator, are null predicate, are null

43 NL Parser Subject Matcher Predicate Matcher Proposition Subject Predicate 1 iterator are null 2 predicate are null

44 NL Parser Subject Matcher Subject: iterator Predicate Matcher

45 NL Parser Subject Matcher Subject: iterator Predicate Matcher Candidates Formal Parameters Class Name Non-void Nullary Methods Fields

46 NL Parser Subject Matcher Predicate Matcher Subject: iterator Candidates Formal Parameters Class Name Non-void Nullary Methods Fields Candidate FilterIterator getiterator getpredicate next Distance public class FilterIterator implements Iterator { public FilterIterator(Iterator i, Predicate p) { } public Iterator getiterator() { } public Predicate getpredicate() { } public Object next() { } }

47 NL Parser Subject Matcher Predicate Matcher Subject: iterator Candidates Formal Parameters Class Name Non-void Nullary Methods Fields Candidate Distance FilterIterator 6 getiterator 3 getpredicate 9 next 6

48 NL Parser Subject Matcher Predicate Matcher Subject: iterator => getiterator() Candidates Formal Parameters Class Name Non-void Nullary Methods Fields Candidate Distance FilterIterator 6 getiterator 3 getpredicate 9 next 6

49 NL Parser Subject Matcher Predicate Matcher Proposition Subject Predicate 1 iterator are null 2 predicate are null Proposition Subject Predicate 1 FilterIterator.getIterator() are null 2 FilterIterator.getPredicate() are null

50 NL Parser Subject Matcher Predicate Matcher Proposition Subject Predicate 1 FilterIterator.getIterator() are null 2 FilterIterator.getPredicate() are null

51 NL Parser Subject Matcher Predicate Matcher Proposition Subject Predicate 1 FilterIterator.getIterator() are null 2 FilterIterator.getPredicate() are null Proposition Subject Predicate 1 FilterIterator.getIterator() ==null 2 FilterIterator.getPredicate() ==null

52 NL Parser Subject Matcher Predicate Matcher /** IllegalArgumentException if employees is empty */ public void sortbyage(list employees) { } Proposition Subject Predicate 1 employees is empty

53 NL Parser Subject Matcher Predicate Matcher /** IllegalArgumentException if employees is empty */ public void sortbyage(list employees) { } Proposition Subject Predicate 1 employees is empty Candidate Distance clear 7 isempty 1 iterator 6 size 7

54 NL Parser Subject Matcher Predicate Matcher /** IllegalArgumentException if employees is empty */ public void sortbyage(list employees) { } Proposition Subject Predicate 1 employees is empty Condition Translation 1 employees.isempty()

55 NL Parser Subject Matcher Predicate Matcher if either the iterator or predicate are null Condition Translation 1 FilterIterator.getIterator()==null 2 FilterIterator.getPredicate()==null

56 Positive conditions if either the iterator or predicate are null Condition Translation 1 (FilterIterator.getIterator()==null)==true 2 (FilterIterator.getPredicate()==null)==true

57 Positive conditions if either the iterator or predicate are null Condition Translation 1 (FilterIterator.getIterator()==null)==true 2 (FilterIterator.getPredicate()==null)==true Negative conditions if either the iterator or predicate aren t null Condition Translation 1 (FilterIterator.getIterator()==null)==false 2 (FilterIterator.getPredicate()==null)==false

58 Evaluation

59 From NL to Java Conditions Correct Partially Correct Wrong Missing 100% 75% 50% 25% 0% ArrayListMultimap AtomicDoubleArray ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap

60 From NL to Java Conditions Correct Partially Correct Wrong Missing 100% 75% 50% 25% 0% ArrayListMultimap AtomicDoubleArray ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap

61 From NL to Java Conditions Correct Partially Correct Wrong Missing 100% 75% 50% 25% Precision: 92% 0% ArrayListMultimap AtomicDoubleArray ConcurrentHashMultiset Recall: 73% Doubles Floats MoreObjects Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap

62 False Alarms Google Guava Implicit oracle Toradocu ArrayListMultimap AtomicDoubleArray ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Strings Verify Average (EvoSuite Test Cases)

63 False Alarms Google Guava Implicit oracle Toradocu % ArrayListMultimap AtomicDoubleArray ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Strings Verify Average (EvoSuite Test Cases)

64 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100%

65 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100%

66 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100% Regression Toradocu 0% 20% 40% 60% 80% 100%

67 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100% Regression Toradocu 0% 20% 40% 60% 80% 100%

68 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100% Regression Toradocu 0% 20% 40% 60% 80% 100% Heuristics Toradocu 0% 20% 40% 60% 80% 100%

69 True Alarms Apache Commons Pass False alarms True alarms Implicit Toradocu 0% 20% 40% 60% 80% 100% Regression Toradocu 0% 20% 40% 60% 80% 100% Heuristics Toradocu 0% 20% 40% 60% 80% 100%

70 What s next? Oracles for exceptions on arrays/containers IllegalArgumentException if the array contains null input foo must not be null void sort(@notnull int[] a) return the size of the array more

71 What s next? Oracles for exceptions on arrays/containers IllegalArgumentException if the array contains null input foo must not be null void sort(@notnull int[] a) return the size of the array more

72 Testers under-test exceptions % covered statements % covered throw statements -25% cli collections compress dbcp io lang math net pool primitives guava average

73 Testers under-test exceptions % covered statements % covered throw statements % Source Javadoc Extractor Toradocu Condition Translator Oracle Generator Enhanced Tests 20 Tests 0 cli collections compress dbcp io lang math net pool primitives guava average

74 Testers under-test exceptions % covered statements % covered throw statements % Toradocu Source Javadoc Extractor Condition Translator Oracle Generator Enhanced Tests 20 Tests 0 cli collections compress dbcp io lang math net pool primitives guava average From NL to Java Conditions Correct Partially Correct Wrong Missing 100% 75% 50% 25% 0% ArrayListMultimap AtomicDoubleArray Precision: 92% ConcurrentHashMultiset Recall: 73% Doubles Floats MoreObjects Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap

75 Testers under-test exceptions % covered statements % covered throw statements % Source Javadoc Extractor Toradocu Condition Translator Oracle Generator Enhanced Tests 20 Tests 0 cli collections compress dbcp io lang math net pool primitives guava average From NL to Java Conditions 100% 75% 50% 25% 0% Correct Partially Correct Wrong Missing ArrayListMultimap AtomicDoubleArray Precision: 92% ConcurrentHashMultiset Recall: 73% 0 Doubles Floats MoreObjects Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap False Alarms Google Guava ArrayListMultimap AtomicDoubleArray Implicit oracle ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Toradocu -36% Strings Verify Average (EvoSuite Test Cases)

76 Testers under-test exceptions % covered statements % covered throw statements % Source Javadoc Extractor Toradocu Condition Translator Oracle Generator Enhanced Tests 20 Tests 0 cli collections compress dbcp io lang math net pool primitives guava average github.com/albertogoffi/toradocu From NL to Java Conditions 100% 75% 50% 25% 0% Correct Partially Correct Wrong Missing ArrayListMultimap AtomicDoubleArray Precision: 92% ConcurrentHashMultiset Recall: 73% 0 Doubles Floats MoreObjects alberto.goffi@usi.ch Shorts Strings Verify FilterIterator FixedOrderComparator ListPopulation PredicatedMap False Alarms Google Guava ArrayListMultimap AtomicDoubleArray Implicit oracle ConcurrentHashMultiset Doubles Floats MoreObjects Shorts Toradocu -36% Strings Verify Average (EvoSuite Test Cases)

77

78 Related Work Heuristics JCrasher, Crash n Check (Csallner, and Smaragdakis. ICSE 05) Randoop (Pacheco, Lahiri, Ernst, and Ball. ICSE 07) Specifications ASTOOT (Doong, and Frankl. TOSEM 94) Models, contracts, Properties Cross-checking oracles (Carzaniga, Goffi, Gorla, Mattavelli, and Pezzè. ICSE 14) Metamorphic testing (Chen, Kuo, Tse, and Zhou. STEP 13) Symmetric testing (Gotlieb. ISSRE 03) Natural Language (Tan, Marinov, Tan, and Leavens. ICST 12) acomment (Tan, Zhou, and Padioleau. ICSE 11) icomment (Tan, Yuan, Krishna, and Zhou. SOSP 07)

79 When does Toradocu fail? Conditions on the elements in a container - if collection or any of its elements is null - if any element in the arrays is null - if notes has fewer than 2 elements Specific checks - if the runtime type of the specified array is not a supertype of the runtime type of every element in this collection - if x > 0 Missing predicate translation (No output) - if the charset is not valid - if closed

80 NullPointerException if the predicate or either closure is null ifclosure(predicate predicate, Closure trueclosure, Closure falseclosure) { } ==> predicate == null trueclosure == null falseclosure == UnsupportedOperationException if the comparator is locked checklocked() { } ==> target.islocked()

Translating Code Comments to Procedure Specifications

Translating Code Comments to Procedure Specifications Translating Code Comments to Procedure Specifications Arianna Blasi Alberto Goffi Konstantin Kuznetsov Alessandra Gorla Michael D. Ernst Mauro Pezzè Sergio Delgado USI Università della Svizzera italiana,

More information

Natural language is a programming language

Natural language is a programming language Natural language is a programming language Michael D. Ernst UW CSE Joint work with Arianna Blasi, Juan Caballero, Sergio Delgado Castellanos, Alberto Goffi, Alessandra Gorla, Victoria Lin, Deric Pang,

More information

Synthesis of Equivalent Method Calls in Guava

Synthesis of Equivalent Method Calls in Guava Synthesis of Equivalent Method Calls in Guava Andrea Mattavelli 1, Alberto Goffi 1 and Alessandra Gorla 2 1 Università della Svizzera italiana (USI), Lugano, Switzerland {andrea.mattavelli,alberto.goffi}@usi.ch

More information

Shin Hwei Tan Darko Marinov Lin Tan Gary T. Leavens University of Illinois. University of Illinois

Shin Hwei Tan Darko Marinov Lin Tan Gary T. Leavens University of Illinois. University of Illinois Shin Hwei Tan Darko Marinov Lin Tan Gary T. Leavens University of Illinois University of Illinois University of Waterloo University of Central Florida 1 /* * Returns a synchronized map backed by the given

More information

Feedback-directed Random Test Generation

Feedback-directed Random Test Generation Feedback-directed Random Test Generation (ICSE 07 with minor edits) Carlos Pacheco Shuvendu Lahiri Michael Ernst Thomas Ball MIT Microsoft Research Random testing Select inputs at random from a program

More information

c 2012 Shin Hwei Tan

c 2012 Shin Hwei Tan c 2012 Shin Hwei Tan @TCOMMENT: TESTING JAVADOC COMMENTS TO DETECT COMMENT-CODE INCONSISTENCIES BY SHIN HWEI TAN THESIS Submitted in partial fulfillment of the requirements for the degree of Master of

More information

CSC Java Programming, Fall Java Data Types and Control Constructs

CSC Java Programming, Fall Java Data Types and Control Constructs CSC 243 - Java Programming, Fall 2016 Java Data Types and Control Constructs Java Types In general, a type is collection of possible values Main categories of Java types: Primitive/built-in Object/Reference

More information

@tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies

@tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies @tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies Shin Hwei Tan University of Illinois Urbana, IL 61801, USA stan6@illinois.edu Darko Marinov University of Illinois Urbana, IL

More information

16-Dec-10. Consider the following method:

16-Dec-10. Consider the following method: Boaz Kantor Introduction to Computer Science IDC Herzliya Exception is a class. Java comes with many, we can write our own. The Exception objects, along with some Java-specific structures, allow us to

More information

@tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies

@tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies @tcomment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies Shin Hwei Tan University of Illinois Urbana, IL 61801, USA stan6@illinois.edu Darko Marinov University of Illinois Urbana, IL

More information

Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset

Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset Automatic Repair of Real Bugs in Java: A Large-Scale Experiment on the Defects4J Dataset Matias Martinez, Thomas Durieux, Romain Sommerard, Jifeng Xuan, Martin Monperrus 1 Automatic Software Repair Automatic

More information

Intrinsic Redundancy for Reliability and Beyond

Intrinsic Redundancy for Reliability and Beyond Intrinsic Redundancy for Reliability and Beyond Alberto Goffi, Alessandra Gorla, Andrea Mattavelli, and Mauro Pezzè Abstract Software redundancy is an essential mechanism in engineering. Different forms

More information

COE318 Lecture Notes Week 10 (Nov 7, 2011)

COE318 Lecture Notes Week 10 (Nov 7, 2011) COE318 Software Systems Lecture Notes: Week 10 1 of 5 COE318 Lecture Notes Week 10 (Nov 7, 2011) Topics More about exceptions References Head First Java: Chapter 11 (Risky Behavior) The Java Tutorial:

More information

How to Measure Software Redundancy

How to Measure Software Redundancy How to Measure Software Redundancy Andrea Mattavelli University of Lugano, Switzerland In collaboration with: A. Carzaniga, M. Pezzè ( and A. Gorla, A. Goffi, N. Perino) Software Redundancy ... Software

More information

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011 Basics of Java: Expressions & Statements Nathaniel Osgood CMPT 858 February 15, 2011 Java as a Formal Language Java supports many constructs that serve different functions Class & Interface declarations

More information

Using Type Annotations to Improve Your Code

Using Type Annotations to Improve Your Code Using Type Annotations to Improve Your Code Birds-of-a-Feather Session Werner Dietl, University of Waterloo Michael Ernst, University of Washington Open for questions Survey: Did you attend the tutorial?

More information

Automatic Test Generation. Galeotti/Gorla/Rau Saarland University

Automatic Test Generation. Galeotti/Gorla/Rau Saarland University Automatic Test Generation Galeotti/Gorla/Rau Saarland University Testing : Find inputs that make the program fail Debugging : The process of finding the cause of a failure. Test Case Values/Test Input/Test

More information

Automated Documentation Inference to Explain Failed Tests

Automated Documentation Inference to Explain Failed Tests Automated Documentation Inference to Explain Failed Tests Sai Zhang University of Washington Joint work with: Cheng Zhang, Michael D. Ernst A failed test reveals a potential bug Before bug-fixing, programmers

More information

Which Configuration Option Should I Change?

Which Configuration Option Should I Change? Which Configuration Option Should I Change? Sai Zhang, Michael D. Ernst University of Washington Presented by: Kıvanç Muşlu I have released a new software version Developers I cannot get used to the UI

More information

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding DSD-Crasher: A Hybrid Analysis Tool for Bug Finding CHRISTOPH CSALLNER Georgia Institute of Technology YANNIS SMARAGDAKIS University of Oregon TAO XIE North Carolina State University DSD-Crasher is a bug

More information

Code verification. CSE 331 University of Washington. Michael Ernst

Code verification. CSE 331 University of Washington. Michael Ernst Code verification CSE 331 University of Washington Michael Ernst Specification and verification To find an error, compare two things Mental model Verification Specification Program Example input & output

More information

CSCI-142 Exam 2 Review November 2, 2018 Presented by the RIT Computer Science Community

CSCI-142 Exam 2 Review November 2, 2018 Presented by the RIT Computer Science Community CSCI-142 Exam 2 Review November 2, 2018 Presented by the RIT Computer Science Community http://csc.cs.rit.edu 1. Suppose we are talking about the depth-first search (DFS) algorithm. Nodes are added to

More information

Documenting Advanced Programming Techniques

Documenting Advanced Programming Techniques Documenting Advanced Programming Techniques https://no.wikipedia.org/wiki/tastatur#/media/file:computer_keyboard.png Prof. Dr. Bernhard Humm FB Informatik, Hochschule Darmstadt 1 Agenda 1. Documenting

More information

public static void negate2(list<integer> t)

public static void negate2(list<integer> t) See the 2 APIs attached at the end of this worksheet. 1. Methods: Javadoc Complete the Javadoc comments for the following two methods from the API: (a) / @param @param @param @return @pre. / public static

More information

Lightweight Verification of Array Indexing

Lightweight Verification of Array Indexing Lightweight Verification of Array Indexing Martin Kellogg*, Vlastimil Dort**, Suzanne Millstein*, Michael D. Ernst* * University of Washington, Seattle ** Charles University, Prague The problem: unsafe

More information

Automatic Testing of Sequential and Concurrent Substitutability

Automatic Testing of Sequential and Concurrent Substitutability Automatic Testing of Sequential and Concurrent Substitutability Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation void bar(foo f) { f.m();... } bar() expects functionality

More information

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding DSD-Crasher: A Hybrid Analysis Tool for Bug Finding Christoph Csallner, Yannis Smaragdakis College of Computing Georgia Institute of Technology Atlanta, GA 30332, USA {csallner,yannis}@cc.gatech.edu ABSTRACT

More information

Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives

Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives Leveraging Test Generation and Specification Mining for Automated Bug Detection without False Positives Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation API usage

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 6: Introduction to JML Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg May 15, 2017 Jochen Hoenicke (Software Engineering) Formal Methods for Java

More information

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding

DSD-Crasher: A Hybrid Analysis Tool for Bug Finding DSD-Crasher: A Hybrid Analysis Tool for Bug Finding CHRISTOPH CSALLNER Georgia Institute of Technology YANNIS SMARAGDAKIS University of Oregon and TAO XIE North Carolina State University DSD-Crasher is

More information

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception Ariel Shamir 1 Run-time Errors Sometimes when the computer

More information

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception 22 November 2007 Ariel Shamir 1 Run-time Errors Sometimes

More information

Lecture 4 Specifications

Lecture 4 Specifications CSE 331 Software Design and Implementation Administrivia Next assignments posted tonight HW2: Written problems on loops Lecture 4 Specifications Readings posted as well! Quizzes coming soon J Zach Tatlock

More information

public static boolean isoutside(int min, int max, int value)

public static boolean isoutside(int min, int max, int value) See the 2 APIs attached at the end of this worksheet. 1. Methods: Javadoc Complete the Javadoc comments for the following two methods from the API: (a) / @param @param @param @return @pre. / public static

More information

PASS4TEST IT 인증시험덤프전문사이트

PASS4TEST IT 인증시험덤프전문사이트 PASS4TEST IT 인증시험덤프전문사이트 http://www.pass4test.net 일년동안무료업데이트 Exam : 1z0-809 Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z0-809 Exam's Question and Answers 1 from

More information

Programming with Contracts. Juan Pablo Galeotti, Alessandra Gorla Saarland University, Germany

Programming with Contracts. Juan Pablo Galeotti, Alessandra Gorla Saarland University, Germany Programming with Contracts Juan Pablo Galeotti, Alessandra Gorla Saarland University, Germany Contract A (formal) agreement between Method M (callee) Callers of M Rights Responsabilities Rights Responsabilities

More information

CS159. Nathan Sprague. September 30, 2015

CS159. Nathan Sprague. September 30, 2015 CS159 Nathan Sprague September 30, 2015 Testing Happens at Multiple Levels Unit Testing - Test individual classes in isolation. Focus is on making sure that each method works according to specification.

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Feedback-controlled Random Test Generation

Feedback-controlled Random Test Generation Feedback-controlled Random Test Generation Kohsuke Yatoh 1*, Kazunori Sakamoto 2, Fuyuki Ishikawa 2, Shinichi Honiden 12 1:University of Tokyo, 2:National Institute of Informatics * He is currently affiliated

More information

Combined Static and Dynamic Automated Test Generation

Combined Static and Dynamic Automated Test Generation Combined Static and Dynamic Automated Test Generation Sai Zhang University of Washington Joint work with: David Saff, Yingyi Bu, Michael D. Ernst 1 Unit Testing for Object-oriented Programs Unit test =

More information

Automatically Generating Precise Oracles from Structured Natural Language Specifications

Automatically Generating Precise Oracles from Structured Natural Language Specifications Automatically Generating Precise Oracles from Structured Natural Language Specifications Manish Motwani and Yuriy Brun College of Information and Computer Sciences University of Massachusetts Amherst Amherst,

More information

Outline. iterator review iterator implementation the Java foreach statement testing

Outline. iterator review iterator implementation the Java foreach statement testing Outline iterator review iterator implementation the Java foreach statement testing review: Iterator methods a Java iterator only provides two or three operations: E next(), which returns the next element,

More information

CS115. Chapter 17 Exception Handling. Prof. Joe X. Zhou Department of Computer Science. To know what is exception and what is exception handling

CS115. Chapter 17 Exception Handling. Prof. Joe X. Zhou Department of Computer Science. To know what is exception and what is exception handling CS115 Pi Principles i of fcomputer Science Chapter 17 Exception Handling Prof. Joe X. Zhou Department of Computer Science CS115 ExceptionHandling.1 Objectives in Exception Handling To know what is exception

More information

An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing

An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing An Empirical Comparison of Automated Generation and Classification Techniques for Object-Oriented Unit Testing Marcelo d Amorim (UIUC) Carlos Pacheco (MIT) Tao Xie (NCSU) Darko Marinov (UIUC) Michael D.

More information

DD2460 Software Safety and Security: Part III Exercises session 2: Type + Jif

DD2460 Software Safety and Security: Part III Exercises session 2: Type + Jif DD2460 Software Safety and Security: Part III Exercises session 2: Type + Jif Gurvan Le Guernic adapted from Aslan Askarov DD2460 (III, E2) February 22 st, 2012 1 Noninterference type systems challenge

More information

GUAVA - CHARMATCHER CLASS

GUAVA - CHARMATCHER CLASS GUAVA - CHARMATCHER CLASS http://www.tutorialspoint.com/guava/guava_charmatcher.htm Copyright tutorialspoint.com CharMatcher provides various methods to handle various JAVA types for char values. Class

More information

Google s Guava. Robert Bachmann. May 2, / 24

Google s Guava. Robert Bachmann. May 2, / 24 .. Google s Guava Robert Bachmann May 2, 2011 1 / 24 Outline Basic utilities Collections Functions and Predicates MapMaker 2 / 24 Example class (1/2) public class Person { public final String name; public

More information

Fault, Error, and Failure

Fault, Error, and Failure Fault, Error, and Failure Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel based on slides by Prof. Lin Tan and others Terminology, IEEE 610.12-1990 Fault -- often referred

More information

ITI Introduction to Computing II

ITI Introduction to Computing II index.pdf March 17, 2013 1 ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Version of March 17, 2013 Definitions A List is a linear abstract

More information

Adam Blank Lecture 3 Autumn 2016 CSE 143. Computer Programming II

Adam Blank Lecture 3 Autumn 2016 CSE 143. Computer Programming II Adam Blank Lecture 3 Autumn 2016 CSE 143 Computer Programming II CSE 143: Computer Programming II More ArrayIntList; pre/post; exceptions; debugging Drawings 1 Drawings 2 Drawings 3 Drawings 4 Drawings

More information

CSE 143. More ArrayIntList; pre/post; exceptions; debugging. Computer Programming II. CSE 143: Computer Programming II

CSE 143. More ArrayIntList; pre/post; exceptions; debugging. Computer Programming II. CSE 143: Computer Programming II Adam Blank Lecture 3 Autumn 201 CSE 143 CSE 143: Computer Programming II More ArrayIntList; pre/post; exceptions; debugging Computer Programming II Drawings 1 Drawings 2 Drawings 3 Drawings 4 Drawings

More information

Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch

Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch Documen(ng code, Javadoc, Defensive Programming, Asserts, Excep(ons & Try/Catch 1 Most important reason to comment A) To summarize the code B) To explain how the code works C) To mark loca(ons that need

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

Documenting, Using, and Testing Utility Classes

Documenting, Using, and Testing Utility Classes Documenting, Using, and Testing Utility Classes Readings: Chapter 2 of the Course Notes EECS2030: Advanced Object Oriented Programming Fall 2017 CHEN-WEI WANG Structure of Project: Packages and Classes

More information

Identifying Patch Correctness in Test-Based Program Repair

Identifying Patch Correctness in Test-Based Program Repair Key Laboratory of High Confidence Software Technologies (Peking University), MoE Institute of Software, EECS, Peking University, Beijing, 100871, China {xiongyf,liuxinyuan,mhzeng,zhanglucs,hg}@pku.edu.cn

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Precise Condition Synthesis for Program Repair

Precise Condition Synthesis for Program Repair Precise Condition Synthesis for Program Repair Yingfei Xiong 1, Jie Wang 1, Runfa Yan 2, Jiachen Zhang 1, Shi Han 3, Gang Huang 1, Lu Zhang 1 1 Peking University 2 University of Electronic Science and

More information

CSCI 261 Computer Science II

CSCI 261 Computer Science II CSCI 261 Computer Science II Department of Mathematics and Computer Science Lecture 2 Exception Handling New Topic: Exceptions in Java You should now be familiar with: Advanced object-oriented design -

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 04: Exception Handling MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Creating Classes 2 Introduction Exception Handling Common Exceptions Exceptions with Methods Assertions and

More information

Fully Automatic and Precise Detection of Thread Safety Violations

Fully Automatic and Precise Detection of Thread Safety Violations Fully Automatic and Precise Detection of Thread Safety Violations Michael Pradel and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation Thread-safe classes: Building blocks for concurrent

More information

Utilities (Part 3) Implementing static features

Utilities (Part 3) Implementing static features Utilities (Part 3) Implementing static features 1 Goals for Today learn about preconditions versus validation introduction to documentation introduction to testing 2 Yahtzee class so far recall our implementation

More information

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics Recall Architecture of Compilers, Interpreters CMSC 330: Organization of Programming Languages Source Scanner Parser Static Analyzer Operational Semantics Intermediate Representation Front End Back End

More information

CS61BL: Data Structures & Programming Methodology Summer Midterm 1 Solutions. public static boolean probablyequals( Object obj1, Object obj2 ) {

CS61BL: Data Structures & Programming Methodology Summer Midterm 1 Solutions. public static boolean probablyequals( Object obj1, Object obj2 ) { CS61BL: Data Structures & Programming Methodology Summer 2014 Midterm 1 Solutions 1 Equality Checks (6 points) Write a probablyequals method that takes in two objects and returns true if one or more of

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

Queues. CITS2200 Data Structures and Algorithms. Topic 5

Queues. CITS2200 Data Structures and Algorithms. Topic 5 CITS2200 Data Structures and Algorithms Topic 5 Queues Implementations of the Queue ADT Queue specification Queue interface Block (array) representations of queues Recursive (linked) representations of

More information

Subclassing for ADTs Implementation

Subclassing for ADTs Implementation Object-Oriented Design Lecture 8 CS 3500 Fall 2009 (Pucella) Tuesday, Oct 6, 2009 Subclassing for ADTs Implementation An interesting use of subclassing is to implement some forms of ADTs more cleanly,

More information

Introduc)on to tes)ng with JUnit. Workshop 3

Introduc)on to tes)ng with JUnit. Workshop 3 Introduc)on to tes)ng with JUnit Workshop 3 We have to deal with errors Early errors are usually syntax errors. The compiler will spot these. Later errors are usually logic errors. The compiler cannot

More information

Dynamic Inference of Change Contracts

Dynamic Inference of Change Contracts 2014 IEEE International Conference on Software Maintenance and Evolution Dynamic Inference of Change Contracts Tien-Duy B. Le 1, Jooyong Yi 2, David Lo 1, Ferdian Thung 1, and Abhik Roychoudhury 2 1 School

More information

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Language Features. 1. The primitive types int, double, and boolean are part of the AP Language Features 1. The primitive types int, double, and boolean are part of the AP short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are

More information

Exceptions and assertions

Exceptions and assertions Exceptions and assertions CSE 331 University of Washington Michael Ernst Failure causes Partial failure is inevitable Goal: prevent complete failure Structure your code to be reliable and understandable

More information

Synchronization SPL/2010 SPL/20 1

Synchronization SPL/2010 SPL/20 1 Synchronization 1 Overview synchronization mechanisms in modern RTEs concurrency issues places where synchronization is needed structural ways (design patterns) for exclusive access 2 Overview synchronization

More information

Points To Remember for SCJP

Points To Remember for SCJP Points To Remember for SCJP www.techfaq360.com The datatype in a switch statement must be convertible to int, i.e., only byte, short, char and int can be used in a switch statement, and the range of the

More information

Programming with assertions Oracle guidelines

Programming with assertions Oracle guidelines Programming with assertions Oracle guidelines J.Serrat 102759 Software Design October 27, 2015 Index 1 Preliminaries 2 When not to use assertions 3 When to use assertions 4 Post-conditions 5 Requiring

More information

CS159. Nathan Sprague

CS159. Nathan Sprague CS159 Nathan Sprague What s wrong with the following code? 1 /* ************************************************** 2 * Return the mean, or -1 if the array has length 0. 3 ***************************************************

More information

Comparing procedure specifications

Comparing procedure specifications Comparing procedure specifications CSE 331 University of Washington Michael Ernst Outline Satisfying a specification; substitutability Stronger and weaker specifications Comparing by hand Comparing via

More information

CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community

CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community http://csc.cs.rit.edu 1. Suppose we are talking about the depth-first search (DFS) algorithm. Nodes are added to

More information

CSCI-140 Midterm Review October 10, 2015 Presented by the RIT Computer Science Community

CSCI-140 Midterm Review October 10, 2015 Presented by the RIT Computer Science Community CSCI-140 Midterm Review October 10, 2015 Presented by the RIT Computer Science Community http://csc.cs.rit.edu 1. In each of the following situations, would it be better to use array-backed storage or

More information

CSE 331. Programming by contract: pre/post conditions; Javadoc

CSE 331. Programming by contract: pre/post conditions; Javadoc CSE 331 Programming by contract: pre/post conditions; Javadoc slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/ 1

More information

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData Naming Conventions Rules Classes Use nouns Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML) Begin with upper case

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 04: Exception Handling MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Creating Classes 2 Introduction Exception Handling Common Exceptions Exceptions with Methods Assertions

More information

Automatic Recovery from Runtime Failures Authors: Antonio Carzaniga, Alessandra Gorlay, Andrea Mattavelli, Nicol`o Perino, Mauro Pezz`e

Automatic Recovery from Runtime Failures Authors: Antonio Carzaniga, Alessandra Gorlay, Andrea Mattavelli, Nicol`o Perino, Mauro Pezz`e Automatic Recovery from Runtime Failures Authors: Antonio Carzaniga, Alessandra Gorlay, Andrea Mattavelli, Nicol`o Perino, Mauro Pezz`e slide author names omitted for FERPA compliance The Approach Intrinsic

More information

Main concepts to be covered. Handling errors. Some causes of error situations. Not always programmer error. Defensive programming.

Main concepts to be covered. Handling errors. Some causes of error situations. Not always programmer error. Defensive programming. Main concepts to be covered Handling errors Or, When Bad Things Happen to Good Programs Defensive programming. Anticipating that things could go wrong. Exception handling and throwing. Error reporting.

More information

An Industrial Evaluation of Unit Test Generation: Finding Real Faults in a Financial Application

An Industrial Evaluation of Unit Test Generation: Finding Real Faults in a Financial Application An Industrial Evaluation of Unit Test Generation: Finding Real Faults in a Financial Application M. Moein Almasi, Hadi Hemmati, Gordon Fraser, Andrea Arcuri, Jānis Benefelds Department of Computer Science,

More information

Data abstractions: ADTs Invariants, Abstraction function. Lecture 4: OOP, autumn 2003

Data abstractions: ADTs Invariants, Abstraction function. Lecture 4: OOP, autumn 2003 Data abstractions: ADTs Invariants, Abstraction function Lecture 4: OOP, autumn 2003 Limits of procedural abstractions Isolate implementation from specification Dependency on the types of parameters representation

More information

Birkbeck (University of London) Software and Programming 1 In-class Test Mar 2018

Birkbeck (University of London) Software and Programming 1 In-class Test Mar 2018 Birkbeck (University of London) Software and Programming 1 In-class Test 2.1 22 Mar 2018 Student Name Student Number Answer ALL Questions 1. What output is produced when the following Java program fragment

More information

CSE 431S Type Checking. Washington University Spring 2013

CSE 431S Type Checking. Washington University Spring 2013 CSE 431S Type Checking Washington University Spring 2013 Type Checking When are types checked? Statically at compile time Compiler does type checking during compilation Ideally eliminate runtime checks

More information

Comparing Non-adequate Test Suites using Coverage Criteria

Comparing Non-adequate Test Suites using Coverage Criteria Comparing Non-adequate Test Suites using Coverage Criteria Milos Gligoric 1, Alex Groce 2, Chaoqiang Zhang 2 Rohan Sharma 1, Amin Alipour 2, Darko Marinov 1 ISSTA 2013 Lugano, Switzerland July 18, 2013

More information

Specifications. CSE 331 Spring 2010

Specifications. CSE 331 Spring 2010 Specifications CSE 331 Spring 2010 The challenge of scaling software Small programs are simple and malleable easy to write easy to change Big programs are (often) complex and inflexible hard to write hard

More information

The design of the PowerTools engine. The basics

The design of the PowerTools engine. The basics The design of the PowerTools engine The PowerTools engine is an open source test engine that is written in Java. This document explains the design of the engine, so that it can be adjusted to suit the

More information

FULLY AUTOMATIC AND PRECISE DETECTION OF THREAD SAFETY VIOLATIONS

FULLY AUTOMATIC AND PRECISE DETECTION OF THREAD SAFETY VIOLATIONS FULLY AUTOMATIC AND PRECISE DETECTION OF THREAD SAFETY VIOLATIONS PLDI 2012 by Michael Pradel and Thomas R. Gross ETH Zurich presented by Martin Aigner University of Salzburg May 2, 2013 OVERVIEW The problem

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

CnC: Check n Crash. Combining static checking and testing. Christoph Csallner and Yannis Smaragdakis

CnC: Check n Crash. Combining static checking and testing. Christoph Csallner and Yannis Smaragdakis 27th International Conference on Software Engineering, 20 May 2005 CnC: Check n Crash Combining static checking and testing Christoph Csallner and Yannis Smaragdakis Georgia Institute of Technology College

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Christoph Csallner, University of Texas at Arlington (UTA)

Christoph Csallner, University of Texas at Arlington (UTA) Christoph Csallner, University of Texas at Arlington (UTA) Joint work with: Nikolai Tillmann (MSR), Yannis Smaragdakis (UMass), Ishtiaque Hussain (UTA), Chengkai Li (UTA) Dynamic symbolic execution Pioneered

More information

Precise Program Repair

Precise Program Repair Precise Program Repair Yingfei Xiong Peking University Background of Yingfei Xiong 2000~2004,UESTC, Undergraduate 2004~2006,Peking University, Graduate Adivsor: Hong Mei, Fuqing Yang 2006~2009,The University

More information

Exceptions and Design

Exceptions and Design Exceptions and Exceptions and Table of contents 1 Error Handling Overview Exceptions RuntimeExceptions 2 Exceptions and Overview Exceptions RuntimeExceptions Exceptions Exceptions and Overview Exceptions

More information

Mining Crash Fix Patterns

Mining Crash Fix Patterns Mining Crash Fix Patterns Jaechang Nam and Ning Chen Department of Computer Science and Engineering The Hong Kong University of Science and Technology China {jcnam,ning@cse.ust.hk ABSTRACT During the life

More information

6.005 Elements of Software Construction Fall 2008

6.005 Elements of Software Construction Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 6.005 Elements of Software Construction Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.005 elements

More information

Defensive Programming. Ric Glassey

Defensive Programming. Ric Glassey Defensive Programming Ric Glassey glassey@kth.se Outline Defensive Programming Aim: Develop the programming skills to anticipate problems beyond control that may occur at runtime Responsibility Exception

More information

Object Oriented Programming Exception Handling

Object Oriented Programming Exception Handling Object Oriented Programming Exception Handling Budditha Hettige Department of Computer Science Programming Errors Types Syntax Errors Logical Errors Runtime Errors Syntax Errors Error in the syntax of

More information