Go advanced testing tricks and tips

Povilas Versockas has written this summary of some useful tips for writing testing in Go. I'm always looking for smart way to confirm I have written code that behaves as I expected. Some the tips here seemed to be counter to advice I have seen in a lot of places so here are a few that stood out to me.

Don't use Framework

I have moved between a few languages so this first tip struck me as a bit odd. Having a consistent and established way to structure testing is helpful when learning a new language. It gives you a familiar arena to try things out and get to grips with writing in the new language.

If we shouldn't be using frameworks then why do xUnit like frameworks appear in almost every language and get used? I'd hazard because they are useful, I don't have to copy and paste different assert helper functions into each new package I write. KISS principle is at a lost in this advice.

Subprocessing: Real

Having any test requiring an external tool feels like an area that requires mocking or stubs to mimic the functionality you are testing. Suggesting that you skip testing because dependencies of your code are missing is missing the point of testing. If you shouldn't be skipping failing code.

If your using git, there is libgit2, which will allow you to programmatically perform git operations. You should integrate with that library and continue with normal testing instead of calling subprocesses.

Take Care of Slow Running Tests

I disagree with this tip. Make slow tests integration tests... What? If your test is slow and it is a unit test then it is either testing too much or the underlying code need addressing because it is slow. Speed has nothing to do with the type of testing. Integration testing doesn't mean slow testing, all testing should aim to be as fast as possible.