As a model of XP development (done at a few thousand feet above ground) I was expecting a solid bug free transperant code for JUnit. Como un modelo de desarrollo XP (hecho en unos mil pies sobre el suelo) yo estaba esperando una sólida libre de bugs transperant código para JUnit.

I noticed few interesting bugs & surprising features in the code. He observado algunos bugs interesantes y sorprendentes características en el código.

If you want to increase your test count (possibly for your manager who checks the tests written or for your customer) by a factor x (without actually performing the tests) then just override the default implementation of countTestCases() to return x. Si desea aumentar su prueba count (posiblemente por su gerente controles que las pruebas escritas o de su cliente) por un factor x (sin llegar a efectuar las pruebas), sólo por defecto anular la aplicación de countTestCases () para volver x. The documentation says “Counts the number of test cases executed by run(TestResult result)”. La documentación dice "Cuenta el número de casos de prueba ejecutados por ejecutar (TestResult resultado)". However in reality it always returns 1. Sin embargo, en realidad, que siempre devuelve 1.
If you have 10 test cases in your Test class and if you return 20 in your impl. Si hay 10 casos de prueba en los ensayos de su clase y si devuelve 20 en su Ejec. of countTestCases() then the total test count is shown as 200. de countTestCases () entonces el total de pruebas contar se muestra como 200. However in reality only 10 tests are run. Sin embargo, en realidad, sólo el 10 pruebas se ejecutan.

The code has interesting tests performed on a TestCase subclass like it checks that there is at least one method with name starting with test (could be just test() ). El código tiene interesantes pruebas realizadas en una subclase de TestCase como los controles que hay al menos un método con el nombre empezando con la prueba (puede ser de prueba ()). It checks that there is a public constructor which accepts a string as parameter. Se comprueba que existe un constructor público que acepta una cadena como parámetro. It could still do nothing. Podría todavía no hacen nada.

These are interesting ideas half-baked which feels forced on the user, specially when you decide to override the default implementation to hook it to your test generator. Estas son ideas interesantes de medio horno que se siente obligado por el usuario, especialmente cuando usted decide anular la aplicación por defecto para engancharlo a su generador de prueba. Also you might have noticed that the error messages are often not very illuminating when the cons is missing. También usted habrá notado que los mensajes de error que a menudo no son muy esclarecedoras las desventajas cuando se pierde.

The code does this funny passing back and forth with run variants between TestCase & TestResults for no apparent reason before finally calling testBare. El código lo hace divertido de pasar hacia adelante y hacia atrás con ejecutar variantes entre TestCase y TestResults sin motivo aparente hasta que finalmente se pide testBare. Methods like runProtected or run variants belong to TestCase. Métodos como runProtected o ejecutar variantes pertenecen a TestCase. At the least lets keep the run methods in one class instead of calling each other back and forth. Al menos permite mantener la carrera en los métodos de una clase en lugar de llamar a cada uno hacia adelante y hacia atrás.

Pages: 1 Páginas: 1 2 3