Skip to content
Snippets Groups Projects
Commit b90ac090 authored by Jueun Park's avatar Jueun Park
Browse files

Update

parent 3787384b
No related branches found
No related tags found
No related merge requests found
Pipeline #11524 failed
\chapter{Evaluation}\label{ch:evaluation}
- RQ1 : Can we express approaches from related work? \\
\input{section/rq2}
\input{section/rq3}
RQ1 : Can we express approaches from related work? \\
To answer this question, we
- test data structure and mapping \\
- request generation \\
- parameter inference \\
......
\section{Expression of approaches in RAG}
RQ1 : Can we express approaches from related work? \\
To answer this question, we
- test data structure and mapping \\
- request generation \\
- parameter inference \\
- for future work: more approaches like analysis in RESTler, Constructing Operation Dependency Graph in RESTest, precise inference with stemming algor\\
- \\
- \\
\ No newline at end of file
\section{Adavantages of RAG in REST API Testing}
- RQ2 : What makes it easier to use RAGs than normal code, what makes it harder?\\
- attributes for navigation/name resolution \\
- implementing relative bigger and structured codes with small definitions\\
- effort to be used to JastAdd\\
% Helpful attributes (Collection, inherited, easier return with =)
During the implementation phase of parameter inference, RAG was beneficial at writing codes. At writing codes for parser and back-transformation, attributes could not be applied, because the functional parts change the structure of AST, which conflicts to the definition of attribute and also in JastAdd. So, it could not be realized that attributes can be practical. But, following attributes and features of JastAdd were helpful to construct the generators and implement them:
\begin{itemize}
\item As long as a returning value can be called or storable in primitive way, the syntax in RAG is reduced with an equals sign and simpler than in common programming language. Therefore, the source codes are compact. To compare how RAG could be implemented effectively, see the implementation of an attribute in this work in Listing 5.3 and how this attribute is defined in common Java description in Listing 5.4.
\item To iterate all paths available in OpenAPI, an inherited attribute facilitated the writing effort. Paths Objects are child nodes of OpenAPI Object, so, all that should have been done was only two lines of code instead of writing an extra for loop. See Listing 5.5.
\item As its name, Reference Attribute Grammar, every AST node can be referenced by an attribute. For instance, with a collection attribute. A reference defined in Listing 4.1 contains only a String variable named Ref, it still could provide its Object like in Listing 5.6.
\end{itemize}
\begin{lstlisting}[language=JRAG,label={lst:attribute-infParam},caption={Attribute InferredParameter.value()}]
syn String InferredParameter.value() = getParameter().substring( getParameter().indexOf("?") + 1 );
\end{lstlisting}
\begin{lstlisting}[language=JRAG,label={lst:java-infParam},caption={InferredParameter.value() in Java}]
public String InferredParameter.value() {
return getParameter().substring( getParameter().indexOf("?") + 1 );
}
\end{lstlisting}
\begin{lstlisting}[language=JRAG,label={lst:inherited},caption={Inherited Attribute in Paths Object}]
inh boolean PathsObject.inferUrl();
eq OpenAPIObject.getPathsObject(int i).inferUrl(){
...
}
\end{lstlisting}
\begin{lstlisting}[language=JRAG,label={lst:coll-param},caption={Collection Attribute in Parameter Object}]
coll List<ParameterTuple> OpenAPIObject.parameterTuples() [new ArrayList<>()] root OpenAPIObject;
ParameterTuple contributes this
to OpenAPIObject.parameterTuples();
...
syn ParameterObject ParameterOb.parameterObject();
eq ParameterObject.parameterObject() = this;
eq ParameterReference.parameterObject() {
for( ParameterTuple t : root().parameterTuples() ){
if( t.getKey().equals(getRef().substring(getRef().lastIndexOf("/")+1, getRef().length())) )
return t.getParameterOb().parameterObject();
}
return new ParameterObject();
}
\end{lstlisting}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment