1 / 22

CJAdviser : SMT-based Debugging Support for ContextJ *

COP 2011. CJAdviser : SMT-based Debugging Support for ContextJ *. Shizuka Uchio (Kyushu University, Japan) Naoyasu Ubayashi (Kyushu University, Japan) Yasutaka Kamei (Kyushu University, Japan) July 25, 2011. Overview -- Trace analysis with SMT-solver. We can check a variety of

efuru
Download Presentation

CJAdviser : SMT-based Debugging Support for ContextJ *

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. COP 2011 CJAdviser:SMT-based Debugging Support forContextJ* • ShizukaUchio (Kyushu University, Japan) • NaoyasuUbayashi (Kyushu University, Japan) • Yasutaka Kamei (Kyushu University, Japan) • July 25, 2011

  2. Overview-- Trace analysis with SMT-solver We can check a variety of object-context dependencies such as “Do two objects A and B exist in the Context X at the same time ? ” SMT Unit Test A B X Context Dependence Graph SMT: Satisfiability Modulo Theories

  3. Outline • Motivation --Debugging issues in COP • CJAdviser: Trace analysis with SMT solver • Related work • Conclusion and Future work

  4. Motivation

  5. Motivation • Context-awareness plays an important role in developing adaptive software. • COP can treat context as a module and enables programmers to describe the context-aware behavior elegantly. • However, it becomes difficult to debug the programs due to the complexity of COP execution and the dependence between objects and contexts.

  6. Example: ContextJ* Code Employer Person Address Layer Employment Layer Name: UchioShizuka; Address: Arae1 Name: UchioShizuka; Address: Arae1; [Employer] Name: Ubayashi; Address: Motooka Employer ubayashi = new Employer("Ubayashi", "Motooka"); Person uchio = new Person("UchioShizuka", "Arae1", ubayashi); with(Layers.Address).eval( new Block() { public void eval() { System.out.println(uchio); }}); with(Layers.Address, Layers.Employment).eval( newBlock() { public void eval() { System.out.println(uchio); }}); public class Employer implements IEmployer { layers.define(Layers.Address,newIEmployer() { public String toString() { return layers.next(this) + "; Address: " + address;}}); public class Person implements IPerson { layers.define(Layers.Address,newIPerson() { public String toString() { return layers.next(this) + "; Address: " + address;}}); layers.define(Layers.Employment,newIPerson() { public String toString() { return layers.next(this) + "; [Employer] " + employer;}});

  7. Execution Trace • Q2: When uchio enters Address and Employment layers, the layered method toString (Address layer) is invoked after the layered method toString (Employment layer) is invoked. • Where is this order specified ? • Is the order defined by layers.define ? Q1: Address layer and Employment layer are instantiated just after Employer object is instantiated. Why ?

  8. More concerns … • Is there a possibility of simultaneously activating two layers A and B ? • Is the layer A activated sometime ? • Do two objects X and Y exist in the layer A at the same time ?

  9. CJAdviser:Trace analysis with SMT solver

  10. Our approach SMT Unit Test Context Dependence Graph SMT: Satisfiability Modulo Theories

  11. SMT (Satisfiability Modulo Theories) • SMT generalizes SAT (Boolean satisfiability) by adding equality reasoning, arithmetic, and other first-order theories. • Yices is an SMT solver that decides the satisfiability of formulas containing • uninterpreted function symbols with equality, • linear real and integer arithmetic, scalar types recursive datatypes, tuples, records, extensional arrays, fixed-size bit-vectors, • quantifiers • lambda expressions

  12. CJLogger Context Object ContextJ* execution (period) Context Logging Object CXDG: Context dependence graph

  13. Yices encoding -- CXDG Syntax is similar to Scheme : ; Type definitions (define-type obj (scalar Employer Person)) (define-type layer (scalar Address Employment)) (define-type with-period (subrange 1 2)) (define-type log-count (subrange 0 4)) (define-type obj-with-layer (tuple with-period obj layer)) (define-type logging (-> intobj-with-layer)) (define log::logging) : ; Log data (CXDG: Context dependence graph) (define test-run::logging (update (update (update (update (update (update log (0) (mk-tuple 1 Person Address)) (1) (mk-tuple 1 Employer Address)) (2) (mk-tuple 2 Person Address)) (3) (mk-tuple 2 Employer Address)) (4) (mk-tuple 2 Person Employment)))) Array

  14. CJQuery DebugConcerns Context Object Query (period) Context SAT or UNSAT Object Yices

  15. Case 1:Do a person and an employer exist in the Address layer at the same time ? (define i::log-count) (define j::log-count) (define t::with-period) (assert (and (/= ij) (= (test-run i) (mk-tuplet Person Address)) (= (test-run j) (mk-tuplet Employer Address)))) (check) SAT i = 2, j = 3, and t = 2

  16. Case 2:Do a person and an employer exist in the same layer at the same time ? (define i::log-count) (define j::log-count) (define t::with-period) (define l::layer) (assert (and (/= ij) (= (test-run i) (mk-tuplet Person l)) (= (test-run j) (mk-tuplet Employer l)))) (check) SAT i = 2, j = 3, t = 2, and l=Address.

  17. Case 3:Does a person exist in the Employment layer sometime? (define i::log-count) (define t::with-period) (assert (= (test-run i) (mk-tuplet Person Employment))) (check) SAT i = 4 and t = 2

  18. Related work

  19. Related work • Whyline [Ko, A. J. et al. ICSE2008] • allows programmers to ask “Why did” and “Why didn‘t” questions about the bugs. • provides answers of the bug causes. • DebugAdvisor [Ashok, B. et al. FSE2009] • allows programmers to express the context of the bugs and search through diverse data such as natural language text and core dumps.

  20. Conclusion and Future work

  21. Conclusion and Future work • We proposed CJAdviser, SMT-based Debugging Support for ContextJ*. • Future work • Support for Jcop • User Interface (cf. Whyline) • Scalability • Real case Studies

  22. Thank you for your attention.

More Related