lundi 25 juillet 2016

how do people struggling with TDD feel about leaving out the asserts?

I've had a love/hate relationship with testing/tdd my whole career. Recenty I've started to enjoy writing tests by leaving off the assert statements. It's made all the difference in the world for me. Here's why:

  • speed close to where it was when I was not writing any tests.

  • i don't waste time trying to make assert(foo, 2) or !assert(foo, nil) logic at the end of each test

  • I just puts foo.inspect at the end of the test, run it, and move on when it's working

  • the next programmer still has a wonderful little test that shows my intent and knows this code was at one point working or it wouldn't exist.

  • there's no breaking the build when tests fails because without asserts tests never fail.

  • tests are not run 24/7 over and over to catch something. They are there when you want to debug some code and leave very nice notes to the next programmer (maybe you)

  • there's no technical debt to pay down as years go by and tests break. The tests are always just there as archaeological relics of code that puts some useful information to the console at some point in time.

My question is, is this like a known style of testing? Because I just found it out of necessity. But are TDD people using this sytem?

Aucun commentaire:

Enregistrer un commentaire