{"id":27,"date":"2015-02-04T15:50:33","date_gmt":"2015-02-04T14:50:33","guid":{"rendered":"http:\/\/67bricks.com\/blog\/2015\/02\/04\/power-cuts-and-test-driven-development\/"},"modified":"2021-12-16T10:56:34","modified_gmt":"2021-12-16T10:56:34","slug":"power-cuts-and-test-driven-development","status":"publish","type":"post","link":"https:\/\/blog.67bricks.com\/?p=27","title":{"rendered":"Power cuts and test driven development"},"content":{"rendered":"<p>We&#8217;ve just had an impromptu developer meeting because a power cut disabled all of our computers.<\/p>\n<p>We discussed Test-Driven Development (TDD). Rhys talked about how mocking with a framework like <a href=\"http:\/\/mockito.org\/\">Mockito<\/a> makes test driven development easier to achieve, because you can use the mocks to check the side-effects of your code. Inigo felt that needing to use mocks was often a sign that your code had overly complex dependencies, and that it was sometimes better to instead make methods and components &#8220;pure&#8221; &#8211; so they didn&#8217;t have side-effects. Nikolay mentioned having used a .NET mocking framework, that might have been <a href=\"https:\/\/github.com\/Moq\/moq4\">Moq<\/a>, for testing some C# code that had a dependency on the database. Charlie discussed the problems of using an in-memory database that had slightly different behaviour from your actual database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve just had an impromptu developer meeting because a power cut disabled all of our computers. We discussed Test-Driven Development (TDD). Rhys talked about how mocking with a framework like Mockito makes test driven development easier to achieve, because you can use the mocks to check the side-effects of your code. Inigo felt that needing &hellip; <a href=\"https:\/\/blog.67bricks.com\/?p=27\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Power cuts and test driven development&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27"}],"version-history":[{"count":1,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions\/302"}],"wp:attachment":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}