In this talk, Jan will present a new and innovative approach to evolving a full stack software architecture of JavaScript and TypeScript projects, that he has been using to drive the development of a financial system.
Behaviour-Driven Architecture builds on ideas from BDD, UCD and DDD and works particularly well in complex domains as it encourages strong domain modelling, clean code, clean architecture and drastically speeds up automated acceptance testing.
26. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- How do you build a shared understanding?
- We agree on how to Build it Right:āØ
coding standards,āØ
design patterns,āØ
architectural patterns,āØ
test coverageā¦
27. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- How do you build a shared understanding?
- We agree on how to Build it Right:āØ
coding standards,āØ
design patterns,āØ
architectural patterns,āØ
test coverageā¦
- ok, but how do you know youāre buildingāØ
The Right Thing?
37. serenity-js.org#SerenityJS #FullStackCon @JanMolak
ā āBehaviour-Driven DevelopmentāØ
BDD is a practice of using Cucumber to writeāØ
slow and ļ¬aky automated tests, āØ
driving the fully-assembled system through its UI.
41. serenity-js.org#SerenityJS #FullStackCon @JanMolak
ā āImpact Mapping is a collaborative way to help us
understand the bigger picture, describe roadmaps
and ļ¬gure out how weāre going to haveāØ
a huge impact with our software and achieve
something great instead of just shipping features.āØ
- Gojko Adzic
46. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
Measurable, clear goal
with a speciļ¬c time scale
People who can help usāØ
achieve the goal
Personas Market segments
How should peopleās
behaviour change?
47. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
Measurable, clear goal
with a speciļ¬c time scale
People who can help usāØ
achieve the goal
Personas Market segments
How should peopleās
behaviour change?
What can we do?
53. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
Automate documentāØ
delivery
54. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
DocumentāØ
Library
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
Automate documentāØ
delivery
55. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
DocumentāØ
Library
Notifications
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
Automate documentāØ
delivery
56. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
DocumentāØ
Library
Notifications
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
DocumentāØ
GeneratorAutomate documentāØ
delivery
57. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
DocumentāØ
Library
Notifications
Enterprise CMS
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
DocumentāØ
GeneratorAutomate documentāØ
delivery
59. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Goal Actor Impact Deliverable
DigitalāØ
documentsāØ
only
ContentāØ
Editors
Customers
DocumentāØ
Library
Notifications
Enterprise CMS
Come back more frequently
Donāt lose their documents
Manage all templatesāØ
in one place
Read their documents
DocumentāØ
GeneratorAutomate documentāØ
generation
62. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Automated Document Delivery
In order to reduce cost and environmental impact
As a responsible financial company
Weād like the customer documents
to be generated automatically
And delivered in a digital format
When specified business events occur
65. serenity-js.org#SerenityJS #FullStackCon @JanMolak
ā ā
Feature Mapping is a light-weight, outcome-focused,
highly collaborative requirements discovery practice
that helps build a deep collective understanding of
customer needs, and that provides a smooth path to
high quality executable speciļ¬cations.
- John Ferguson Smart
66. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Automated Document Delivery
In order to reduce cost and environmental impact
As a responsible financial company
Weād like the customer documents
to be generated automatically
And delivered in a digital format
When specified business events occur
68. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Actors: Connie the Customer
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
69. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- Whatās the role of the Content Editor āØ
in that process then?
- Content editors prepare the templates āØ
based on which the documents should be
generated
70. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Actors: Connie the Customer, Edna the Editor
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
71. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- How is the Service Agreement connectedāØ
with the registration event?
- Edna will have to configure thisā¦ somehow.āØ
It would be nice if she could āØ
use the CMS for that.
72. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Actors: Connie the Customer, Edna the Editor
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
Edna configures
Service Agreement
to be delivered
upon customer
registration
How is she going
to do that?
73. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- We seem to be relying on that CMS quite a lot.
What if it goes down?
- We should retry the process when itās back upāØ
and notify the customer when the document is
delivered
74. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Actors: Connie the Customer, Edna the Editor
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
Edna configures
Service Agreement
to be delivered
upon customer
registration
CMS is down
Connie is notifiedāØ
when the documentāØ
is ready
- || - - || -- || -
75. serenity-js.org#SerenityJS #FullStackCon @JanMolak
- Should connie be notified when any document is
delivered, or just in this case?
- Well, some of the documents will be triggered
without her action.āØ
Thatās the case with monthly, quarterly and
annual statements.āØ
So yes, she should be notified when any
document is delivered.
76. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Actors: Connie the Customer, Edna the Editor
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
Edna configures
Service Agreement
to be delivered
upon customer
registration
Customer āØ
is notified whenāØ
the DocumentāØ
is delivered
Connie is notifiedāØ
when the documentāØ
is ready
- || - - || -- || -
78. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
Edna configures
Service Agreement
to be delivered
upon customer
registration
79. serenity-js.org#SerenityJS #FullStackCon @JanMolak
Connie RegistersāØ
with our service
Service AgreementāØ
Upon registration
Examples: Tasks: Consequences:
Connie sees the
Service Agreement
in her Library
Edna prepares the
template for the
Service Agreement
Edna configures
Service Agreement
to be delivered
upon customer
registration
Scenario: Service Agreement is delivered upon customer registration
Given Edna has prepared a template for the Service Agreement
And configured the Service Agreement to be delivered upon customer registration
When Connie registers with our service
Then she should see the Service Agreement in her Library
110. serenity-js.org#SerenityJS #FullStackCon @JanMolak
When working on a new feature ask:
- Whatās the business goal? Why is this needed?
- Whatās the context? Who are the āusersā?
- What If something doesnāt go according to plan?
- How are we going to test it? support it? āØ
measure the impact of our work?