sabato 29 dicembre 2012

Category Partition Testing.. in Italian



Il Category Partition Testing ha lo scopo di individuare delle categorie di parametri e di condizioni del sistema che aiutini i tester a svolgere il proprio lavoro (blablabla).
Ma come si procede praticamente? Dalla specifica vengono Identificate informazioni relative le funzioni e il comportamento del sistema stesso: questi sono rispettivamente i parametri e le condizioni del sistema.
Ma cosa sono questi parametri/stati? Delle  particolari categorie di input del SUT (sistema sotto test) in relazione a determinati stati del sistema..
Cosa ci facciamo di questi parametri? Per ciascuno di questi vengono definite le CHOISES, cioè gli input associati a quella categoria.
Le combinazioni tra i diversi input applicabili al sistema formano la test suite.
Siamo Apposto? NO.. la test suite è composta da troppe combinazioni.
-> CERCHIAMO DI RIDURLE.. ma come? Eliminando le combinazioni che sono invalide.. ma  in che MANIERA? Per ogni input relativo le cateogorie indichiamo se gode di alcune proprietà  e/o lo si associa ad una condizione [il tutto indicato tra quadre]. In questo modo una combinazione contenente due opzioni che godono di proprietà/condizioni differenti  (quindi contrastanti) --> possono essere eliminate. 

Now enjoy this song!


venerdì 11 maggio 2012

An Https Rss Desktop Notifier

Hi All. In the prevoius months i wrote a simple application that keep you tuned with your facebook notification. This application is a simple skecth made to verify the functionality of my library, the #cabac library. Is a simple jar that consists only of a system tray icon. If you have time to try it, i really will appreciate your comment. The core of application is a simple translator that convert an rss page in a simple number (number of notification not yet readed by the application). On linux/ubuntu it works fine, but under windows 7 the icon is not highly defined (i'm talking about image). You must only define the rss link (i tested the facebook rss page notification). Let me know if you need help. Test It! https://docs.google.com/open?id=0B9A7lJY7jyEIc0ttY2M3bUljb1E

domenica 15 aprile 2012

Some anticipation of the first application (PT1) - Facebook Desktop Notifier


From two previous post, we understood that a primary goal of our works is INTEGRATE application. Now we would make things more interesting, (as possible). Let's start with a simple example: this first example is far to the reality, but is interesting (also for me) to see the behaviour of the library in a simple real situation

Ok, let's start!

Now we suppose that we want to manage Facebook notifications, through rss format (see http://www.kristi-barrow.com/facebook-rss-feeds-what-is-available/ ; facebook make it able an xml page with some notification,   reachable through a simple secure link). On the other hand, suppose that we have a little client that can manage some kind of notification, but not in RSS format.

This application expects to receives the 'number' of notifications that are not yet been read, , contacting directly facebook. However, facebook doesn't provide this service: it allows only to receive the rss file.

How we can manage this situation? From my point of view, we could integrate these application through a connector :) In an informal way, we can follow these steps: we fetch the rss notifications from facebook, adapt the informations (with the connector) and provide its to the client. Ok, let's start to see how do it!

The first step can be resolved by defining a simple https connection to the specific link (http://www.new.facebook.com/feeds/notifications.php?id=your_facebook_id&viewer=your_facebook_id&key=your_internal_key&format=rss20). This step are solved by the client application

Ok, now we can continue with the second step. In this step we practically define our connector.

This connector must transform the xml file into a big 'Rss' Object. To do this, we can define a translator primitive (we discussed it in the previous post) that consume from the xml file e, through  the transforming logic (that consist of an Rss parser) converts the file into a RSS Object (we can use the rss lib utils).

Finally, this translator write the result of the transformation - a simple number - on a txt file; this file will be read by the client application, that on own will notify the user of this new information

This is the result 
(Simple System Tray Icon)

Nexts posts will explain step by step how obtain things like these :).. Stay tuned

domenica 8 aprile 2012

How use a term of the algebra

To build a connector, we must define at least one term, called primitive: these primitives are explained in the previous post. Ok lets' start to see how define a connector composed by a single trm.

Suppose that an application would to provide a txt file of a non standard format, while the reader expect to manage a csv file. To make this last application able to read the file without modify the logic of the application, we can build a connector that 'transform' the file provided file with a csv structure.

Initially, we must define the term:

 Trans t = new Trans(source_uri, type_in, receiver_uri, type_out);

 where :
 1) source_uri indicates how the message -in this case the non standard format file- can be received (it can be a request such http - you can find all the supported uris here http://camel.apache.org/components.html )

 2) type_in is the type of the incoming message, in this case we can assume File.class (it must be an existing implemented class)

 3) the receiver_uri is such the source_uri; the important things is that we must know how the client application fetch its files. For example, if the client read the cvs file from a specific folder, we must write the result of the transformation in this folde: in this case we can use the supporte file uri (http://camel.apache.org/file2.html) and specifiy "file:target_folder?fileName=output.csv" as parameter.

4)The output_type is such the type, but in this case could be exists a specifi class, like CSVFile.class 

Ok! Once specified these base informations, we must define the transform logic. To do this, we must define (in the same class or in another accesible class) a method that make the transformation: in our case

