Testing Service Oriented Architectures Using Stateful Service - - PowerPoint PPT Presentation

testing service oriented architectures using stateful
SMART_READER_LITE
LIVE PREVIEW

Testing Service Oriented Architectures Using Stateful Service - - PowerPoint PPT Presentation

Testing Service Oriented Architectures Using Stateful Service Virtualization Via Machine Learning Hasan Ferit Eni ser, Alper Sen { hasan.eniser,alper.sen } @boun.edu.tr depend.cmpe.boun.edu.tr Department of Computer Engineering Bo gazi


slide-1
SLIDE 1

Testing Service Oriented Architectures Using Stateful Service Virtualization Via Machine Learning

Hasan Ferit Eni¸ ser, Alper Sen

{hasan.eniser,alper.sen}@boun.edu.tr depend.cmpe.boun.edu.tr Department of Computer Engineering Bo˘ gazi¸ ci University

AST 2018

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 1 / 39

slide-2
SLIDE 2

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 2 / 39

slide-3
SLIDE 3

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 3 / 39

slide-4
SLIDE 4

Motivation

In enterprise software systems, Service Oriented Architectures (SOA) help companies to achieve flexibility and scalability for business requirements.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 4 / 39

slide-5
SLIDE 5

Motivation

In enterprise software systems, Service Oriented Architectures (SOA) help companies to achieve flexibility and scalability for business requirements. As a result of such architectures, today’s enterprise software systems have higher number of interconnected services, interdependent teams and heterogeneous technologies.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 4 / 39

slide-6
SLIDE 6

Motivation

In such complex software systems, testers and developers suffer from the conditions below: Still evolving or uncompleted services.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 5 / 39

slide-7
SLIDE 7

Motivation

In such complex software systems, testers and developers suffer from the conditions below: Still evolving or uncompleted services. Limited capacity or availability of services at inconvenient times.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 5 / 39

slide-8
SLIDE 8

Motivation

In such complex software systems, testers and developers suffer from the conditions below: Still evolving or uncompleted services. Limited capacity or availability of services at inconvenient times. Services that are controlled by a third-party that grants restricted or costly access.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 5 / 39

slide-9
SLIDE 9

Motivation

In such complex software systems, testers and developers suffer from the conditions below: Still evolving or uncompleted services. Limited capacity or availability of services at inconvenient times. Services that are controlled by a third-party that grants restricted or costly access. Services that are needed simultaneously by different test teams with various set up and requirements.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 5 / 39

slide-10
SLIDE 10

Motivation

In such complex software systems, testers and developers suffer from the conditions below: Still evolving or uncompleted services. Limited capacity or availability of services at inconvenient times. Services that are controlled by a third-party that grants restricted or costly access. Services that are needed simultaneously by different test teams with various set up and requirements. Service virtualization can address some of these conditions.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 5 / 39

slide-11
SLIDE 11

Service Virtualization

Service Virtualization is a practice to create a virtual copy of a dependent component.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 6 / 39

slide-12
SLIDE 12

Service Virtualization

Service Virtualization is a practice to create a virtual copy of a dependent component. Service virtualization: is suitable for sharing within a team and across teams.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 6 / 39

slide-13
SLIDE 13

Service Virtualization

Service Virtualization is a practice to create a virtual copy of a dependent component. Service virtualization: is suitable for sharing within a team and across teams. is suitable for complex and very large (legacy) software that has many dependencies.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 6 / 39

slide-14
SLIDE 14

Service Virtualization

Service Virtualization is a practice to create a virtual copy of a dependent component. Service virtualization: is suitable for sharing within a team and across teams. is suitable for complex and very large (legacy) software that has many dependencies. can simulate performance and data characteristics of the real component.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 6 / 39

slide-15
SLIDE 15

Service Virtualization

