Patterns for Saner Mocking

It is common to see mocks being setup this way in unit tests. scenario("Test Case 1") { ... when(addressResolutionService.resolve(...)).thenReturn(...) when(vendorInventoryService.checkInventory(...)).thenReturn(...) ... .... another bunch of when and then returns when(shipmentService.schedule(...)).thenReturn(...) ...thisIsTheActualCalltoTest(...) verify(vendorInventoryService, 1).checkInventory(...) ... other such verifications } scenario("Test Case…

Importance of Semantics

semantics1 | /sɪˈmæntɪks/ | noun (functioning as sing) the branch of linguistics that deals with the study of meaning, changes in meaning, and the principles that govern the relationship between sentences or words and their meanings the study of the relationships between signs and symbols and what they represent (logic) the study…

Clean Code

I received quite a lot of criticism for Dealing with Bad Code. The criticism was mostly along these lines – There is no good or bad programmer. The good programmer thing is more of an illusion. When you place a programmer in a domain in which he has little or no…