1 / 22

Discovering Accurate Interclass Test Dependence

Discovering Accurate Interclass Test Dependence. Weilei Zhang, Barbara Ryder Department of Computer Science Rutgers University. Motivation. Class testing is very important for OO testing

lilah
Download Presentation

Discovering Accurate Interclass Test Dependence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PASTE’07 Discovering Accurate Interclass Test Dependence Weilei Zhang, Barbara RyderDepartment of Computer ScienceRutgers University

  2. PASTE’07 Motivation • Class testing is very important for OO testing • It corresponds with the classic definition of unit testing by exercising a relatively small software component via a driver • Most classes in the system are interdependent, and there is test dependence between classes • An accurate knowledge of ICTD (InterClass Test Dependence) is desired • Important in deciding class integration test order • Dependence cycles/SCCs causes complication • Helpful to parallelize integration test activities • Can be useful for program understanding and software visualization

  3. PASTE’07 Existing works on ICTD ORD-based • Briand, et al (TSE 2003) • Milanova, et al (ICSM 2002) • Hanh, et al (ECOOP 2001) • Labiche, et al (ICSE 2000) • Tai and Daniels (JOOP 1999) • Kung, et al (JOOP 1995)

  4. PASTE’07 ORD-Based Definition For ICTD • Causes for ICTD: • Inheritance • Aggregation • Association • Polymorphism As B A I Ag C D • B is test dependent on A, C and D • Transitive closure of the above

  5. PASTE’07 Contributions • To propose and formalize a new definition for ICTD in order to prune out the spurious dependences • Semantics-based definition • To give a practical algorithm to approximate the definition • Method-level dependence analysis • To implement the algorithm and evaluate the results

  6. PASTE’07 • The spurious ICTD causes a fake dependence cycle. Motivating Examples As DeliveryHandler DeliveryTransaction • specjbb benchmark As class DeliveryHandler{public void handleDelivery(DeliveryTransaction deliveryTransaction){deliveryTransaction.process(); deliveryTransaction.display(outFile);} } • Cases when ICTD does not exist though there is association • No reference during run-time (Milanova et al ICSM 2002) • No method calls (Stack & its containees) • Only calls to inherited methods (HashMap & its containees) • Methods called but no impact on the caller (the above in specjbb)

  7. PASTE’07 Semantics-based Definition of ICTD • There is test dependence from class A to class B, if there is a statement s in a method callable on an A object and a statement t in a method declared in B, such that: • s may have visible side effects (i.e., s may either write to the external memory or return a value), and • s is semantically dependent on t while testing class A

  8. PASTE’07 Approximation Algorithm • Turing-incomputable -> dependence analysis • Statement-level granularity dependence analysis is too costly • Approximate at method-level granularity dependence • Three causes for method dependence: • Caller uses return value of callee • Callee is control-dependent on caller • Side effect: one method writes to the same memory region that another method reads • Propagate dependences on the call graph w=x.foo()

  9. PASTE’07 Algorithm Illustration CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  10. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  11. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  12. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  13. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  14. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  15. PASTE’07 Algorithm Illustration Methods Callable on CUT CUT class Method Heap Data Call and return “useful” value Other calls Side Effect write read

  16. PASTE’07 Analysis Configurations • The proposed algorithm is parameterized by the choice of program analyses to calculate the call graph and side effect information • For analysis configuration applied: • VTA: variable type analysis (call graph not constructed on the fly) • 0CFA: 0-CFA (call graph constructed on the fly) • OB: 1-object-sensitive points-to analysis • OBR: OB+R (a data reachability algorithm to resolve library call-backs and construct accurate application call graphs)

  17. PASTE’07 ICTD Reduction Rate wrt. ORD-based Definition

  18. PASTE’07 Size of Dependence Cycles

  19. PASTE’07 Metrics I AsciiMetrics Context-insensitive CG Methods reachable from Metrics Metrics: output_properly() Methods reachable from AsciiMetrics AsciiMetrics: wrap() Metrics: wrap() Objective-Sensitive Analysis Metrics: output_properly(){…this.wrap()…} AsciiMetrics overrides Method wrap().

  20. PASTE’07 Metrics I AsciiMetrics Objective-Sensitive Analysis Metrics: output_properly(){…this.wrap()…} AsciiMetrics overrides Method wrap(). Object-sensitive CG Methods reachable from Metrics Methods reachable from AsciiMetrics [m, Metrics: output_properly()] [am, Metrics: output_properly()] [m,Metrics: wrap()] [am,AsciiMetrics: wrap()] PLDI’07 Sridharan, Fink, Bodik: context-sensitive dependence analysis is too costly and “did not provide much realistic usage” for thin slicing. Method-level dependence calculation makes context-sensitive dependence analysis more practical and it is very useful in our study in ICTD.

  21. PASTE’07 Conclusions • A new semantics-based accurate definition for interclass test dependence • An approximate algorithm and implementation • A great number of spurious dependences are removed • Dependence cycles are determined accurately in 6 out of 7 benchmarks amenable to code inspection. • Method-level dependence propagation makes object-sensitive dependence analysis more practical • Object-sensitive analysis is key to achieve accurate results for dependence cycles

  22. PASTE’07 Thanks! Questions?

More Related