Skip to content

Instantly share code, notes, and snippets.

View xpepper's full-sized avatar
💭
😏

Pietro Di Bello xpepper

💭
😏
View GitHub Profile
tags
testing

What NOT to test?

Kent Beck, "XP Explained":

It is impossible to test absolutely everything, without the tests being as complicated and error-prone as the code. It is suicide to test nothing (in this sense of isolated, automatic tests). So, of all the things you can imagine testing, what should you test?

>You should test things that might break. If code is so simple that it can't possibly break, and you measure that the code in question doesn't actually break in practice, then you shouldn't write a test for it...

title tags disqus
Trade-offs to consider when choosing to use Mocks vs Fakes
testing
pierodibello

Hi there! Today we had a nice conversation in my team around the use of mocks vs fakes in doing TDD (I'm referring to mocks and fakes as defined by Fowler and Meszaros in TestDouble).

The topic was: when should I use a mock instead of a fake, and why? What are the main trade-offs to consider when doing this kind of choice?

@xpepper
xpepper / layers_and_boundaries.rb
Last active September 17, 2021 06:34 — forked from joebew42/layers_and_boundaries.rb
A code-ish description of the example depicted in the chapter 25 ("Layers and Boundaries") of "Clean Architecture" book by Bob Martin
interface GameRulesInputBoundary
void moveSouth()
end
interface GameRulesOutputBoundary
void moveSouthSucceed()
end
class GameRules implements GameRulesInputBoundary
def init(GameRulesOutputBoundary outputBoundary)