Service Virtualization is a practice to create a virtual copy of a dependent component. Service virtualization: is suitable for sharing within a team and across teams. is suitable for complex and very large (legacy) software that has many dependencies. can simulate performance and data characteristics of the real component. is useful for test data management.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 6 / 39

slide-16
SLIDE 16

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-17
SLIDE 17

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Application Under Test Request Response

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-18
SLIDE 18

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder

Interaction Repository

Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-19
SLIDE 19

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder 1.Capture

Interaction Repository

Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-20
SLIDE 20

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder 1.Capture

Interaction Repository

Learn Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-21
SLIDE 21

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder 1.Capture 2.Model

Interaction Repository

Learn Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-22
SLIDE 22

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder 1.Capture 2.Model

Virtual Service

Interaction Repository

Learn Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-23
SLIDE 23

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

Service

Request Response Recorder 1.Capture Synthetic Response Request 2.Model

Virtual Service

Interaction Repository

Learn Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-24
SLIDE 24

Service Virtualization

The fundamental process of service virtualization practice can be abstracted into three phases; capture, model and simulate.

3.Simulate

Service

Request Response Recorder 1.Capture Request 2.Model

Virtual Service

Learn

Interaction Repository

Synthetic Response Application Under Test

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 7 / 39

slide-25
SLIDE 25

Service Virtualization

Services can be examined in two groups: Stateless services and Stateful services.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 8 / 39

slide-26
SLIDE 26

Service Virtualization

Services can be examined in two groups: Stateless services and Stateful services. Stateful services require to keep state history to predict the response of a request.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 8 / 39

slide-27
SLIDE 27

Service Virtualization

Services can be examined in two groups: Stateless services and Stateful services. Stateful services require to keep state history to predict the response of a request. An example stateful service can be a shopping cart service where a user must login first to get cart information.Actions like logging in, adding or removing items from the cart bring the service to a new state.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 8 / 39

slide-28
SLIDE 28

Service Virtualization

Services can be examined in two groups: Stateless services and Stateful services. Stateful services require to keep state history to predict the response of a request. An example stateful service can be a shopping cart service where a user must login first to get cart information.Actions like logging in, adding or removing items from the cart bring the service to a new state. Another example can be calender service where a user can create, delete or get events with a specific label. The user also can update event information.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 8 / 39

slide-29
SLIDE 29

Stateful Services

Figure: A sample interaction (request-response pair) trace.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 9 / 39

slide-30
SLIDE 30

Contributions

In this work, We propose techniques for automated stateful service virtualization.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 10 / 39

slide-31
SLIDE 31

Contributions

In this work, We propose techniques for automated stateful service virtualization. We employ two machine learning techniques to obtain a virtual service model from captured request response pairs.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 10 / 39

slide-32
SLIDE 32

Contributions

In this work, We propose techniques for automated stateful service virtualization. We employ two machine learning techniques to obtain a virtual service model from captured request response pairs. We implement our techniques in a tool and validate our approach on real services.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 10 / 39

slide-33
SLIDE 33

Contributions

In this work, We propose techniques for automated stateful service virtualization. We employ two machine learning techniques to obtain a virtual service model from captured request response pairs. We implement our techniques in a tool and validate our approach on real services. We compare our techniques with a state model inference tool.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 10 / 39

slide-34
SLIDE 34

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 11 / 39

slide-35
SLIDE 35

Related Work

Leading software companies such as IBM, HP, CA, SmartBear, and Parasoft provide various commercial service virtualization tools. These tools are compared and evaluated in reports [4, 5]. Current service virtualization solutions in the literature [1, 2, 6, 7] have limited accuracy and performance and they are applicable to stateless services only. Our previous work also provides a solution for stateless service

  • virtualization. [3]

As far as we know, there is no previous study tackling with stateful service virtualization.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 12 / 39

slide-36
SLIDE 36

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 13 / 39

slide-37
SLIDE 37

Proposed Techniques

