Specification and Automated Analysis of Inter-Parameter Dependencies in Web APIs - Supplementary material

Alberto Martin-Lopez, Sergio Segura, Carlos Müller, and Antonio Ruiz-Cortés

Universidad de Sevilla - {amarlop, sergiosegura, cmuller, aruiz}@us.es


In this page we include all complementary resources to the paper entitled Specification and Automated Analysis of Inter-Parameter Dependencies in Web APIs.

Previous work (ICSOC’19)

The contributions presented in this paper are built on the results of a study on the presence of inter-parameter dependencies in real-world APIs presented in ICSOC’19. According to the diff tool Copyleaks, the percentage of similarity of both publications is 14.2%.

Inter-parameter dependencies on real-world web APIs [dataset]

Note: if you are unable to see the embedded Google Sheet, it may be due to a current bug in Google Docs (see here and here). As a work around, you can log out of your Google account or go incognito mode. Or you can see the non-embedded version of the dataset HERE.

This dataset contains all the information regarding the 40 web APIs selected for our study on the presence of inter-parameter dependencies in real-world web APIs, as well as statistics and charts regarding the number and type of dependencies found.

IDL and IDLReasoner resources

Next we list the resources involved in the development and validation of IDL and IDLReasoner.

IDL grammar

Here is a preview of the full version of the grammar of IDL. It is also available here.

grammar es.us.isa.interparamdep.InterparameterDependenciesLanguage with org.eclipse.xtext.common.Terminals

generate interparameterDependenciesLanguage "http://www.isa.us.es/interparamdep/InterparameterDependenciesLanguage"

Model:
	dependencies+=Dependency*
;

Dependency:
	dep=(RelationalDependency | ArithmeticDependency | ConditionalDependency | PredefinedDependency) ';' NL?
;

terminal NL:
	('\r'? '\n')+
;

terminal BOOLEAN:
	'true'|'false'
;

terminal DOUBLE:
	('-'' '*)? INT ('.' INT)?
;

@Override 
terminal ID: 
    ('^')?('a'..'z'|'A'..'Z'|'_'|'.') ('a'..'z'|'A'..'Z'|'_'|'.'|'0'..'9')*
;

terminal ID_SPECIAL_CHARS: 
    '['('^')?('a'..'z'|'A'..'Z'|'_'|'.'|'-'|'/'|':') ('a'..'z'|'A'..'Z'|'_'|'.'|'-'|'/'|':'|'0'..'9')*']'
;

RelationalOperator:
	'<' | '>' | '<=' | '>=' | '==' | '!='
;

ArithmeticOperator:
	'+' | '-' | '*' | '/'
;

Not:
	'NOT'
;

LogicalOperator:
	'AND' | 'OR'
;

RelationalDependency:
	param1=Param relationalOp=RelationalOperator param2=Param
;

ArithmeticDependency:
	operation=Operation relationalOp=RelationalOperator result=DOUBLE
;

Operation:
	firstParam=Param operationContinuation=OperationContinuation |
	openingParenthesis='(' operation=Operation closingParenthesis=')' (operationContinuation=OperationContinuation)?
;

OperationContinuation:
	arithOp=ArithmeticOperator additionalParams=(Param|Operation)
;

ConditionalDependency:
	'IF' condition=Predicate 'THEN' consequence=Predicate
;

Predicate returns GeneralPredicate:
	firstClause=Clause (clauseContinuation=ClauseContinuation)?
;

Clause returns GeneralClause:
	firstElement=(Term|RelationalDependency|ArithmeticDependency|PredefinedDependency) |
	not=Not? openingParenthesis='(' predicate=Predicate closingParenthesis=')'
;

Term returns GeneralTerm:
	not=Not? param=Param |
	not=Not? param=ParamValueRelation
;

Param:
	name=(ID|ID_SPECIAL_CHARS)
;

ParamValueRelation:
	Param '==' stringValues+=STRING('|'stringValues+=STRING)* |
	Param 'LIKE' patternString=STRING |
	Param '==' booleanValue=BOOLEAN |
	Param relationalOp=RelationalOperator doubleValue=DOUBLE
;

ClauseContinuation returns GeneralClauseContinuation:
	logicalOp=LogicalOperator additionalElements=Predicate
;

PredefinedDependency returns GeneralPredefinedDependency:
	not=Not? predefDepType=('Or' | 'OnlyOne' | 'AllOrNone' | 'ZeroOrOne') '(' predefDepElements+=PositivePredicate (',' predefDepElements+=PositivePredicate)+ ')'
;

PositivePredicate returns GeneralPredicate:
	firstClause=PositiveClause (clauseContinuation=PositiveClauseContinuation)?
;

PositiveTerm returns GeneralTerm:
	param=Param |
	param=ParamValueRelation |
	RelationalDependency
;

PositiveClause returns GeneralClause:
	firstElement=(PositiveTerm|RelationalDependency|ArithmeticDependency|PositivePredefinedDependency) |
	openingParenthesis='(' predicate=PositivePredicate closingParenthesis=')'
;

PositiveClauseContinuation returns GeneralClauseContinuation:
	logicalOp=LogicalOperator additionalElements=PositivePredicate
;

PositivePredefinedDependency returns GeneralPredefinedDependency:
	predefDepType=('Or' | 'OnlyOne' | 'AllOrNone' | 'ZeroOrOne') '(' predefDepElements+=PositivePredicate (',' predefDepElements+=PositivePredicate)+ ')'
;

Web API operations modelled with IDL.

If you want to check the real IDL specifications, go here. Next, we give some more details regarding the APIs and operations selected for assessing the expressiveness capabilities of IDL:

1. APIs included in the original study

2. APIs not included in the original study

Test suite for IDL and IDLReasoner

Aiming to gain confidence on the correctness of the developed tools, we have created a thorough test suite comprising 218 test cases for validating both the language (IDL) and the constraint programming-aided tool (IDLReasoner):

Demo video

We have created a demo video showing some of the capabilities of the IDL editor and the IDLReasoner analysis library. Note: if you are unable to see the embedded video, click here to go to the original site.

Automated testing of RESTful APIs

Aiming to show the potential of our approach, we have performed two experiments in the context of automated testing of RESTful web services. The data resulting from the experiments is freely available in this repository. Among other results, we uncovered the following bugs in the services tested:

Stripe - Create product

Yelp - Search bussinesses


Powered by ISA group