WS-AT (Web service – Automatic Testing)

Contact : sebastien salva (http://sebastien.salva.free.fr)

Short Description : WS-AT aims at performing automatic testing on deployed web services, by using their WSDL2 descriptions only. Test cases are generated randomly and according a set of predefined values well known for relieving bugs. WS-AT gives a verdict on: the operation existence, the exception management and on the session existence.

 

Features:

Download:

Download here ! version 0.1

Download here ! version 1

Download here ! version Eclipse plugin

Plugin Install:

  Download and install Eclipse (tested on ganymede and galileo)

  • Dezip the WS-AT archive
  • Copy the .jar into the plugin directory (at the Eclipse root)
  • Copy Types.xml and Config.xml into the Eclipse root
  • Start Eclipse
  • Uninstall:

    Delete the .jar and the files

    Using WS-AT

    Copy the WSDL url and lauch the tests. A complete test report can be found in the Eclipse dir for the plugin version or in the Rapports dir.

    The file Types.xml is composed of values for some types. This file can be extended of course. The Config.xml file allows to customize the number of tests, The exception contructed by services (see the paper) and the timeout.

    A report example is given here. This one results from the test of some operations of the Amazon AWSEcommerce service.

    More detailed explanations can be found in the paper and in the presentation !

    WS-AT ha been extended in another specific version for automatic robustness testing. More details can be found in this paper.

     

     

    Using the first WS-AT version

    Open Eclipse now. You should see a new menu "WS-AT". The label "web service test" starts WS-AT.

    eclipse

    You obtain a panel allowing to choose between automatic testing ("validation simple") or manual testing :

    ws-at panel

    A user may perform automatic testing and may also choose a specific operation and the test values.
    UML

    The global UML activity diagram is illustrated bellow

    UML2

    1. Automatic testing :

    The automatic testing part checks these features : operation existence, exception management and session existence. More information can be found in this paper or in this presentation. Automatic testing depends on a set of predefined values saved into testeur-conf/ValeursTest.xml. This file is composed of predefined values for several types (integer, string, tabular, double,...). An example is given bellow.

    ValeursTest.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    Vous pouvez complétez les valeurs qui seront testé par le GenerateurTest en fonction des types de variables que la méthode du WebService attend.
    Mais ne pas modifier l'odre des valeurs. (La 4ème valeur doit etre une valeur valide)
    Un certain nombre de valeurs spéciales on été prévus :
    Valeurs spéciales:
    Elles sont à écrire entre parenthèses
    En voici la liste :
    (intRand+) : entier aléatoire positif
    (intRand-) : entier aléatoire négatif
    (doubleRand+) : double aléatoire positif
    (doubleRand-) : double aléatoire négatif
    (string8192) : chaine de 8192 caractères divers
    (null) : valeur null
    (min) : valeur minimun pour le type
    (max) : valeur maximun pour le type
    (overMin) : en dessous de la valeur minimun pour le type
    (overMax) : au dessus de la valeur maximun pour le type
    (infinity+) : valeur particulière Double.POSITIVE_INFINITY
    (infinity-) : valeur particulière Double.NEGATIVE_INFINITY
    -->
    <valeurs-tests>
    <type id="int">
    <!-- valeurs testé pour les types int -->
    <valeur value="0"/>
    <valeur value="1"/>
    <valeur value="10"/>
    <valeur value="100000"/>
    <valeur value="(intRand+)"/>
    <valeur value="(intRand+)"/>
    <valeur value="(intRand-)"/>
    <valeur value="(intRand-)"/>
    <!--<valeur value=""/>
    <valeur value="hello world"/>-->
    <valeur value="(intRand+)"/>
    <valeur value="(intRand-)"/>
    <!--<valeur value="(null)"/>-->
    <valeur value="(min)"/>
    <valeur value="(max)"/>
    <!--<valeur value="(overMin)"/>
    <valeur value="(overMax)"/>
    <valeur value="(infinity+)"/>
    <valeur value="(infinity-)"/>-->
    </type>

    Some keywords can be used into ValeursTest.xml such as null, intRand+, string(size) ... Obviously, this file can be modified.

    Once the tests are executed, another panel gives the results (pass or fail), the number of tests and a report describing each test and each received response.

    results

     

    2. Manual testing :

    This part can be used to perform manual testing. You need to choose the operation and to give parameter values. In the same way, a panel describes the results.

    manul test

     

    Video and more:

    A video showing the WS-AT functionning is given here:

     

     

     

    And an example is given bellow:

    input : a WSDL2 file

    WSDL2 URL.
    An example of a WSDL2 description (Calcul webservice)
    <wsdl2:description xmlns:wsdl2="http://www.w3.org/ns/wsdl" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://web" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wrpc="http://www.w3.org/ns/wsdl/rpc" xmlns:tns="http://web" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:whttp="http://www.w3.org/ns/wsdl/http" targetNamespace="http://web"><wsdl2:documentation>
    Please Type your service description here
    </wsdl2:documentation><wsdl2:types><xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://web">
    <xs:element name="calculer">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="a" type="xs:int" />
    <xs:element minOccurs="0" name="b" type="xs:int" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="calculerResponse">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="return" type="xs:int" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema></wsdl2:types><wsdl2:interface name="ServiceInterface"><wsdl2:operation name="calculer" style="http://www.w3.org/ns/wsdl/style/rpc" wrpc:signature="a #in b #in return #return " pattern="http://www.w3.org/ns/wsdl/in-out"><wsdl2:input element="ns:calculer" wsaw:Action="urn:calculer" /><wsdl2:output element="ns:calculerResponse" wsaw:Action="urn:calculerResponse" /></wsdl2:operation></wsdl2:interface><wsdl2:binding name="CalculSoap11Binding" interface="tns:ServiceInterface" type="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.1"><wsdl2:operation ref="tns:calculer" wsoap:action="urn:calculer" /></wsdl2:binding><wsdl2:binding name="CalculHttpBinding" interface="tns:ServiceInterface" whttp:methodDefault="POST" type="http://www.w3.org/ns/wsdl/http"><wsdl2:operation ref="tns:calculer" whttp:location="calculer" /></wsdl2:binding><wsdl2:binding name="CalculSoap12Binding" interface="tns:ServiceInterface" type="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.2"><wsdl2:operation ref="tns:calculer" wsoap:action="urn:calculer" /></wsdl2:binding><wsdl2:service name="Calcul" interface="tns:ServiceInterface"><wsdl2:endpoint name="CalculHttpSoap12Endpoint" binding="tns:CalculSoap12Binding" address="http://192.168.114.115:8080/axis2/services/Calcul.CalculHttpSoap12Endpoint/" /><wsdl2:endpoint name="CalculHttpSoap11Endpoint" binding="tns:CalculSoap11Binding" address="http://192.168.114.115:8080/axis2/services/Calcul.CalculHttpSoap11Endpoint/" /><wsdl2:endpoint name="CalculHttpEndpoint" binding="tns:CalculHttpBinding" address="http://192.168.114.115:8080/axis2/services/Calcul.CalculHttpEndpoint/" /></wsdl2:service></wsdl2:description>

    Output :

    A file describing the performed requests, the observed results and the local verdict. This file is given inside an Eclipse Plug-in interface, like this one:
    result2
    A result example for the Calcul web service (whose the description is given previously):
    Validité de la méthode  int calculer(int a, int b ):

    Test d'existance : La méthode existe.
    Gestion des exceptions : La gestion d'exceptions est valide.

     

    ====================================================Détails des tests ====================================================
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 0
    b (int) : 0
    En retour int:
    [0]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 1
    b (int) : 1
    En retour int:
    [2]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 10
    b (int) : 10
    En retour int:
    [20]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 100000
    b (int) : 100000
    En retour int:
    [200000]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 1346774368
    b (int) : 821947418
    En retour int:
    [-2126245510]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 1217403241
    b (int) : 126736804
    En retour int:
    [1344140045]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : -1506696104
    b (int) : -431589011
    En retour int:
    [-1938285115]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : -124130757
    b (int) : -306491984
    En retour int:
    [-430622741]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 668889227
    b (int) : 1333425108
    En retour int:
    [2002314335]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : -1080886341
    b (int) : -2098789456
    En retour int:
    [1115291499]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : -2147483648
    b (int) : -2147483648
    En retour int:
    [0]
    Le type de retour est valide
    -------------------------------
    Résultat du test sur la méthode calculer
    En entrée :
    a (int) : 2147483647
    b (int) : 2147483647
    En retour int:
    [-2]
    Le type de retour est valide