tdd-based workflow: optimizing development process
TRANSCRIPT
![Page 1: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/1.jpg)
TDD-based Workflow
Optimizing Development Process
Akbar Hidayat
![Page 2: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/2.jpg)
Test Driven Development
1. Define Expected Behaviours2. Code them
![Page 3: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/3.jpg)
assertEquals(10,add(4, 6)
);
![Page 4: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/4.jpg)
function add(left, right)return left + right;
);
![Page 5: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/5.jpg)
BUG DESTROYER?
BUG DESTROYER?
![Page 6: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/6.jpg)
TEST NEEDS DESIGN
![Page 7: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/7.jpg)
Feedback
![Page 8: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/8.jpg)
BUSINESS IMPACTS
![Page 9: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/9.jpg)
CORRECT IMPLEMENTATION
![Page 10: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/10.jpg)
MAINTAINABLE CODE
![Page 11: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/11.jpg)
Tests provide feedback for the quality of the
design
![Page 12: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/12.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/13.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/14.jpg)
Clean Architecture
&
DDD
![Page 15: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/15.jpg)
Breaking it down
1. User Stories2. Scenario Explorations3. Architecture Decisions4. Writing down the test
![Page 16: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/16.jpg)
User Story
As a [role] I want to [user need] so that [change]
![Page 17: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/17.jpg)
User Story
1. Who2. Behavioral Change3. Business Value4. Ubiquitous Language
![Page 18: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/18.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/19.jpg)
leanpub.com/50quickideas
![Page 20: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/20.jpg)
![Page 21: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/21.jpg)
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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/22.jpg)
![Page 23: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/23.jpg)
Think how the code flow
![Page 24: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/24.jpg)
![Page 25: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/25.jpg)
/** * @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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/26.jpg)
/** * @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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/27.jpg)
/** * @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](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/28.jpg)
Documentation of what the SUT does
![Page 29: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/29.jpg)
Documentation of how it does it
![Page 30: TDD-based workflow: Optimizing Development Process](https://reader031.vdocuments.net/reader031/viewer/2022030316/587430f21a28ab72188b78c7/html5/thumbnails/30.jpg)
DECODEIDEASDISCOVER POTENTIAL