Páginas

Mostrando entradas con la etiqueta mocking. Mostrar todas las entradas
Mostrando entradas con la etiqueta mocking. Mostrar todas las entradas

viernes, 30 de mayo de 2014

Resumen "Mocks will be assimilated"

Hola juggers !!!

El pasado 25 de Abril tuvimos el placer de escuchar a Alex Soto hablar sobre el uso de Mocks y de otras alternativas útiles para el testing así como stubs y fakes.

Inicialmente nos introdujo una muestra de las opciones disponibles sobre mocking : mockito, jmock, easymock... para romper el hielo.

Uno de los aspectos del uso de mocking es que facilita mucho los tests pero hace que el código desarrollado para mockear los diversos elementos no sea reutilizable en el entorno de producción y además implica que habrá que destinar un tiempo ( grande en algunas ocasiones ) al desarrollo de los mocks.

Otra opción sería usar plataformas como Arquillian, que nos facilitan la encapsulación del entorno de test y que nos permitirá probar nuestros elementos sin tener que crear mocks o fakes de ellos.

Arquillian es una plataforma de testing en la que podemos crear tests fácilmente y sin la necesidad de mockear aspectos de la aplicación .



  • Real tests increase certainty
  • Real tests build confidence
  • Real tests increase robustness
  • Mock is an option, not a rule
  • Don’t let mocks ruin yourquality
  • Long Live and Prosper to tests
Con Arquillian creamos nuestros entornos de test con nuestros elementos reales, sin mockear y inicializamos los diferentes elementos ( persistencia, CDI, etc ) y probamos con la seguridad que nuestro código probado irá directamente a producción puesto que no habremos invertido tiempo mockeando los elementos.

Manage Lifecycle of Container
Create/Deploy MicroDeployments
Enriching Test Classes
Run Tests inside/against Container
IDE Friendly



Slides de la presentación : http://lordofthejars.github.io/bjugbank-decks/slides.html

Video



martes, 22 de abril de 2014

Resistance is Futile, Mocks Will Be Assimilated [Workshop] (25/04)

Hi community!

How were the holidays? We hope you have a nice time and enjoy it.

So, here we are, ready for our next event, this friday 25th and this time we will be focused in testing and mock objects and playing with some great tools about these topics driven by Alex Soto.

Let's think a little about testing. Everybody is mocking in unit test. To test what? Your code will be run within a Java EE container. Let's start writing fast real tests.


Are you confident enough to push your application to production without fear? Will it run correctly with all components? Keep the fail whale at bay? Confidence comes from writing real tests.
In this workshop we are going to see how some tools like Arquillian, Byteman, NoSQLUnit or Moco and other programs, may help us writing real tests in situations where you typically would use mocks.










Come to this workshop and learn how to write faster and more effectively tests!

Here is the script of the event:

- Some Theory
  • What are and what happens with mocks?
  • Are there alternatives?
  • Mocks, stubs and fakes
  • Explanation of typical scenarios where mocks are used: Business Layer, Data Layer, External Services Layer, UI Layer
- Engage!!!
  • Writing real tests in Business Layer with Arquillian
  • Writing real tests for External Services Layer.
  • Writing real tests for Ajax-Enabled UI applications under different browsers (including Mobile ones)
  • The Cloud
- Conclusions

These are the requirements for this workshop:
As we have mentioned, this workshop will be driven by Alex Soto. Alex is a software engineer specialized in enterprise technologies, test automation and continuous delivery based on the Java platform. He has over a decade of experience in the Java world, yet continually renews his skill set by learning new aptitudes and technologies every day. Moreover he is involved in the open source world in projects like NoSQLUnit, Asciidoctor or Arquillian. He is an international speaker, presenting his talks at software conferences like Devoxx, LinuxTag, Codemotion, Guatemala JavaDays, JavaLand or GeeCon.

That's all guys, just remember to reserve your seat at MeetUp and come this friday 25th at 7pm at our usual place, La Fontana. Ah! Do not worry about the language, this workshop won't be in english ;-)

See you this friday!