architectural point mapping for design traceability naoyasu ubayashi and yasutaka kamei kyushu...

of 28/28
Architectural Point Mapping for Design Traceability Naoyasu Ubayashi and Yasutaka Kamei Kyushu University, Japan March 26, 2012 FOAL 2012 (AOSD Workshop)

Post on 05-Jan-2016

214 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

1

Architectural Point Mappingfor Design TraceabilityNaoyasu Ubayashi and Yasutaka KameiKyushu University, Japan

March 26, 2012FOAL 2012 (AOSD Workshop)

1Overview22

Bidirectional traceabilitybetween design and code(preserving appropriateabstraction level)public class Subject{private Vector observers = new Vector(); private String state = ;public void addObserver(Observer o){ }public void removeObserver(Observer o){ }public void notify(){Iterator i = observers.iterator();while(i.hasNext() ){Observers o = (Observer)i.next();o.update( this );}} public void setState(String s){ state = s; } public String getState() {return state; }}Program Code

ArchitectureTraceabilityAbstraction mechanism based on Archpoints (Pointcut-based architectural representation)Traceability link based on Archmapping (Automatic verification using an SMT solver)OutlineIntroductionArchitectural points and mappingSMT-based traceability checkingConclusions and Future work3Introduction4Software architectureDefinition (Bass, L. et. al)The software architecture of a program or computing system is the structure or structures of the system, which comprise of software elements, the externally visible properties of those elements, and relationships among them.Architecture plays an important role in software development.System characteristics such as robustness and maintainability depend on the architecture.5Bass, L., et al.: Software Architecture in Practice, Addison-Wesley, 2003.Open issuesPrecious design descriptionSynchronization between design and code

6public class Subject{private Vector observers = new Vector(); private String state = ;public void addObserver(Observer o){ }public void removeObserver(Observer o){ }public void notify(){Iterator i = observers.iterator();while(i.hasNext() ){Observers o = (Observer)i.next();o.update( this );}} public void setState(String s){ state = s; } public String getState() {return state; }}Program Code

ArchitectureImportant research issueAdequate support for fluidly moving between design and coding tasksTaylor, R. N. and Hoek, A.: Software Design and Architecture --The once and future focus of software engineering,In Proceedings of 2007 Future of Software Engineering (FOSE 2007), pp.226-243, 2007.Example: Observer Pattern7

Architectural constraintsClass diagramSequence diagramDoes this code conform to its architectural design ?8

It behehaves correctly !It corresponds to its class diagram !

HoweverIt does not conform to its design !There is a code clone.Correct implementation

public class Subject{private Vector observers = new Vector(); private String state = ;public void addObserver(Observer o){ }public void removeObserver(Observer o){ }public void notify(){Iterator i = observers.iterator();while(i.hasNext() ){Observers o = (Observer)i.next();o.update( this );}} public void setState(String s){ state = s; } public String getState() {return state; }}Solution ? Detailed design descriptions

DetailedModelDescriptionsCompletecode generationHowever,architectural design should be appropriate abstract !Program Code9Traditional MDD approach9Problems to be tackledIt is not easy to reflect the design decisions at the code level.It is not easy to synchronize design and code with preserving adequate abstraction level.A mechanism for checking the design traceability is needed.10Our approach: Archface11 public class Subject{private Vector observers = new Vector(); private String state = ;}CodeArchitectural designArchface(Exposure of shared design points)DesignImplementationModification ofArchitectural designNaoyasu Ubayashi, Jun Nomura, and Tetsuo Tamai:Archface: A Contract Place Where Architectural Design and Code Meet Together. 32rd ACM/IEEE International Conference on Software Engineering (ICSE 2010), ACM PRESS, pp.75-84 (2010).Contract betweendesign and code A set ofarchitecturalpointsA set ofprogrampointsHowever, a verification mechanism for design traceability is not provided !Our proposal :A verification mechanism for design traceability Basic conceptArchpoint: Architectural pointPoints for representing the essence of architectural design.Architecture represented by inter-component structure and message interaction among components can be designed.ArchMapping: Archpoint mappingA mechanism for design traceabilityAn archpoint such as message send in design is mapped to a program point such as method call in code.Traceability can be verified by checking whether archpoints are consistently mapped to program points while preserving order. For this checking, an SMT (Satisfiability Modulo Theories) solver is used.12Architectural points and mapping13Archpoint and ArchMapping14

Bidirectional traceability while preserving appropriate abstraction levelSMTsolver

In this talk, Archmapping is introduced from behavioral aspectsBisimulation-based synchronizationThere is a bisimulation relation between design and code. We cannot distinguish code from its associated design in terms of archpoints.Moreover, a sequence of archpoints (behavioral archpoints such as message send) can be regarded as a process if we regard the sequence as a trace of an LTS (Labelled Transition System).15Bisimulation-based synchronization16

AbstractionBisimulation in terms of archpointsTranslation from Archfaceinto logical formula17

cSubjectComponent interfacecObserverComponent interfacecObserverPatternConnector interfaceArchitectural designLogicalformulaAspectJpointcutDesign description18

Architecture is defined asa set of archpoints anda set of constraints among them.[List 3]Observer_Pattern := sequence(; [predicate] cSubject_setState_message_receive,; archpoint cSubject_notify_message_send,; archpoint cSubject_notify_message_receive,; archpoint iteration(; [predicate] cSubject_update_message_send,; archpoint cObserver_update_message_receive,; archpoint cObserver_getState_message_send,; archpoint cSubject_getState_message_receive)); archpoint

Program description19

A program can be represented asa set of program points anda set of constraints among them.[List 4]Program_List1 := sequence(; [predicate] cSubject_setState_execution,; program point iteration(; [predicate] cSubject_size_call,; program point Vector_size_execution,; program point cSubject_get_call,; program point Vector_get_execution,; program point cSubject_update_call,; program point cObserver_update_execution,; program point cObserver_getState_call,; program point cSubject_getState_execution,; program point cObserver_println_call,; program point System_out_println_execution)); program pointTraceability check based on ArchMapping20

ArchMapping: refine

Traceability checkNot satisfied !Code does not conform to it design !SMT-based traceability checking21SMT (Satisfiability Modulo Theories)SMT generalizes SAT (Satisfiability).TheoriesUninterpreted function symbols with equalityLinear real and integer arithmeticTuplesRecordsExtensional arraysYices, one of SMT solvers, decides the satisfiability of logical formulas.22Yices: http://yices.csl.sri.com/22Yices eccoding23

A sequence of archpointsIs encoded by an array.Order preservationExample of verification-- Model checking24

Verification of temporal behavior of architectural design

Yices encoding

Bounded model checkingLTLConclusions and Future work25SummaryThe essence of our approach is a fruitful integration ofa design abstraction mechanism based on archpoints,bidirectional mapping between archpoints and program points, andSMT-based verification.26Future workIn this paper, we considered only one-to-one mapping between archpoints in design and program points in code.We think there is a case in which one-to-multiple mapping and multiple-to-one mapping are needed.2728Thank you for your attention.