little test at at time 2. Make it pass ⬅ stupid hacky solution 3. Make it good ⬅ well designed solution Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
of my galoshes and in to my tennis shoes, I'm preparing to move faster. Sure, I could run the race in my galoshes. Sure, it will take me a few seconds to take them off. But I'm betting that the cost of changing the shoes will be more than made up during the race. 9 13:32 - 18. Jan. 2019 Weitere T weets von GeePaw Hill ansehen GeePaw Hill @GeePawHill · 18. Jan. 2019 Antwort an @GeePawHill It really is just that simple, not rocket science but basic efficiency: people make this kind of decision every day, where they enhance their performance by doing things that are not themselves performing. Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
Mock/stub service contracts (API interfaces), not concrete classes Write adapters for complex or insu cient API Mock or fake those Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
Facade, and its return types No unit tests for framework integration layer: Controllers Plugins Observers Blocks Resource Models, Repositories Those remain dumb and use our components. Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
orders are placed automatically Behavior to test A subscription is created if an order has been marked as subscription during checkout Orders are created for active subscriptions with due date Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
refactoring. BUT those tests can be thrown away when their job is done! Otherwise they stay only as maintenance burden. Let them go! Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler
Given that a customer previously bought a black sweater from me And I have three black sweaters in stock. When they return the black sweater for a refund Then I should have four black sweaters in stock. PHPUnit public function test_refunded_items_should_be_returned_to_stock() { $this->given_that_a_customer_previously_bought_a_black_sweater_from_me(); $this->and_I_have_three_black_sweaters_in_stock(); $this->when_they_return_the_black_sweater_for_a_refund(); $this->then_I_should_have_four_black_sweaters_in_stock(); } Fabian Schmengler /> 9 Common misconceptions about TDD @fschmengler