Slide 1

Slide 1 text

the in softvare fixing The things I totally changed my mind 20 year later typos devlopment w e crafted by lemi orhan ergin co-founder of craftgate v2

Slide 2

Slide 2 text

Move Fast: How Facebook Builds Software book by Jeff Meyerson Reference: in 2009, as a 5 years old company 200M active daily users FACEBOOK ZERO TESTS

Slide 3

Slide 3 text

in 2009, as a 5 years old company 200M active daily users FACEBOOK ZERO TESTS They weren’t doing the things in my books. But they weren’t failing. I’m OK with people doing things differently than in my books; I just want them to fail. Kent Beck The author of 9 books including “Extreme Programming Explained” and “Test Driven Development by Example” joined Facebook in 2011 Move Fast: How Facebook Builds Software book by Jeff Meyerson Reference:

Slide 4

Slide 4 text

in 2020, as a 16 years old company 2.5B active daily users RELIES HEAVILY ON TDD Move Fast: How Facebook Builds Software book by Jeff Meyerson Reference: in 2009, as a 5 years old company 200M active daily users FACEBOOK ZERO TESTS

Slide 5

Slide 5 text

Works for me does not mean works for you. It depends! be aware of survival bias

Slide 6

Slide 6 text

hey! we are not google or facebook Mono-repo is totally a mess Scaling the environment, pipeline and practices is impossible for huge, multi-api, multi-team mono- repos. It adds architecture overhead and too much technical and managerial complexity. Every team has to access only their own repos

Slide 7

Slide 7 text

FIXED Mono-repo- fi rst pattern Refactoring is the most common activity you do for an immature in-progress product. So do not drown in change sets among multi repos. Start with one, split if required in the future. similar to monolith-first strategy

Slide 8

Slide 8 text

FIXED restricting repo access to a specific team is a smell most of the time fi Mono-repo boosts collaboration When teams are able to access and update repos of other teams, irrelevant dependencies disappear. Ownership spreads and collaboration increases. One mono-repo for one team (one domain) could be a start for having a cross-team mono-repo

Slide 9

Slide 9 text

Deploy to production when MVP is ready Production deployment is expensive and requires too much effort to build proper pipeline. Start with test environments and push to production whenever MVP is ready for the customers. No one loves to see half arsed product, even early adapters the deployment pipeline for development use the time of creating

Slide 10

Slide 10 text

FIXED Deploy to production early and often, even start from the fi rst days Focus on integration tasks fi rst. Build CD pipeline from the fi rst day. Early creation of deployment pipeline shortens the development and feedback cycles dramatically.

Slide 11

Slide 11 text

FIXED feature toggles generate waste, so use it carefully Deploy half features to production as hidden and disabled Being able to deploy half features immediately gives critical advantage to teams by shortening deployment and testing time, and increases customer satisfaction.

Slide 12

Slide 12 text

Microservices are for splitting the whole domain into pieces We need to decompose business domain into smaller, consistent, bounded contexts Microservices should be small enough obeying the Single Responsibility Rule.

Slide 13

Slide 13 text

FIXED Microservice is a deployment strategy Every team should own a bounded context, not a set of microservices. Microservices architecture has nothing about SRP. It improves scalability (technical & organizational) by providing a loosely-coupled system. SRP can be achieved by adding modularity to the system, not by adding new microservices to deploy.

Slide 14

Slide 14 text

Stop the pipeline below %80 code coverage Code coverage directly implies code quality. Sonar is our best friend. Every developer should write unit tests for every line. Never allow merging pull requests having coverage lower than 80%. (Sometimes adding fake/empty tests is ok)

Slide 15

Slide 15 text

FIXED Write enough number of tests till you feel comfortable to deploy to production Don’t care how much tests you wrote. Tests should be fast, tests should validate the app is working properly. If you feel comfortable enough, just move it to production. quality of tests are much important than the quantity

Slide 16

Slide 16 text

Use Pull Requests for code review Every team member checks the change-sets line by line and provide helpful comments Using pull requests guarantees that the codebase is fully reviewed, understood and approved by the team PR

Slide 17

Slide 17 text

FIXED Pull Requests are the least ef fi cient technique for reviewing change sets Pull Requests are ef fi cient if you have speci fi c owners of the codebase and need to keep the change sets in control To get real feedback, show and talk about changeset with the team or develop in pairs never trust PR reviews having more than 10 lines of code in the changeset

Slide 18

Slide 18 text

Unit tests are for testing methods, integration tests are for testing the fl ow Since unit tests fail all the time during development, it is safer to write integration tests only to validate the business fl ow Unit tests are for validating algorithms and mature logics

Slide 19

Slide 19 text

FIXED Unit tests are testing the behaviors, Integration tests are for checking integration, i.e. technology touching points Separate the code having domain logic from the code interacting with other technologies. That helps us to keep the behaviors together and prevent technology complexity leaks into domain. Then it is far easier to test behaviors with unit tests having all the components composing the behaviors. fl

Slide 20

Slide 20 text

