How do I find what tests use this method?

As I said earlier, I’ve been reading Michael Feathers _Working Effectively With Legacy Code_ recently (I’m taking my time with it; it’s a good book). He spends a lot of time talking about techniques to get code under test. However, he spends very little talking about finding out if (and to what extent) a method is under test in the first place. So here’s how I do it:

Continue reading “How do I find what tests use this method?”

Don’t propagate exceptions in test fixtures

Been seeing this pattern a lot today. I’m working with integration tests, which have a lot of test fixtures around to do common tasks (such as inserting data into the database). These test fixtures propagate exceptions. In many cases, they simply declare that they throw java.lang.Exception. Ouch.

Continue reading “Don’t propagate exceptions in test fixtures”