We introduce two approaches for stateful service virtualization. In the first technique named Classification Based Virtualization (CBV), we formulate the response generation problem into a classification problem. In the second technique named Sequence-to-Sequence Based Virtualization (SSBV), we employ sequence-to-sequence models, which is a deep learning algorithm used in transformation of sequences from one form to another form.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 14 / 39

slide-38
SLIDE 38

Stateful Service Virtualization

3.Simulate

Service

Request Response Recorder 1.Capture Request 2.Model Virtual Service Train Model

Interaction Repository

Synthetic Response Application Under Test

Model

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 15 / 39

slide-39
SLIDE 39

Classification Based Virtualization (CBV)

Classification is a supervised learning method in pattern recognition where the task is to learn the mapping from the input to the output.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 16 / 39

slide-40
SLIDE 40

Classification Based Virtualization (CBV)

Classification is a supervised learning method in pattern recognition where the task is to learn the mapping from the input to the output. In a stateful service, a request’s response is affected by previous interactions in the history.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 16 / 39

slide-41
SLIDE 41

Classification Based Virtualization (CBV)

Classification is a supervised learning method in pattern recognition where the task is to learn the mapping from the input to the output. In a stateful service, a request’s response is affected by previous interactions in the history.

Incoming Request Synthetic Response

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 16 / 39

slide-42
SLIDE 42

Classification Based Virtualization (CBV)

Classification is a supervised learning method in pattern recognition where the task is to learn the mapping from the input to the output. In a stateful service, a request’s response is affected by previous interactions in the history.

Incoming Request Synthetic Response History

Therefore, we train a classifier that learns the mapping between the history

  • f requests and corresponding responses.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 16 / 39

slide-43
SLIDE 43

Classification Based Virtualization (CBV)

Inputs of this model show characteristics of categorical data, thus we employ one-hot encoding in our approach.

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ]

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 17 / 39

slide-44
SLIDE 44

Classification Based Virtualization (CBV)

