+ All Categories
Home > Technology > TDD-based workflow: Optimizing Development Process

TDD-based workflow: Optimizing Development Process

Date post: 15-Apr-2017
Category:
Upload: akbar-hidayat
View: 455 times
Download: 4 times
Share this document with a friend
30
TDD-based Workflow Optimizing Development Process Akbar Hidayat
Transcript
Page 1: TDD-based workflow: Optimizing Development Process

TDD-based Workflow

Optimizing Development Process

Akbar Hidayat

Page 2: TDD-based workflow: Optimizing Development Process

Test Driven Development

1. Define Expected Behaviours2. Code them

Page 3: TDD-based workflow: Optimizing Development Process

assertEquals(10,add(4, 6)

);

Page 4: TDD-based workflow: Optimizing Development Process

function add(left, right)return left + right;

);

Page 5: TDD-based workflow: Optimizing Development Process

BUG DESTROYER?

BUG DESTROYER?

Page 6: TDD-based workflow: Optimizing Development Process

TEST NEEDS DESIGN

Page 7: TDD-based workflow: Optimizing Development Process

Feedback

Page 8: TDD-based workflow: Optimizing Development Process

BUSINESS IMPACTS

Page 9: TDD-based workflow: Optimizing Development Process

CORRECT IMPLEMENTATION

Page 10: TDD-based workflow: Optimizing Development Process

MAINTAINABLE CODE

Page 11: TDD-based workflow: Optimizing Development Process

Tests provide feedback for the quality of the

design

Page 12: TDD-based workflow: Optimizing Development Process

TDDTDD can't even be begun until we know the shape of the system that is to be created.

(Uncle Bob)

Page 13: TDD-based workflow: Optimizing Development Process

BDDThe point of BDD is to get people

communicating and bridge the gap between ‘technical’ and ‘business’ people

(Dan North)

Page 14: TDD-based workflow: Optimizing Development Process

Clean Architecture

&

DDD

Page 15: TDD-based workflow: Optimizing Development Process

Breaking it down

1. User Stories2. Scenario Explorations3. Architecture Decisions4. Writing down the test

Page 16: TDD-based workflow: Optimizing Development Process

User Story

As a [role] I want to [user need] so that [change]

Page 17: TDD-based workflow: Optimizing Development Process

User Story

1. Who2. Behavioral Change3. Business Value4. Ubiquitous Language

Page 18: TDD-based workflow: Optimizing Development Process

User Story

As an event owner I want to refund the remaining points from an event so that I can use the points again

Page 19: TDD-based workflow: Optimizing Development Process

leanpub.com/50quickideas

Page 20: TDD-based workflow: Optimizing Development Process
Page 21: TDD-based workflow: Optimizing Development Process

Architectural Decisions

TDD can't even be begun until we know the shape of the

system that is to be created.

(Uncle Bob)

Page 22: TDD-based workflow: Optimizing Development Process
Page 23: TDD-based workflow: Optimizing Development Process

Think how the code flow

Page 24: TDD-based workflow: Optimizing Development Process
Page 25: TDD-based workflow: Optimizing Development Process

/** * @expectedException InvariantException * @expectedExceptionMessage EVENT.REFUND.STILL_ACTIVE */function given_that_an_event_has_not_finished_and_when_the_event_is_being_refunded_then_it_should_fail(){

$eventRefund->refund($event, $requester);}

Page 26: TDD-based workflow: Optimizing Development Process

/** * @test */function given_that_the_event_is_sponsored_and_when_it_has_been_refunded_then_the_remaining_point_should_be_returned_to_the_admin(){

...}

Page 27: TDD-based workflow: Optimizing Development Process

/** * @test */function refunding_a_sponsored_event_should_increase_admin_point(){

// Simulating HTTP POST to a certain route$this->post(‘/refundedevents’, [

‘id’ => 212 ]);

// Check in Database that the admin point has increased...

}

Page 28: TDD-based workflow: Optimizing Development Process

Documentation of what the SUT does

Page 29: TDD-based workflow: Optimizing Development Process

Documentation of how it does it

Page 30: TDD-based workflow: Optimizing Development Process

DECODEIDEASDISCOVER POTENTIAL


Recommended