public CSVFile transformMethod(File file){
        //read the file
        //construct the new file
   
        //return the constructed CSVfile


A the end of this process, we must bind this definition with the translator object:

t.setTransLogic(class_that_contain_the_method.class, "transformMethod");

 At the end of this step, we can start the connector:

 t.start();
 Thread.sleep(2000);

 and keep the application alive for 2 seconds. A the at the end of the execution the client is ready to starts the processing! There are lot of consideration around this little example. I'm pleased to answer, if possible, to your questions :)

sabato 31 marzo 2012

Installing the library and some explaination about primitives of the algebra

To use the Cabac Library, we must includes all necessary dependencies. You can find all the necessaries files in this page: http://code.google.com/p/otf-connector/downloads/list. You must download two file: the latest version of Cabac Library (now 1.1) and the dependencies.zip file. Once downloaded, decompress the zip file. Now open your favourite IDE; create a new Java Project and includes as external jars all decompressed files plus the cabac library.

As we said in a previous post, the connector algebra introduces a set of 'primitives' that models basic mismatch situation. These primitives are related to the mediator pattern introduced by the Go4. We have six basic primitives (explaination extracted from Towards Connector Algebra Paper):

  1. Extra send. This first mismatch considers a component that generates a redundant message a. Such a mismatch may be resolved by introducing a consumer that swallows the superfluous message. We model this by a parameterised primitive Cons(a).
  2. Missing send. This mismatch describes the case in which a component expects a message a that is not sent by another component. A mismatch of this type may be resolved by introducing a producer that generates the required message. This may be modelled by a parameterised primitive Prod(a).
  3. Signature mismatch. There are occasions when a message to be exchanged between two components is functionally compatible yet syntactically inconsistent. In the case of Connect, the functional equivalence of the messages a and b is assumed to be specified in an ontology. Such a mismatch may be resolved by means of a translating primitive T rans(a, b) that accepts message a as input and produces message b as output.
  4. Split message mismatch. A component may expect to receive a message a as a sequence of fragments of a. If message a can be decomposed into a1 , . . . , an , then the mismatch may be resolved with a primitive Split(a, [a1 , . . . , an ]) which accepts message a as input and offers a1 , . . . , an as output in that order.
  5. Merge message mismatch. Similar to the previous case, some components expect to receive a single message a in place of a fragmented version of a. If messages a1 , . . . , an can be composed into a, then the mismatch may be resolved with a primitive M erge([a1 , . . . , an ], a) which accepts messages a1 , . . . , an as input in that order, and generates a as output.
  6. Ordering mismatch. A component can expect to receive messages in an order different from the order used by the sending component. The mismatch can be resolved by introducing an ordering primitive Order([a1 , . . . , an ], π, [a1 , . . . , an ]), where π is a permutation of {1, . . . , n}.The primitive accepts inputs from one component in the order a1 , . . . , an , and produces outputs for the other in the order aπ(1) , . . . , aπ(n) . 

The implementation of these concepts is slightly different. For example, the Trans class of the CABAC library implements signature mismatch primitive.This mismatch is semantically identical to message  translator pattern included in EIP. Apache Camel supports the Message Translator (http://camel.apache.org/message-translator.html) from the EIP patterns by using an arbitrary Processor in the routing logic: in our case, we simply use the DSL (transform() method)  into route definition. When you want to define a translator, you must includes the endpoints (through) and type interested in the communication. Later we see how create a simple mediator ;)

venerdì 30 marzo 2012

Welcome to my Blog


Hi all!!

My name is Giacomo and welcome to my first blog. I'm studing Computer Science at the University of L'Aquila and few days ago i received the bachelor degree ;) During my bachelor thesis i developed a simple library that tries to implements concept related to software connector. This implementation is based on existing theory called Connector Algebra [Marco Autili, Chris Chilton, Paola Inverardi, Marta Kwiatkowska and Massimo Tivoli, Towards a Connector Algebra, in: 4th International Symposium on Leveraging Applications (ISoLA 2010) of Formal Methods, Verification and Validation, pages 278-292, LNCS] provided  by my supervisors, Doct. Marco Autili and Doct. Massimo Tivoli and other collegues: this theory attempts to structure the concept of software connector, treating it like a mediator, by defining a set of rules that are formalised through an algebra. 

Suppose that we have two or more application that wish to exchange information. These applications most often not talk in the same way. For example the sender application sends a single big message, while the receivers expects a set of related submessage. If we don't have the intention to change these applications, we can use a mediator that sit between these application. For example in our case we need a simple splitter that manage the incoming messages and relying on a splitting logic splits the message and sends these messages to receivers.
This algebra contains a set of base item, such as a splitter, called primitives: these primitives are related to mediator pattern introduce the first time in Design Patterns: Elements of Reusable Object-Oriented Software, Addison Wesley, 1995ISBN 0-201-63361-2

During this work we noticed that the connector Algebra is strongly related  to the Enterprise Integration Pattern [http://www.eaipatterns.com/]: this algebra defines terms already introduced in this book. For example, the split term of the Connector Algebra theory has the same meaning of the Splitter introduced in EIP.

As the Eip are directly implemented in the Apache Camel project [http://camel.apache.org/], we builded a library based on this framework: the main goal is express the existing concepts present in Camel and re-expose under the structure of the algebra. The library is called CABAC (Connector Algebra Based on Apache Camel), and you can find it on googlecode: http://code.google.com/p/otf-connector/.

The main goal of this blog is show how to work with this library, and model (i hope together) some real scenario. Let me say if you're interested on this project and.. stay tuned :)