Download presentation
Presentation is loading. Please wait.
Published byBrooke Brown Modified over 9 years ago
1
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
2
Overview -- Trace analysis with SMT-solver 2 SMT SMT: Satisfiability Modulo Theories Context Dependence Graph Unit Test A B X
3
Outline Motivation --Debugging issues in COP CJAdviser: Trace analysis with SMT solver Related work Conclusion and Future work 3
4
Motivation 4
5
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. 5
6
Example: ContextJ* Code 6 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 Person implements IPerson { layers.define(Layers.Address,new IPerson() { public String toString() { return layers.next(this) + "; Address: " + address;}}); layers.define(Layers.Employment,new IPerson() { public String toString() { return layers.next(this) + "; [Employer] " + employer;}}); public class Employer implements IEmployer { layers.define(Layers.Address,new IEmployer() { public String toString() { return layers.next(this) + "; Address: " + address;}}); EmployerPerson Name: UchioShizuka; Address: Arae1 Name: UchioShizuka; Address: Arae1; [Employer] Name: Ubayashi; Address: Motooka
7
Execution Trace 7
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 ? 8
9
CJAdviser: Trace analysis with SMT solver 9
10
Our approach 10 SMT SMT: Satisfiability Modulo Theories Context Dependence Graph Unit Test
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 11
12
CJLogger 12 CXDG: Context dependence graph ContextJ* execution (period) Context Object Logging
13
Yices encoding -- CXDG 13 : ; 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 (-> int obj-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 Syntax is similar to Scheme
14
CJQuery 14 (period) Context Object Query SAT or UNSAT Debug Concerns
15
Case 1: Do a person and an employer exist in the Address layer at the same time ? 15 (define i::log-count) (define j::log-count) (define t::with-period) (assert (and (/= i j) (= (test-run i) (mk-tuple t Person Address)) (= (test-run j) (mk-tuple t 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 ? 16 (define i::log-count) (define j::log-count) (define t::with-period) (define l::layer) (assert (and (/= i j) (= (test-run i) (mk-tuple t Person l)) (= (test-run j) (mk-tuple t 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? 17 (define i::log-count) (define t::with-period) (assert (= (test-run i) (mk-tuple t Person Employment))) (check) SAT i = 4 and t = 2
18
Related work 18
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. 19
20
Conclusion and Future work 20
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 21
22
22 Thank you for your attention.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.