Archive for the ‘bibliografia’ Category

JUnit : UnitTest con Java

junio 25, 2006

JUnit es el framework mas usado dentro del mundo de Java para el desarrollo de test de unidad.

JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. JUnit is Open Source Software, released under the Common Public License Version 1.0.


Los test de unidad nos ayudan a comprobar el correcto comportamiento de nuestro código asi como a detectar fallos tanto de comportamiento como de concepto.


It provides a very simple way to express the way you intend your code to work. By expressing your intentions in code, you can use the JUnit test runners to verify that your code behaves according to your intentions.

JUnit : A starter guide

La estructura de un test es básicamente :

  1. Create some objects.
  2. Send those objects some messages.
  3. Verify some assertions.

Aunque su cilco de vida es ligeramente diferente
Recetas :

  1. Básico
    1. Como testear un constructor?
    2. como testear un metodo que no devuelver parametros (void return methods)?
    3. como testear un metodo getter ?
    4. como testear un metodo setter ?
    5. como testear un metodo JavaBean
    6. como testear una metodo interface ?
    7. como testear una metodo exception ?
  2. Mannaging test
    1. Donde colocar todos estos test
    2. Acerca de un "base test case" ?
  3. Automation Test
    1. Porque automatizar nuestros test?
    2. Automatizar los test con Ant ?
    3. Automatizar los test con Cruise Control?
  4. Testing XML
    1. Comparar documentos XML con XMLUnit ?
    2. Como testear una página web estática con XMLUnit ?
    3. Como validar un documento XML durante el testeo ?
  5. Testing web components
    1. Como testear un HTTP Session data ?
    2. Como testear páginas dinámicas y estáticas ?
    3. Como testear un servlet ?
    4. Como testear un JSP ?
  6. Test Design patterns
    1. Como testear un Singleton ?
    2. Como testear un template method ?
    3. Como testear un Factory method ?
  7. Repporting test
    1. Base Test Suite + Log4j ?
  8. Other
    1. Como testear un entorno de instalacion (instalation enviroment) ?

Recursos :

  1. JUnit : the framework
  2. EasyMock : EasyMock provides Mock Objects for interfaces in JUnit tests by generating them on the fly using Java's proxy mechanism.
  3. JMock : Mock is a library for testing Java code using mock objects.
  4. XMLUnit : For those of you who've got into it you'll know that test driven development is great. It gives you the confidence to change code safe in the knowledge that if something breaks you'll know about it. Except for those bits you don't know how to test. Until now XML has been one of them
  5. DBUnit : DbUnit is a JUnit extension (also usable with Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs
  6. HTMLUnit : HtmlUnit is a java unit testing framework for testing web based applications. It is similar in concept to httpunit but is very different in implementation. Which one is better for you depends on how you like to write your tests. HttpUnit models the http protocol so you deal with request and response objects. HtmlUnit on the other hand, models the returned document so that you deal with pages and forms and table.
  7. HTTPunit : Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission

Referencias :

  1. JUnit : A starter guide : Este es quizas el tutorial mas visitado en internet acerca de JUnit, un buen lugar para comenzar. [1]
  2. Pragmatic Unit Testing : in Java with JUnit : De la famosa serie Pragmatic programmer, starter kit en su segundo volumen nos llega este libro de buenas practicas para el desarrollo de test de unidad en nuestras aplicaciones.
  3. JUnit Recipes : practical methods for programmer testing : Este libro organizado como recetario, trata de enseñarnos como testear los diferentes comportamientos ante los que nos podemos encontrar. Desde como testear un metodo que no devuelve valor, hasta como testear EJB. A si mismo nos enseña diferentes modulos como XMLunit, ServletUnit, EasyMock.
  4. MockObjects wiki : Mock Objects is a test-first development process for building object-oriented software and a generic unit testing framework that supports that process. Mock objects give you: [2]

Citando a la wikipedia

mayo 17, 2006

Supongo que como todo el mundo antes o despues hemos ido a parar a la wikipedia. Sin duda uno de los grandes desafios de la inteligencia/creación colectiva, de los movimientos por una cultura libre y del moviento copyleft.

Pues llegado a este punto a uno le surge la duda como debe citarse una página en la wikipedia, pues segun ellos mismos uno debe (o puede) seguir unas ciertas pautas. Para los amantes de BibTeX (como yo) proponen una plantilla como la que sigue.

@misc{ wiki:###,
author = "Wikipedia",
title = "Plagiarism — {W}ikipedia{,} The Free Encyclopedia",
year = "2004",
url = "……=5139350",
note = "[Online; accessed 22-July-2004]"

When using the LaTeX package url (\usepackage{url} somewhere in the preamble) which tends to give much more nicely formatted web addresses, the following may be preferred:

@misc{ wiki:###,
author = "Wikipedia",
title = "Plagiarism — {W}ikipedia{,} The Free Encyclopedia",
year = "2004",
url = "url{…….=5139350}",
note = "[Online; accessed 22-July-2004]"

Pero Jimmy Wales opina algo sorprendete

"Do you think students and researchers should cite Wikipedia?"

"No, I don't think people should cite it, and I don't think people should cite Britannica, either — the error rate there isn't very good. People shouldn't be citing encyclopedias in the first place. Wikipedia and other encyclopedias should be solid enough to give good, solid background information to inform your studies for a deeper level. And really, it's more reliable to read Wikipedia for background than to read random Web pages on the Internet."

Aquí queda eso, quien quiera entender que entienda.

Ref : Indexing by Latent Semantic Analysis

mayo 1, 2006

Este es trabajo pionero dentro del campo de LSA, En el se describe por primera vez enque consiste esta técnica :

A new method for automatic indexing and retrieval is described. The approach is to take advantage of implicit higher-order structure in the association of terms with documents ("semantic structure") in order to improve the detection of relevant documents on the basis of terms found in queries. The particular technique used is singular-value decomposition, in which a large term by document matrix is decomposed into a set of ca 100 orthogonal factors from which the original matrix can be approximated by linear combination. Documents are represented by ca 100 item vectors of factor weights. Queries are represented as pseudo-document vectors formed from weighted combinations of terms, and documents with supra-threshold cosine values are returned. Initial tests find this completely automatic method for retrieval to be promising.

En este paper se pone un ejemplo que se convertira en clásico y que se discutira en diferentes papers con posterioridad, previsiblemente tambien en el mio.

A concrete example may make the procedure and its putative advantages clearer. Table 2 gives a sample dataset. In this case, the document set consisted of the titles of 9 Bellcore technical memoranda. Words occurring in more than one title were selected for indexing; they are italicized. Note that there are two classes of titles: five about human-computer interaction (labeled c1-c5) and four about graph theory (labeled m1-m4). The entries in the term by document matrix are simply Deerwester – 9 – the frequencies with which each term actually occurred in each document. Such a matrix could be used directly for keyword-based retrievals or, as here, for the initial input of the SVD analysis.

Paper : Indexing by Latent Semantic Analysis (PDF)
Autores : Scott C. Deerwester, Susan T. Dumais, Thomas K. Landauer, George W. Furnas, Richard A. Harshman
Publicación : Journal of the American Society of Information Science 1990
bibtex entry :

@article{ deerwester90indexing,
author = "Scott C. Deerwester and Susan T. Dumais and Thomas K. Landauer and George W. Furnas and Richard A. Harshman",title = "Indexing by Latent Semantic Analysis",journal = "Journal of the American Society of Information Science", volume = "41", number = "6", pages = "391-407", year = "1990"}