For a class, try having a corresponding set of test methods, where each one describes a responsibility of the object, with the first word implicitly the name of the class under test. For example, in Java: class HtmlLinkRewriterTest … { void testA…
So you’ve learned all about method stubs, mock objects, and fakes. You might be tempted to stub out slow or I/O-dependent built-ins. For example: def Foo(path): if os.path.exists(path): return DoSomething() else: return DoSomethingElse() d…
We want you to write more tests. Yes, you. You’ve already been told that tests are the safety net that protects you when you need to refactor your code, or when another developer adds features. You even know that tests can help with the design of your …