Inputs of this model show characteristics of categorical data, thus we employ one-hot encoding in our approach.

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ] --- [ 1, 2, 4 ] createEvent event1 12/02/18 200, OK getEvent event1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 createEvent event1 12/02/18 200, OK getEvent event1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ] [

Attributes Outputs

Figure: An example datapoint that is provided to the classifier.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 17 / 39

slide-45
SLIDE 45

Classification Based Virtualization (CBV)

Inputs of this model show characteristics of categorical data, thus we employ one-hot encoding in our approach.

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ] --- [ 1, 2, 4 ] createEvent event1 12/02/18 200, OK getEvent event1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 createEvent event1 12/02/18 200, OK getEvent event1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 … … … 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ] [

Attributes Outputs

Figure: An example datapoint that is provided to the classifier.

If the incoming request or the history contains a feature that is not seen in training data, it is encoded in a way that is different from all other features in the training data.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 17 / 39

slide-46
SLIDE 46

Classification Based Virtualization (CBV)

We obtain best results with Repeated Incremental Pruning to Produce Error Reduction (RIPPER) which is a pure rule based classification

  • algorithm. RIPPER produces a set of IF-THEN rules for separation.

Note that, we predict more than one class and those classes can possibly be assigned to more than two types of labels. This kind of classification is called multioutput-multiclass classification. This technique requires parsing the interactions to find request types, contents and the response to be encoded. Appropriate to use it on well-known message protocols e.g. JSON, XML.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 18 / 39

slide-47
SLIDE 47

Sequence-to-Sequence Based Virtualization (SSBV)

A sequence-to-sequence model is a special form of Recurrent Neural Network (RNNs), namely, Long Short Term Memory (LSTM). LSTMs allow the usage of historical data in several steps in the future.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 19 / 39

slide-48
SLIDE 48

Sequence-to-Sequence Based Virtualization (SSBV)

A sequence-to-sequence model is a special form of Recurrent Neural Network (RNNs), namely, Long Short Term Memory (LSTM). LSTMs allow the usage of historical data in several steps in the future.

Embedding how are you? I am fine Encoder Decoder 1 2 3 4 5 6

Figure: The general outline of sequence-to-sequence models consisting of an encoder and a

  • decoder. The sequence how are you? is transformed to sequence I am fine in the figure.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 19 / 39

slide-49
SLIDE 49

Sequence-to-Sequence Based Virtualization (SSBV)

A sequence-to-sequence model is a special form of Recurrent Neural Network (RNNs), namely, Long Short Term Memory (LSTM). LSTMs allow the usage of historical data in several steps in the future.

Embedding how are you? I am fine Encoder Decoder 1 2 3 4 5 6

Figure: The general outline of sequence-to-sequence models consisting of an encoder and a

  • decoder. The sequence how are you? is transformed to sequence I am fine in the figure.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 19 / 39

slide-50
SLIDE 50

Sequence-to-Sequence Based Virtualization (SSBV)

We start with creating a vocabulary with the letters and characters in interaction repository. In the embedding phase the input sequence is transformed to a list with enumeration IDs of the letters in the input.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 20 / 39

slide-51
SLIDE 51

Sequence-to-Sequence Based Virtualization (SSBV)

We start with creating a vocabulary with the letters and characters in interaction repository. In the embedding phase the input sequence is transformed to a list with enumeration IDs of the letters in the input. The encoder learns to encode an input sequence into a vector and the decoder learns to decode this vector back to the output sequence.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 20 / 39

slide-52
SLIDE 52

Sequence-to-Sequence Based Virtualization (SSBV)

We start with creating a vocabulary with the letters and characters in interaction repository. In the embedding phase the input sequence is transformed to a list with enumeration IDs of the letters in the input. The encoder learns to encode an input sequence into a vector and the decoder learns to decode this vector back to the output sequence. In training our sequence-to-sequence model, we use prefixes of interaction traces, hence the model is learned iteratively.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 20 / 39

slide-53
SLIDE 53

Sequence-to-Sequence Based Virtualization (SSBV)

We start with creating a vocabulary with the letters and characters in interaction repository. In the embedding phase the input sequence is transformed to a list with enumeration IDs of the letters in the input. The encoder learns to encode an input sequence into a vector and the decoder learns to decode this vector back to the output sequence. In training our sequence-to-sequence model, we use prefixes of interaction traces, hence the model is learned iteratively.

Table: Sample inputs and the outputs used to train our sequence-to-sequence model.

Input Output createEvent event1 12/02/18 200, OK createEvent event1 12/02/18 200, OK updateEvent 12/03/18 200, OK createEvent event1 12/02/18 200, OK updateEvent 12/03/18 200, OK getEvent event1 event1 12/03/18 200, OK

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 20 / 39

slide-54
SLIDE 54

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 21 / 39

slide-55
SLIDE 55

Evaluation

We used two services in evaluation, namely, a proprietary Airline Ticketing Service (ATS) and Google Calendar API (Calendar).

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 22 / 39

slide-56
SLIDE 56

Evaluation

We used two services in evaluation, namely, a proprietary Airline Ticketing Service (ATS) and Google Calendar API (Calendar).

Correctness Evaluation

CBV:

Exact Matching Ratio (EMR) Subset Matching Ratio (SMR) Micro averaged F-score (Fmicro) Macro averaged F-score (Fmacro)

SSBV:

Accuracy

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 22 / 39

slide-57
SLIDE 57

Evaluation

We used two services in evaluation, namely, a proprietary Airline Ticketing Service (ATS) and Google Calendar API (Calendar).

Correctness Evaluation

CBV:

Exact Matching Ratio (EMR) Subset Matching Ratio (SMR) Micro averaged F-score (Fmicro) Macro averaged F-score (Fmacro)

SSBV:

Accuracy

Performance Evaluation

Performance refers to the training time of the models for both of CBV and SSBV.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 22 / 39

slide-58
SLIDE 58

Evaluation

This is a multiclass-multilabel classification problem. Exact Matching requires all the classes predicted for an input to be true. Exact Matching Ratio is number of predictions satisifying exact matching over number of all predictions. On the other hand, Subset Matching Ratio is number of all correctly predicted classes over number of all classes predicted. Micro- and macro-averaged F-scores are multiclass extensions of simple binary classification F-score.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 23 / 39

slide-59
SLIDE 59

Evaluation

Our experimental design: We collected 400 traces for each of the services and each trace contains 10 interactions (request-response pairs).

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 24 / 39

slide-60
SLIDE 60

Evaluation

Our experimental design: We collected 400 traces for each of the services and each trace contains 10 interactions (request-response pairs). We compared CBV and SSBV with another tool in the literature, namely, EFSM Tool [8].

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 24 / 39

slide-61
SLIDE 61

Evaluation

Our experimental design: We collected 400 traces for each of the services and each trace contains 10 interactions (request-response pairs). We compared CBV and SSBV with another tool in the literature, namely, EFSM Tool [8]. For CBV method, we use Weka implementation of RIPPER and for SSBV method, we created models using Tensorflow library.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 24 / 39

slide-62
SLIDE 62

Evaluation

Our experimental design: We collected 400 traces for each of the services and each trace contains 10 interactions (request-response pairs). We compared CBV and SSBV with another tool in the literature, namely, EFSM Tool [8]. For CBV method, we use Weka implementation of RIPPER and for SSBV method, we created models using Tensorflow library. We employed 5-fold cross validation for CBV and EFSM Tool.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 24 / 39

slide-63
SLIDE 63

Evaluation

Our experimental design: We collected 400 traces for each of the services and each trace contains 10 interactions (request-response pairs). We compared CBV and SSBV with another tool in the literature, namely, EFSM Tool [8]. For CBV method, we use Weka implementation of RIPPER and for SSBV method, we created models using Tensorflow library. We employed 5-fold cross validation for CBV and EFSM Tool. Experiments were run on a server with 16 GB memory and Intel Xeon E5-2630L v2 2.40GHz CPU.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 24 / 39

slide-64
SLIDE 64

Evaluation

Table: Parameters selected in experiments.

Method Parameters CBV (RIPPER) minNo = 1 SSBV (Tensorflow) hidden size = 25 batch size = 128 layers = 2 epochs = 1 iteration = 1000 EFSM Tool (J48) default Our primary concern in choosing those parameters is maximizing the correctness of the models.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 25 / 39

slide-65
SLIDE 65

Evaluation

Table: Correctness results of CBV, SSBV and EFSM Tool for different values of k where k is the number of previous interactions considered.

Service k CBV EFSM Tool SSBV EMR(%) SMR(%) Fmacro Fmicro EMR(%) SMR(%) Fmacro Fmicro Accuracy ATS 1 76.6 79.6 0.781 0.767 78.1 80.6 0.803 0.783 92.1 Calendar 1 70.3 78.5 0.757 0.741 70.7 76.0 0.721 0.715 93.2 ATS 5 82.7 84.3 0.813 0.798 80.0 83.7 0.806 0.786 96.5 Calendar 5 81.1 84.1 0.843 0.825 71.5 77.1 0.753 0.741 97.3 ATS 10 82.7 84.3 0.813 0.798 80.0 83.7 0.806 0.786 96.5 Calendar 10 82.0 88.5 0.871 0.866 72.1 78.0 0.767 0.751 99.3

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 26 / 39

slide-66
SLIDE 66

Evaluation

Table: Correctness results of CBV, SSBV and EFSM Tool for different values of k where k is the number of previous interactions considered.

Service k CBV EFSM Tool SSBV EMR(%) SMR(%) Fmacro Fmicro EMR(%) SMR(%) Fmacro Fmicro Accuracy ATS 1 76.6 79.6 0.781 0.767 78.1 80.6 0.803 0.783 92.1 Calendar 1 70.3 78.5 0.757 0.741 70.7 76.0 0.721 0.715 93.2 ATS 5 82.7 84.3 0.813 0.798 80.0 83.7 0.806 0.786 96.5 Calendar 5 81.1 84.1 0.843 0.825 71.5 77.1 0.753 0.741 97.3 ATS 10 82.7 84.3 0.813 0.798 80.0 83.7 0.806 0.786 96.5 Calendar 10 82.0 88.5 0.871 0.866 72.1 78.0 0.767 0.751 99.3

Virtual services created using SSBV technique are accurate enough to replace the real services when 90% or more accuracy is needed. Virtual services created using CBV technique can replace the real services when an exact match is not required and a high subset match is enough.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 26 / 39

slide-67
SLIDE 67

Evaluation

Table: Performance results of CBV, SSBV and EFSM Tool for different values of k where k is the number of previous interactions considered. Training time in format (hh:mm). Service k SSBV CBV EFSM Tool ATS 1 01:42 00:01 00:06 Calendar 1 02:21 00:01 00:06 ATS 5 08:51 00:03 00:11 Calendar 5 09.54 00:03 00:14 ATS 10 14:42 00:04 00:18 Calendar 10 16:19 00:04 00:19

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 27 / 39

slide-68
SLIDE 68

Evaluation

Table: Performance results of CBV, SSBV and EFSM Tool for different values of k where k is the number of previous interactions considered. Training time in format (hh:mm). Service k SSBV CBV EFSM Tool ATS 1 01:42 00:01 00:06 Calendar 1 02:21 00:01 00:06 ATS 5 08:51 00:03 00:11 Calendar 5 09.54 00:03 00:14 ATS 10 14:42 00:04 00:18 Calendar 10 16:19 00:04 00:19

If time is not in the first place, SSBV method can be used to virtualize a service since SSBV is the most successful method for generating correct

  • responses. If time is limited it would be logical to use CBV.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 27 / 39

slide-69
SLIDE 69

Table of Contents

1

Introduction

2

Related Work

3

Method

4

Evaluation

5

Conclusions

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 28 / 39

slide-70
SLIDE 70

Conclusions

Service virtualization is getting popular with the rise of multi-layered and service oriented architectures. In this work, we developed techniques for automatically creating stateful virtual services.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 29 / 39

slide-71
SLIDE 71

Conclusions

Service virtualization is getting popular with the rise of multi-layered and service oriented architectures. In this work, we developed techniques for automatically creating stateful virtual services. We presented machine learning based methods to create virtual services namely CBV and SSBV. CBV transforms response prediction problem into a classification problem.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 29 / 39

slide-72
SLIDE 72

Conclusions

Service virtualization is getting popular with the rise of multi-layered and service oriented architectures. In this work, we developed techniques for automatically creating stateful virtual services. We presented machine learning based methods to create virtual services namely CBV and SSBV. CBV transforms response prediction problem into a classification problem. In SSBV, we employ sequence-to-sequence models for response generation.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 29 / 39

slide-73
SLIDE 73

Conclusions

Our evaluations demonstrate that the techniques introduced in this work are successful in terms of the defined metrics.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 30 / 39

slide-74
SLIDE 74

Conclusions

Our evaluations demonstrate that the techniques introduced in this work are successful in terms of the defined metrics. In future, we plan to reduce training time of models while preserving correctness as high as SSBV’s correctness for stateful service virtualization.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 30 / 39

slide-75
SLIDE 75

Conclusions

Our evaluations demonstrate that the techniques introduced in this work are successful in terms of the defined metrics. In future, we plan to reduce training time of models while preserving correctness as high as SSBV’s correctness for stateful service virtualization. infer the state machine of a service using recorded requests and responses.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 30 / 39

slide-76
SLIDE 76

QA

Thank you for listening. Questions?

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 31 / 39

slide-77
SLIDE 77

Bibliography I

  • M. Du, J.-G. Schneider, C. Hine, J. Grundy, and S. Versteeg.

Generating service models by trace subsequence substitution. In Proceedings of the 9th international ACM Sigsoft conference on Quality of software architectures, pages 123–132. ACM, 2013.

  • M. Du, S. Versteeg, J.-G. Schneider, J. Han, and J. Grundy.

Interaction traces mining for efficient system responses generation. ACM SIGSOFT Software Engineering Notes, 40(1):1–8, 2015.

  • H. Eniser and A. Sen.

Fancymock: Creating virtual services from transactions. In Proceedings of the 33rd ACM SAC, 2018.

  • D. L. Giudice.

Service virtualization and testing solutions. Forrester Wave, 2014.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 32 / 39

slide-78
SLIDE 78

Bibliography II

  • T. E. Murphy and N. Wilson.

Magic quadrant for integrated software quality suites. Gartner Research, 2013. J.-G. Schneider, P. Mandile, and S. Versteeg. Generalized suffix tree based multiple sequence alignment for service virtualization. In Software Engineering Conference (ASWEC), 2015 24th Australasian, pages 48–57. IEEE, 2015.

  • S. Versteeg, M. Du, J.-G. Schneider, J. Grundy, J. Han, and M. Goyal.

Opaque service virtualisation: a practical tool for emulating endpoint systems. In Proceedings of the 38th International Conference on Software Engineering Companion, pages 202–211. ACM, 2016.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 33 / 39

slide-79
SLIDE 79

Bibliography III

  • N. Walkinshaw, R. Taylor, and J. Derrick.

Inferring extended finite state machine models from software executions. Empirical Software Engineering, 21(3):811–853, 2016.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 34 / 39

slide-80
SLIDE 80

Definitions

Let Req, Res, Treq, Tres, CReq, CRes be a finite set of requests, responses, request types, response types, request contents, response contents, respectively.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 35 / 39

slide-81
SLIDE 81

Definitions

Let Req, Res, Treq, Tres, CReq, CRes be a finite set of requests, responses, request types, response types, request contents, response contents, respectively. A request, req ∈ Req is a 2-tuple (type, content), where type ∈ Treq and content ∈ Creq.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 35 / 39

slide-82
SLIDE 82

Definitions

Let Req, Res, Treq, Tres, CReq, CRes be a finite set of requests, responses, request types, response types, request contents, response contents, respectively. A request, req ∈ Req is a 2-tuple (type, content), where type ∈ Treq and content ∈ Creq. A response, res ∈ Res is also a 2-tuple (type, content), where type ∈ Tres and content ∈ Cres.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 35 / 39

slide-83
SLIDE 83

Definitions

Let Req, Res, Treq, Tres, CReq, CRes be a finite set of requests, responses, request types, response types, request contents, response contents, respectively. A request, req ∈ Req is a 2-tuple (type, content), where type ∈ Treq and content ∈ Creq. A response, res ∈ Res is also a 2-tuple (type, content), where type ∈ Tres and content ∈ Cres. An interaction is defined as a request response pair: (req, res) with req ∈ Req and res ∈ Res.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 35 / 39

slide-84
SLIDE 84

Definitions

We define an interaction trace, it ∈ IT as a finite sequence of interactions observed during the execution of the service; (req1, res1), (req2, res2), . . . , (reqn, resn).

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 36 / 39

slide-85
SLIDE 85

Definitions

We define an interaction trace, it ∈ IT as a finite sequence of interactions observed during the execution of the service; (req1, res1), (req2, res2), . . . , (reqn, resn). A Interaction Repository (IR) keeps all recorded interaction traces.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 36 / 39

slide-86
SLIDE 86

Definitions

We define an interaction trace, it ∈ IT as a finite sequence of interactions observed during the execution of the service; (req1, res1), (req2, res2), . . . , (reqn, resn). A Interaction Repository (IR) keeps all recorded interaction traces. History, h, of a request reqi, hreqi = (req1, res1), . . . , (reqi−1, resi−1), (reqi), that is, the trace ends with reqi and the corresponding response is absent.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 36 / 39

slide-87
SLIDE 87

Definitions

We define an interaction trace, it ∈ IT as a finite sequence of interactions observed during the execution of the service; (req1, res1), (req2, res2), . . . , (reqn, resn). A Interaction Repository (IR) keeps all recorded interaction traces. History, h, of a request reqi, hreqi = (req1, res1), . . . , (reqi−1, resi−1), (reqi), that is, the trace ends with reqi and the corresponding response is absent. Similarly, the k history of a request reqi is shown as: hk

reqi = (reqi−k, resi−k), (reqi−k+1, resi−k+1), . . . , (reqi).

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 36 / 39

slide-88
SLIDE 88

Definitions

The set of all histories for all requests in all interaction traces is denoted by H.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 37 / 39

slide-89
SLIDE 89

Definitions

The set of all histories for all requests in all interaction traces is denoted by H. The set of all k histories of all requests in all interaction traces is denoted by Hk.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 37 / 39

slide-90
SLIDE 90

Definitions

The set of all histories for all requests in all interaction traces is denoted by H. The set of all k histories of all requests in all interaction traces is denoted by Hk. A stateful service, StatefulS : H → Res, is a function from the set

  • f histories to the set of responses.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 37 / 39

slide-91
SLIDE 91

Definitions

The set of all histories for all requests in all interaction traces is denoted by H. The set of all k histories of all requests in all interaction traces is denoted by Hk. A stateful service, StatefulS : H → Res, is a function from the set

  • f histories to the set of responses.

A stateless service, StatelessS : Req → Res, is a function from the set of requests to the set of responses.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 37 / 39

slide-92
SLIDE 92

Definitions

The set of all histories for all requests in all interaction traces is denoted by H. The set of all k histories of all requests in all interaction traces is denoted by Hk. A stateful service, StatefulS : H → Res, is a function from the set

  • f histories to the set of responses.

A stateless service, StatelessS : Req → Res, is a function from the set of requests to the set of responses. A virtual service, VS : Hk → Ressyn is a function where Hk is k histories of all requests, Ressyn is a finite set of synthesized responses, where k equals to 1 for a stateless service.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 37 / 39

slide-93
SLIDE 93

Metrics

ExactMatchRatio = 1 n

n

  • i=1

1Ei(Pi) SubsetMatchRatio = 1 np

n

  • i=1

p

  • j=1

1Eij(Pij) where 1A : X → {0, 1} defined as 1A(x) :=

  • 1,

if x = A 0, if x = A E: expected outputs P: predicted outputs n: the number of tests in validation phase p: the number outputs predicted.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 38 / 39

slide-94
SLIDE 94

Metrics

F c

macro =

2 n

i=1

p

j=1 Y c ij Z c ij

n

i=1 Z c i + n i=1 Y c i

Fmacro = 1 |C|

|C|

  • k=1

F ck

macro

Fmicro = 2 |C|

k=1

p

j=1

n

i=1 Y ck ij Z ck ij

|C|

k=1

p

j=1

n

i=1 Z ck ij + |C| k=1

p

j=1

n

i=1 Y ck ij

where Y ck

ij

=

  • 1,

if ck is actually at Yij 0,

  • therwise

Z ck

ij =

  • 1,

if ck is correctly predicted at Zij 0,

  • therwise

Set C = {c1, c2, . . . , cn} is the set of all classes to be predicted.

Hasan Ferit Eni¸ ser, Alper Sen AST 2018 28 May 2018 39 / 39