Start designing the app from designing the database DB model is the hardest part of software to refactor. The earlier we design, the less need to refactor. Data model guides domain model, and domain model guides customer contract.

Slide 21

Slide 21 text

FIXED Start designing the app from customer perspective, database design is the last step of all Start from where you can afford deletion and total rewrites, db is not the best place for it Separate data model should be derived from the domain model

Slide 22

Slide 22 text

I am a programmer, not a payment specialist Domains can easily be learned and adapted. Focus on technologies, tools and languages and that leads to a better developer. No one asks me how 3DS payment happens, they ask me how Spring executes transactions Being a full-stack developer is my goal learn little little in the middle

Slide 23

Slide 23 text

FIXED Know your domain well We need more domain experts than technology experts in sector. Only the ones who knows the domain well can create proper solutions that really solve a problem. Else you do only the fi rst solution comes to your mind. every domain has its own challenges like, scalability, performance, infra, bounded contexts, complex business flows

Slide 24

Slide 24 text

GitFlow is great for managing the features, hot fi xes and releases Merge feature branches to develop branch to let it be tested, and deployed to environments Slow down the merge pipeline to have more controlled fl ow of development.

Slide 25

Slide 25 text

FIXED GitFlow is for teams having long release cycles Trunk based development is for the others The teams doing frequent releases need no branching model. Main branch is enough to keep the veri fi ed changeset of the next release and tags are right there to mark the deployed commits to environments. trust your team, guarantee quality by pairing, having test suite, etc.

Slide 26

Slide 26 text

SOLID principles are about writing clean code using OOP These are the principles that we should follow during development even though I only know the full name of SRP and OCP.

Slide 27

Slide 27 text

FIXED SOLID is a guideline, usually have real value while reviewing the written code SOLID Principles are about managing dependencies and can be applied in any paradigm Solid is about preventing software from being rot from uncontrolled dependencies by separating concerns. Solid is about limiting the impact of change by making the code easy to change and keeping it backward compatible. Reference: https://speakerdeck.com/lemiorhan/it-is-not-solid-anymore https://speakerdeck.com/lemiorhan/solid-is-dead-long-live-solid

Slide 28

Slide 28 text

DDD is an overkill at the beginning and too much effort after the start DDD can be done by experienced developers knowing the domain well in no-deadline conditions. DDD is like doing big up-front analysis by doing many meetings

Slide 29

Slide 29 text

FIXED DDD is about thinking on the problem before jumping into (premature) solution DDD lets you understand the business problem and propose solution with all parties involved. That leads to the correct solution. It does not guarantee the solution is coded well. imposes domain level thinking and eliminates object myopic

Slide 30

Slide 30 text

FIXED DDD is about sustainable growth of building software regardless of its size It is an holistic approach for understanding, designing and building software applications. It does not dictate an architecture style and the layered approach. DDD can be used along with any other software architecture.

Slide 31

Slide 31 text

Doing Scrum by the book is crucial for happy customers, good product and high-performance team If your organization structure, communication style, team formation or rituals do not fi t Scrum, change them.

Slide 32

Slide 32 text

FIXED Customers do not care what you do. There is no formula for success. Find your own model. Customers don’t care whether you do Scrum or Kanban, whether you run sprints or estimating story points. Customers care about the product or solution you deliver. Reference: https://speakerdeck.com/lemiorhan/pure-agile-building-a-culture-without-scrum-kanban-and-xp

Slide 33

Slide 33 text

We cannot adapt engineering practices in the team if the team is not capable of It’s about people and their motivation to change the way they work. No matter how you are eager to write tests, if the others do not like or capable of it, tests won’t be written. like code review, pair programming, automated testing

Slide 34

Slide 34 text

FIXED When what you are doing is a project, main goal is catching deadlines. Building a product change the rules. Building a product requires to achieve sustainable growth and continuous customer satisfaction. Therefore quality has always been the main goal.

Slide 35

Slide 35 text

Mono-repo- fi rst strategy Deploy to production early and often, even start from the fi rst days Microservice is a deployment strategy, modularity is for sustainable growth Write enough number of tests till you feel comfortable to deploy to production Pull Requests are the least ef fi cient technique for reviewing change sets Unit tests are testing the behaviors, integration tests are for checking integration Start designing the app from customer perspective, database design is the last step of all Know your domain well GitFlow is for teams having long release cycles, trunk based development is for the others SOLID Principles are about managing dependencies and can be applied in any paradigm DDD is about sustainable growth of building software regardless of its size Customers do not care what you do. There is no formula for success. Find your own model. 1 2 3 4 5 6 7 8 9 10 11 12 K EY TA K EA W AYS

Slide 36

Slide 36 text

THANK YOU FOR SHARING YOUR TIME WITH ME speakerdeck.com/lemiorhan twitter.com/lemiorhan lemi orhan ergin co-founder, craftgate mail: [email protected]

Slide 37

Slide 37 text

THANK YOU FOR SHARING YOUR TIME WITH ME speakerdeck.com/lemiorhan twitter.com/lemiorhan lemi orhan ergin co-founder, craftgate mail: [email protected]