escribiendo pruebas junit para mis clases [cerrado]

I would like to write junit tests for my java classes

The objective is to read contents from a text file and doing some basic operations and calculations.

preguntado el 01 de febrero de 12 a las 22:02

What do you know about unit tests? -

I am newbie for writing unit tests in junit, above code is for my two classes and I would like to know how to start implementing/writing the unit tests for them... -

1 Respuestas

Read the documentation on JUnit - Brian Roach has given you a link in the comments.

Decide what your classes are supposed to do. Think about how they could go wrong, and how they should deal with bad input.

For each thing that they should do, and each thing they should not do, write a test method that proves that they behave correctly.

If your test becomes long and complicated, that is often a sign that your original code is not structured well enough. Fix it.


Respondido 02 Feb 12, 02:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.