# Welcome!

> Software engineering is not computer science,\
> And computer science is not coding;
>
> Better engineering practices improve predictability of costs and schedules,\
> provide early warning of problems,\
> support better management,\
> and reduce risk of overruns.

## We are Product Engineers

We do more than just write code, we’re more than just a feature factory.

We are co-owners of the product experience. We look at the full picture to understand the value and impact of what we’re building.

We contribute to the full spectrum of a product’s development; from PRD [(Product Requirements Document)](https://en.wikipedia.org/wiki/Product_requirements_document) to code to tests.

We regularly talk to customers and end users; we rigorously analyse and measure the performance of features, and unearth opportunities to improve.

## High alignment, High autonomy

Alignment and autonomy are two important axes which can be used to classify teams:

1. *Low alignment, low autonomy:* micromanagement culture, shut up and follow orders, teams have little understanding about why they’re moving in a particular direction
2. *Low alignment, high autonomy:* helpless leaders, teams do whatever they want, things go everywhere and nowhere at the same time
3. *High alignment, low autonomy:* strong leadership and organisation direction, yet leaders end up giving instructions to teams on what to do and how to do it too
4. *High alignment, high autonomy:* This is where we want to be! Leaders focus on what problems to solve; teams are strong and independent enough to figure out how to solve them!

To get this degree of alignment, our teams must adhere to a set of non-negotiable standards—**The Obvious Way**—which include:

* A common vocabulary to enable strong communication
* Code formatting and style guide
* Pull requests and reviews
* Git process and trunk-based development&#x20;
* System architecture
* Daily standups&#x20;
* Iteration planning&#x20;
* … and more!

## Structure and Process

Every time we’re trying to change people’s behaviour, we need to start them off with a lot of structure, so they don’t have to think. A lot of what we do is habit, and it’s hard to change those habits, but having very clear guardrails can help us.

{% hint style="success" %}
Trust is more important than control!
{% endhint %}

* We don’t want people in the team who we cannot trust.
* To be agile at scale, requires trust at scale.
* No politics and no bullshit, means no fear.
* Fear kills trust and innovation
  * If failure gets punished, no one will try new things
  * The organisation as a whole will suffer!&#x20;


# First Principles

Good to remember, often repeated.

{% hint style="info" %}
This text is a work-in-progress.
{% endhint %}

## We review code, before we write code

Any code that has been written and is pending review is the one closest to being able to generate value. For that piece of code, effort and time has been invested by multiple people, CI pipelines have run, builds have been generated, etc.&#x20;

So we give priority to reviewing any pending pull requests. We try to review code multiple times during the day — the effort is staggered across the members of the team. As soon as that code gets merged, the entire codebase starts to benefit from the value that it creates.&#x20;

## A culture of searching, reading and writing documentation

Documentation is very important part of software development and also something not a lot of people are habitual in writing or reading. If a product is documented properly, moving around and understanding the codebase becomes really easy.

## Failure is learning what not to do

When we try something out and it does not work as wanted doesn't mean it was a failure, it taught us what not to try the next time. What matters is that we give it the best shot we can at that particular time.

## We measure, so we can improve

We have very well defined metrics which help us quantitatively calculate everyone's progress. Details coming soon.

## Only improvements made at the constraint are of value

This principle follows the [Theory of Constraints](https://www.leanproduction.com/theory-of-constraints.html) which as quoted in the article says "The Theory of Constraints is a methodology for identifying the most important limiting factor (i.e. constraint) that stands in the way of achieving a goal and then systematically improving that constraint until it is no longer the limiting factor".

Digging deeper with an example, let's say there is vada making factory and Raj is the owner.

* There are a few processes through which the raw material has to go through to produce the final product.
* Let's say the processes are as follows:
  * A (Farmer)
  * B (Dough Preparation)
  * C (Vada Fryer)
  * D (Chutney Maker)
  * E (Final Packaging)
* Now suddenly Raj notices that final output of vadas from his factory is 10% less than his expectation. Now he needs to figure out what the problem is.
* Let's say this problem is occurring because the Chutney maker is slower than expected. But Raj or anyone in the factory is unaware about this.
* Now if Raj asks the Farmer to produce more raw products and asks everyone to be a little faster to be able to make better progress. There will still be a 10% lag in the expected result. Until he realises that the Chutney maker is what is causing the problem.
* And increasing the efficiency of any other process won't actually increase the efficiency of the entire factory. It will just start to create more lag.
* For example, the manager at C (Fryer) says that they can double their productivity and can fry twice the number of vadas. The result of this will be that there will be more vadas than there is chutney for at D (Chutney maker).
* Which is why, understanding what is it that's slowing the process is important. And working hard on that constraint is what's most important to increase efficiency.


# Communication tools

Slack and Telegram


# Acronyms

These are some of the acronyms we use at Obvious.

| Acronym |                                      Full-form                                     |
| :-----: | :--------------------------------------------------------------------------------: |
|   IPM   |         [Iteration Planning Meeting](/meetings/iteration-planning-meetings)        |
|   DSM   |              [Daily Standup Meeting](/meetings/daily-standup-meetings)             |
|   TBD   |       [Trunk-Based Development](/release-engineering/trunk-based-development)      |
|   OKR   |           [Objectives and Key Results](https://en.wikipedia.org/wiki/OKR)          |
|   PRD   | [Product Requirements Document](/project-management/product-requirements-document) |
|   ADR   |     [Architecture Decision Record](/system-design-and-architecture/how-to-adr)     |
|   DQF   |                             Delivery Quality Framework                             |


# Vital reading material

All of these books are available in our Library.

## Core

### History

1. Hackers: Heroes of the Computer Revolution -- Steven Levy&#x20;
2. The Soul of a New Machine -- Tracy Kidder&#x20;
3. Revolution OS (documentary movie) (2001)

### People, teams & projects

1. Radical Candor -- Kim Malone Scott
2. The Mythical Man Month -- Frederick Brooks
3. Peopleware: Productive Projects and Teams -- Tom DeMarco, Tim Lister
4. The Manager's Path -- Camille Fournier

### Computer science & meta

1. Conceptual Blockbusting -- James L. Adams
2. Code Complete 2 -- Steve McConnell
3. Programming Pearls -- Jon L. Bentley
4. The Practice of Programming -- Brian W. Kernighan, Rob Pike

### Software engineering&#x20;

1. Working Effectively with Legacy Code -- Michael Feathers
2. Practical Object Oriented Design Patterns: in Ruby -- Sandi Metz
3. Test Driven Development: By Example -- Kent Beck

### Agile & related processes

1. User Stories Applied: For Agile Software Development -- Mike Cohn
2. Software Estimation: Demystifying the Black Art -- Steve McConnell

### Release engineering&#x20;

1. The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win -- Gene Kim, Kevin Behr, George Spafford&#x20;
2. Accelerate: The Science of Lean Software and DevOps -- Nicole Forsgren, Jez Humble, Gene Kim
3. Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation -- Jez Humble, David Farley

## Android / Java / Kotlin specific

1. Reactive Programming with RxJava -- Tomasz Nurkiewicz, Ben Christensen&#x20;
2. Effective Java -- Joshua Bloch
3. Design Patterns: Elements of Reusable Object-Oriented Software -- Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides

## Web / JavaScript specific

1. Eloquent JavaScript -- Marijn Haverbeke&#x20;


# Onboarding Guide

## Non-Technical

### Consulting vs Contracting

* Greenfield vs Brownfield
  * Greenfield software is the software that we design and develop from scratch. Brownfield software is one where something already exists and we have to add functionality and/or features to it.
  * Obvious mostly works in greenfield software development but we occasionally work with brownfield stuff too.

### Engineering Philosophy

* [First Principles](/first-principles-of-engineering)
* Documentation practices (ADR, project documentation etc.)

## Technical

* [Trunk Based Development (TBD)](/release-engineering/trunk-based-development)
  * Use of feature flags for features that span over multiple PRs
  * Habit of raising PRs everyday
  * Prioritising review over writing new code (dropping everything to review a PR)
  * Show the Simple repo for daily branches, continuous integration and Github Actions for having checks in place
* [Code Reviews & Pull Requests](/release-engineering/code-reviews-and-pull-requests)
  * Read the [Google code review guide](https://google.github.io/eng-practices/review/reviewer/) and highlight some important practices that we follow as a team
* Estimation Practices
  * How engineers get estimations wrong?
  * Estimation based on complexity and not time
* Testing
  * [Testing pyramid](https://martinfowler.com/articles/practical-test-pyramid.html)&#x20;
    * Unit and Integration testing
    * Importance of testing
  * [Covariance and contra-variance in tests](https://www.javacodegeeks.com/2011/11/principles-for-creating-maintainable.html)
  * Testing codelabs for beginners:&#x20;
    * [Testing basics](https://codelabs.developers.google.com/codelabs/advanced-android-kotlin-training-testing-basics/index.html#0)
    * [Test doubles and dependency injection](https://codelabs.developers.google.com/codelabs/advanced-android-kotlin-training-testing-test-doubles/index.html#0)
  * [Test doubles](https://obvious.in/blog/testing-production-code/): Fakes, mocks and Stubs&#x20;

### Mobius

* Functional Core and Imperative Shell
  * [Pure functions](/onboarding/lessons/001-function-purity)
  * Imperative and functional programming basics
  * Boundaries Talk by Gary Bernhardt - [YouTube](https://www.youtube.com/watch?v=yTkzNHF6rMs) / [Original Website](https://www.destroyallsoftware.com/talks/boundaries)
    * Usage of Functional Core & Imperative Shell in above talk - [Video Link](https://www.destroyallsoftware.com/screencasts/catalog/functional-core-imperative-shell)
* Introduction to State Machines
* Introduction to [Mobius](https://github.com/spotify/mobius/wiki)
  * [Mobius onboarding](/onboarding/first-week-mobius)
    * Pairing activity using Counter example
    * Test-driven development
    * Introduce the login example
    * Pair on drawing the state diagram for login screen
    * Introduce `Effect` and `EffectHandler`
    * Introduce to Views and View Renderers
    * Introduce `Init` and wire Mobius loop
  * Individual Activity: Re-write the take-home exercise in Mobius


# Mobius onboarding Guide

## **Mobius**

Mobius is our recommended architecture for building Android applications. We also feel that it is much easier to learn Test-Driven Development by starting out to build apps using Mobius.

### Day 1: Introduction to Mobius & TDD (4:50 hours)

* Theory: Introduction to Mobius *(1 hour)*
  * Eliminating the moving parts using functional programming
  * Pure functions
  * State transition diagrams
  * `Model` & `Event`
* Pairing Activity: The counter app state transition diagram *(1 hour)*
  * The `update()` function
  * Introducing the `UpdateSpec` class
  * Test driving the counter `update()` function
  * Wiring the `update()` function to the UI
* Theory: Test-Driven Development *(30 minutes)*
  * Principles of TDD
  * [YAGNI](https://martinfowler.com/bliki/Yagni.html)&#x20;
  * The red, green, and refactor cycle
  * TDD as a design practice
* Recap *(20 minutes)*
  * Key takeaways
  * Reading materials for the next day
    * <https://github.com/spotify/mobius/wiki/Concepts>
    * <https://blog.cleancoder.com/uncle-bob/2016/03/19/GivingUpOnTDD.html>&#x20;

### Day 2: Mobius Effects & Effect Handlers (5:05 hours)

* Reflection of Day 1 and discussion around reading materials *(30 minutes)*
* Pairing Activity: Login Screen `update()` Exercise *(2 hours)*
  * Introducing effects & effect handlers
  * Login example state transition diagram
  * Test driving the login update() function
  * Identifying the primitive obsession code smell (Watch this)
  * The “What to test?” problem
  * Relationship between the number of execution paths and tests
  * Test driving the `Username` and `Password` classes
  * Modeling async state transitions
  * Completing the `update()` function
* Pairing Activity: Materializing effects using effect handlers *(1:30 hours)*
  * State verification vs. behavior verification
  * Introduction to Mockito
  * Low confidence behavior verification tests
  * Writing the first effect handler
  * Using the RxJava `SubtypeEffectHandler`
  * `Action`, `Consumer`, and `ObservableTransformer`
  * Errors of first-class citizens
  * Using `Scheduler` in tests
* Pairing Activity: Introduction to Views and View Renderers *(45 minutes)*
  * Using mockito to verify view rendering logic
* Recap *(20 minutes)*
  * Key takeaways

### Day 3: Mobius, the final bits (5:35 hours)

* Reflection of Day 2 *(30 minutes)*
* Pairing Activity: Creating the shell *(45 minutes)*
  * Wiring all the Mobius components
  * Saving and restoring model state
  * The `@Parcelize` annotation
  * Caveats of saving data using Android’s `Parcelable` interface
* Pairing Activity: Subtle bugs introduced by async operations *(45 minutes)*
  * Handling normal flow of execution using the `init()` function
  * Handling edge cases using the `init()` function
  * Using the `InitSpec` for testing normal flow and edge cases
* Recap *(20 minutes)*

### Day 4, 5, and (possibly 6): Building the NASA APOD Apps (14:50 - 22:50 hours)

* Reflection of Day 3 *(20 minutes)*
* Individual Activity: NASA APOD Application *(8 - 16 hours)*
  * Step 1: Drawing the state transition diagram
  * Step 2: Writing the `init()`the `update()` tests
  * Step 3: Writing Effect Handler tests
  * Step 4: View and View Renderer Tests
  * Step 5: Wire up the imperative shell
* Code review and addressal *(1:30 hours)*
* Recap *(1 hour)*

### Points of Confusion

* `Effect` are more closer to intention for side-effect than performing a side-effect
* Representing decision making in state diagram


# Lessons

This is a knowledge-base of articles, written and maintained by the Obvious engineering team, that attempt to explain various concepts that define our engineering culture.

Some of the articles might be deeply specific to particular tech stacks (say architecting Android or Web apps), while others might talk about general programming skills (say functional programming, or test driven development).


# 001 - Function Purity

In this lesson, we will explore the following topics:

* What is a pure function?
* Why are they important?
* Some common examples of impure functions, and how to make them pure.

The code snippets in this topic have been written for the Java Virtual Machine, using the [Kotlin](https://kotlinlang.org/) programming language. The concepts, however, apply across all programming languages and platforms in general.

## What is a pure function?

A pure function has the following characteristics:

### Pure functions are idempotent

An idempotent function is one that has the same result for the same input, no matter how many times it is called. Consider the following function:

```kotlin
fun add(a: Int, b: Int): Int {
  return a + b
}
```

Regardless of whether `add()` is invoked one time, ten times, or a million times with a given value for `a` and `b`, the result of `add()` will never change. However, consider the following function:

```kotlin
var sum = 0

fun add(b: Int): Int {
  sum = sum + b
  return sum
}
```

In this case, `add()` is no longer an idempotent function. Every time it is invoked, it changes the value of the `sum` variable and returns it. Invoking it with the same value of `b` multiple times will return a different result each time.

Another example of a function which is not idempotent is one which depends on values which can change. One example is the following:

```kotlin
fun addDaysToCurrentDate(days: Int): Date {
  val now = Date()
  now.time = now.time + days * MILLIS_IN_DAY

  return now
}
```

The `Date` constructor here implicitly uses the current system time at the millisecond precision for getting the current date. If we invoke this function multiple times with the same input value for `days`, the returned `Date` instance will still be different every millisecond.

There are certain ways a function may seem idempotent, but in reality it is not. For example, consider the following function:

```kotlin
fun addDaysToDate(date: Date, days: Int): Date {
  val now = Date(date.time + days * MILLIS_IN_DAY)

  return now
}
```

On the surface, this might seem to be an idempotent function since it does not use the system time for generating the date. However, someone who has used the `Date` class before might be aware that the actual time of the `Date` can be changed via the `setTime(Long)` method.

This makes the input that is being passed to the `addDaysToDate` function mutable. This will generally be a problem in multi-threaded environments if the `date` instance being passed to the `addDaysToDate` method is modified from another thread while the `addDaysToDate` method is executing.

This is a problem with shared mutable state in general, which we will talk about in another [lesson](/onboarding/lessons/001-function-purity).

So if we needed to make this function actually idempotent, we could do something like this:

```kotlin
fun addDaysToDate(dateMillis: Long, days: Int): Date {
  val now = Date(dateMillis + days * MILLIS_IN_DAY)

  return now
}
```

### Pure functions do not change the state of the system they are running in

Consider the following function:

```kotlin
fun addDaysToDate(dateMillis: Long, days: Int): Date {
  val now = Date(dateMillis + days * MILLIS_IN_DAY)

  Logger.getLogger("App").log(Level.INFO, "Date: $now")

  return now
}
```

It is a fairly common operation to add log statements to verify logic. However, this ends up changing the nature of the function itself. The function is now doing more than what it is supposed to; it has a "side-effect" on the external state of the system since it also emits something to the system log. Other kinds of side-effects include, but are not limited to:

* Updating the state of UI.
* Pushing events into analytics.
* Making a network call.
* Writing data to storage of some kind.

### Summary

A pure function is a function that is both:

1. Idempotent
2. Has no side effects

## Why pure functions?

There are [many](http://blog.agiledeveloper.com/2015/12/benefits-of-pure-functions.html) benefits to writing pure functions. We won't discuss them all here, but here are some of the reasons which we like:

### Easier to test

Let's revisit the function that we wrote earlier to add a given number of days to the current date (the impure version):

```kotlin
fun addDaysToCurrentDate(days: Int): Date {
  val now = Date()
  now.time = now.time + days * MILLIS_IN_DAY

  return now
}
```

What does it take to verify that this function works as expected? We need to be able to do the following things:

1. *Given* a particular date,
2. *When* adding a specific number of days to the given date,
3. *Then* the returned date should be a specific expected date.

If we look at the implementation of the `addDaysToCurrentDate` function, it gets the current date implicitly by creating a new `Date` instance which internally uses the `System.currentTimeMillis()` call to get the current timestamp.

Testing this is hard since the code implicitly calls this method. In some cases, this is unavoidable, and we will look at ways to handle this as a separate lesson on testing.

For now, let us try to test the pure function that we wrote later:

```kotlin
fun addDaysToDate(dateMillis: Long, days: Int): Date {
  val now = Date(dateMillis + days * MILLIS_IN_DAY)

  return now
}
```

What does a test for this function look like?

```kotlin
@Test
fun `test adding days to date works`() {
  // given
  // 2019-11-20T00:00:00Z
  val currentDateMillis = 1574208000000

  // when
  val afterFiveDays = addDaysToDate(currentDateMillis, 5)

  // then
  assertEquals(Date(1574640000000), afterFiveDays)
}
```

This has none of the problems that we saw in the earlier test. Reading the test explains exactly what the method does, and it does not have any unneccessary code that might require the reader to understand the method implementation. In addition, changing the implementation will not affect the test as long as the function contract remains intact.

### Easier to parallelize

Since pure functions neither affect the rest of the system nor use shared mutable state, parallelizing them is extremely easy since we can just invoke these functions on as many number of threads as the system will support. Otherwise, trying to parallelize impure functions is an exercise in frustration since we'll have to consider many things like:

* Take into account all the side effects being generated by the functions and figure out if they can affect the system adversely.
* Consider all the shared state being mutated by the functions and then work on making them work nicely when mutated by different threads, like locking or synchronization, which has performance hits and make the code harder to read and maintain.

## Take away

We should use pure functions as much as possible when we write our software, particularly for defining business logic. It is, of course, impractical to expect *all* our code to be pure (After all, side effects pay the bills). In later lessons, we will explore ways to separate business logic and side effects to build software that is more maintainable.

## Resources

* <https://nofluffjuststuff.com/magazine/2016/11/the_duality_of_pure_functions>
* <http://blog.agiledeveloper.com/2015/12/two-rules-for-purity.html>
* <http://blog.agiledeveloper.com/2015/12/benefits-of-pure-functions.html>


# WIP - Shared Mutable State

{% hint style="danger" %}
This document is currently a Work In Progress. Please read the links added below for further information until this gets filled out.
{% endhint %}

## Resources

* <http://henrikeichenhardt.blogspot.com/2013/06/why-shared-mutable-state-is-root-of-all.html>
* <https://2ality.com/2019/10/shared-mutable-state.html>


# Introduction

Some of the most important things in the world are intentionally designed “simple”. In any system, the potential for error directly increases with its complexity - that’s why most elections still work by putting pieces of paper in a box.

We assume that complex problems always require complex solutions. We try to solve complexity by inventing tools and technologies to address a problem; but in the process we create another layer of complexity that, in turn, causes its own set of issues. Obviously not every problem has a simple solution, and most complex tools exist because of real usecases. But there’s a lot of value in actively questioning the need for complexity. Sometimes the smarter way to build things is to try and take some pieces away, rather than add more to it.

Developers are obsessed with the notion of “best practice”. It implies that there is one correct way of doing things, and all other solutions are either imperfect or, at worst, “anti-patterns”. But the definition of best practice changes everytime a new technology arises, rendering the previous solution worthless garbage (even though it still gets the job done). There is an undeniable ego factor to the way we use technology in our projects. To show everyone else how clever we are, we come up with harder and harder ways to achieve our tasks. And of course they all solve specific problems - but that does not mean they are always the best solution, regardless of context.

> *hat tip:* [*https://mxb.dev/blog/on-simplicity/*](https://mxb.dev/blog/on-simplicity/)


# Refactoring

Some technical debt is in plain sight. An inadequate data structure might lead to convoluted code. When the requirements keep changing, the code might contain traces of previous approaches. Sometimes the code is written in a hurry or is just sloppy.

This kind of technical debt is easy to discuss because it’s highly visible. It manifests as bugs, performance problems, and difficulties adding features.

There is another, more insidious kind of technical debt. Maybe the test suite is a little bit slow. Not slow to a crawl--but just enough that you don’t bother looking at a bug and add it to the backlog instead. Maybe you don’t trust the deployment script so you skip that extra release. Perhaps the abstraction layers make it too hard to locate a performance regression so you leave a TODO in the code. Sometimes the unit tests are too rigid so you postpone trying an intriguing new idea until after you’ve shipped the planned features.

None of these things are deal breakers. If anything, they might seem like distractions. It feels vain to complain about them. And so these things never get done. They don’t seem important enough by themselves. The friction killed them. Some of these explorations could be of no consequence. Some of them could redefine your project. This is why you must actively reduce friction, like your project’s fate depends on it. Because it does.

## Evolving architecture

> "We build our computer systems the way we build our cities: over time, without a plan, on top of ruins."&#x20;
>
> *Ellen Ullman*

When dealing with large, complex systems, a key problem is how to evolve the architecture without just throwing everything up in the air and hoping it lands on time. That approach is a thing of the past in our world of continuous engineering and delivery. In fact, even in the past it was problematic since it deferred many of the trickiest and time-consuming integration tasks and was a source of many a late project.

A big challenge of re-architecting a system is recognising subtle inherent (or hidden) requirements since they are often implicit in the way the component is used rather than an explicit part of the API contract.

[Fred Brooks](https://en.wikipedia.org/wiki/Fred_Brooks) differentiates between two different types of complexity: accidental complexity and essential complexity.

* *Accidental complexity* relates to problems which engineers create and can fix; for example, the details of writing and optimising assembly code or the delays caused by batch processing.&#x20;
* *Essential complexity* is caused by the problem to be solved, and nothing can remove it; if users want a program to do 30 different things, then those 30 things are essential and the program must do those 30 different things.

## References

* <https://overreacted.io/fix-like-no-ones-watching/>


# Architecture Decision Records

## Context

Architecture for agile projects has to be described and defined differently. Not all decisions will be made at once, nor will all of them be done when the project begins.

Agile methods are not opposed to documentation, only to valueless documentation. Documents that assist the team itself can have value, but only if they are kept up to date. Large documents are never kept up to date. Small, modular documents have at least a chance at being updated.

Nobody ever reads large documents, either. Most developers have been on at least one project where the specification document was larger (in bytes) than the total source code size. Those documents are too large to open, read, or update. Bite sized pieces are easier for for all stakeholders to consume.

One of the hardest things to track during the life of a project is the motivation behind certain decisions. A new person coming on to a project may be perplexed, baffled, delighted, or infuriated by some past decision. Without understanding the rationale or consequences, this person has only two choices:

1. **Blindly accept the decision.**

   This response may be OK, if the decision is still valid. It may not be good, however, if the context has changed and the decision should really be revisited. If the project accumulates too many decisions accepted without understanding, then the development team becomes afraid to change anything and the project collapses under its own weight.
2. **Blindly change it.**

   Again, this may be OK if the decision needs to be reversed. On the other hand, changing the decision without understanding its motivation or consequences could mean damaging the project's overall value without realizing it. (E.g., the decision supported a non-functional requirement that hasn't been tested yet.)

It's better to avoid either blind acceptance or blind reversal.

## Decision

We will keep a collection of records for "architecturally significant" decisions: those that affect the structure, non-functional characteristics, dependencies, interfaces, or construction techniques.

An architecture decision record is a short text file in a format similar to an Alexandrian pattern. (Though the decisions themselves are not necessarily patterns, they share the characteristic balancing of forces.) Each record describes a set of forces and a single decision in response to those forces. Note that the decision is the central piece here, so specific forces may appear in multiple ADRs.

We will keep ADRs in the project repository under doc/arch/adr-NNN.md

We should use a lightweight text formatting language like Markdown or Textile.

ADRs will be numbered sequentially and monotonically. Numbers will not be reused.

If a decision is reversed, we will keep the old one around, but mark it as superseded. (It's still relevant to know that it was the decision, but is no longer the decision.)

We will use a format with just a few parts, so each document is easy to digest. The format has just a few parts.

**Title** These documents have names that are short noun phrases. For example, "ADR 1: Deployment on Ruby on Rails 3.0.10" or "ADR 9: LDAP for Multitenant Integration"

**Context** This section describes the forces at play, including technological, political, social, and project local. These forces are probably in tension, and should be called out as such. The language in this section is value-neutral. It is simply describing facts.

**Decision** This section describes our response to these forces. It is stated in full sentences, with active voice. "We will ..."

**Status** A decision may be "proposed" if the project stakeholders haven't agreed with it yet, or "accepted" once it is agreed. If a later ADR changes or reverses a decision, it may be marked as "deprecated" or "superseded" with a reference to its replacement.

**Consequences** This section describes the resulting context, after applying the decision. All consequences should be listed here, not just the "positive" ones. A particular decision may have positive, negative, and neutral consequences, but all of them affect the team and project in the future.

The whole document should be one or two pages long. We will write each ADR as if it is a conversation with a future developer. This requires good writing style, with full sentences organized into paragraphs. Bullets are acceptable only for visual style, not as an excuse for writing sentence fragments. (Bullets kill people, even PowerPoint bullets.)

## Status

Accepted.

## Consequences

One ADR describes one significant decision for a specific project. It should be something that has an effect on how the rest of the project will run. The consequences of one ADR are very likely to become the context for subsequent ADRs. This is also similar to Alexander's idea of a pattern language: the large-scale responses create spaces for the smaller scale to fit into. Developers and project stakeholders can see the ADRs, even as the team composition changes over time. The motivation behind previous decisions is visible for everyone, present and future. Nobody is left scratching their heads to understand, "What were they thinking?" and the time to change old decisions will be clear from changes in the project's context.

## Experience Report

You may have noticed that this post is formatted like an ADR itself. We've been using this format on a few of our projects since early August. That's not a very long time in the global sense, but early feedback from both clients and developers has been quite positive. In that time, we've had six to ten developers rotate through projects using ADRs. All of them have stated that they appreciate the degree of context they received by reading them.

ADRs have been especially useful for capturing longer-term intentions. We have several clients who are stabilizing their current systems, but looking toward a larger rearchitecture in the not-too-distant future. By writing these intentions down, we don't inadvertently make those future changes harder.

One potential objection is that keeping these in version control with the code makes them less accessible for project managers, client stakeholders, and others who don't live in version control like the development team does. In practice, our projects almost all live in GitHub private repositories, so we can exchange links to the latest version in master. Since GitHub does markdown processing automatically, it looks just as friendly as any wiki page would.

So far, ADRs are proving to be a useful tool, so we'll keep using them.

## More Reading

Thanks to Philipe Kruchten for discussing the importance of architecture decisions. I'm told there is more about them in Documenting Software Architectures which is near the top of my reading queue.

Credit:s Michael Nygard, <http://thinkrelevance.com/>


# Iteration Planning Meetings

IPMs will be held regularly as part of all projects that we work on. The length of an iteration varies but is usually 1 or 2 weeks. The focus of an IPM is to evaluate what was done (and not done) in the previous iteration, and ensure everyone knows what is planned for the upcoming iteration.

From your perspective as a valuable team member, here are the points you should keep in mind:

* Ensure everyone knows what you couldn’t finish in the previous iteration. If you were able to finish everything and did something extra, make sure the team is aware you did something else as well -- this is important for scheduling!
* Understand what is on your plate for the next iteration. If you have thoughts on what you should pick up, feel free to suggest it to the team.
* [INVEST](https://en.wikipedia.org/wiki/INVEST_\(mnemonic\)) in the stories being discussed is a useful way to ensure they’re ready to be picked up. Talk through the user-facing value for a feature; ensure there is clarity on requirements, assets, flows, etc.&#x20;
* An IPM may not enough time for you to be able to judge whether the tasks assigned to you can be done in the duration or not,&#x20;


# Daily Standup Meetings

DSMs happen every day, usually with the full team of a project -- this includes people from the client’s org who are working with us, and other external contractors.

In the spirit of agile engineering, the advantage of a DSM is to surface issues/blockers as soon as possible, and keep the team aware (on a broad level) of what is happening elsewhere in the project. Seeing everyone face-to-face daily builds trust and accountability. We encourage people to ask questions across the team to get increased clarity on a specific thing, if needed.

The “standup” part of the meeting is important; everyone remains on their feet, keeps the focus on quick updates, and tries to finish the entire meeting in a few minutes. Inadvertently... it may happen that someone’s update leads to a set of people discussing the thing in full detail -- this wastes everyone else’s time, and should be moved out of standup into a separate discussion.


# Retro meetings (retrospective)

A retrospective is a structured meeting to review the process and outcomes of a particular project. A sample board is available on Trello [here](https://trello.com/invite/b/fyAux5Ay/400d59e42f8b4792c70561ca99acbef0/context-for-retrospective-date) and Airtable [here](https://airtable.com/shrRsqsGmbWFgUHnv).

## Objective

A retrospective is a meeting that happens at particular milestones, where the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly. The aim is to:

* Celebrate what they did well
* Identify pain points they came across

This allows the team to work towards fixing those pain points, to get better in functioning as a team, and to build better products.

The aim of any retrospective is to learn. It is a place that is safe to be honest and voice all opinions. Remember, something that went wrong is a reflection not on the team member but on the processes the team has put together. It's the team vs the problem, not the members of the team against each other.

{% hint style="success" %}
**Prime directive:** Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they knew at the time, their skills and abilities, the resources available, and the situation at hand.
{% endhint %}

## What a retrospective is not

* A replacement to communication required to fix issues that arise over the normal course of a project
* An excuse to spend an hour venting (although some venting is normal, and possibly necessary)
* A huge burden on time/resources

## Tooling

We used to use Trello/Airtable but we had a great experience last time using [TeamRetro](https://teamretro.com).

There are many other tools available to hold retros on the market. Some of the other popular ones are [FunRetro](https://funretro.io), [Reetro](https://reetro.io).

It is important to remember that tooling is not as important as getting the job done.

## People

### Facilitator

Neutral third party. The job of the facilitator is to

* Enforce time
* Ensure the discussion is not dominated by a few people
* Nudge everybody involved to participate

### Participants

Generally all stakeholders. Generally 4-8 people, most people involved in the day to day tasks and building of the project. [Pizza Rules apply here](https://www.theguardian.com/technology/2018/apr/24/the-two-pizza-rule-and-the-secret-of-amazons-success).

All participants in the project must be present, not just representatives of the various teams.

**The retrospective is only as good as the people included.** One would benefit from a deeper understanding of the bumps along the road if you include people who were a part of the process in unique ways. However, including some people might not be necessary if their role was extremely limited.

## Structure

### Assumed essentials

* A team that has a high degree of trust within each other
* A relatively conflict-free environment (or one in which other efforts have been made to resolve them prior to the retrospective)

### Pre-work

Most of the pre-work is to be done by the facilitator.

1. Setting up a calendar invite with a detailed process - maybe even link to this document there.
2. Make sure everyone involved understands the process before getting started - pay special attention to new joinees, and people who haven't been part of retrospectives before!
3. If people are remote, ensure that the meeting happens when everyone has access to a good internet connection. Ensure that the AV setup happens before the meeting to ensure a smooth flow.
4. Ensures that everyone has their own device by which to participate in the retro.
5. Share the link where the retro is happening into the chat (for quick access).

## Allocated Time

We have never had a useful retrospective take up less than an hour and a half.

* **0000:** Set context for the meeting, introduce Prime Directive, walk people through structure, answer questions. Commit to **maintain an open mind and open communication with your team**
* **0005:** The team will have 7 minutes to individually write down **What Went Well**
* **0013:** The team will have 7 minutes to individually write down **What Did Not Go Well**
* **0020:** The team will have 10 minutes to read through everything written down. Participants can read out the cards they have authored and explain/clarify the contents of their card. This is not a space for discussion, only a space to clarify intent.

  The facilitator will use this time to de-duplicate the cards, and perhaps reword some to make intent clearer.
* **0030:** The team will then vote on the cards that they all agree with/things that they would like to discuss.

  General rule of thumb: Each individual gets as many votes as there are total number of people. The purpose of limiting votes is so that we can prioritize our discussion in the interest of time.

  Votes are noted by adding themselves to the card (on Trello) or adding themselves to the vote column (on Airtable).

  Order the votes.
* **0040:** Read through all the cards on what went well. Give shout outs and pats on the back to all your teammates! Do not dwell too long here, but do make sure you acknowledge and celebrate all your wins - especially if there are things in this section that did not go so well in previous retros.
* **0050:** Discuss "What Didn't Go Well". People who voted should be asked to talk about the card, and why they voted, and other people should be asked for opinions. Action items should be noted as they come up.

Here is where the facilitator is most required; they ensure that as each item is discussed:

* All questions that arise (implicit or explicit) are answered
* All voices participating in the retrospective are heard
* Action Items are derived, stated and assigned owners
* Additional opinions are given where necessary, and suggestions made, from the valuable role of a neutral third party observer.

And then, when you're done, you're done. Yay!

## Timeline Recommendation

A project retrospective happens once every quarter, with a meeting between leads every six weeks to check-in and ensure movement on the previously agreed-on action items. If movement on action items does not happen even over a quarter, it is a red flag that something is going wrong somewhere.

## Results of the retrospective

After a retrospective, **all the material must be digitized and made available to all participants**.

Action Items are noted by the assigned owners after the retrospective, and it is expected that they take the necessary steps to carry them out.

Retrospectives are a great way to track progress over a large period of time; for individuals, teams and organisations. It can be quite useful to look at retrospectives we have been a part of before to track how far we have come since then, and what sort of (different) mistakes we are making now.

## Further Reading

* <https://www.atlassian.com/team-playbook/plays/retrospective>
* <https://www.smashingmagazine.com/2017/09/importance-project-retrospectives-part-1/>
* <https://www.intercom.com/blog/how-we-conduct-project-retrospectives-at-intercom/>
* <https://medium.com/redheadjessica/a-step-by-step-guide-to-using-trello-for-team-retrospectives-da327daf7e47>


# Introduction

RE (Release Engineering) is the difference between building software in small teams/startups and manufacturing software in an industrial way that is repeatable, gives predictable results, and scales w

Whenever a team is trying to ship a product, there are 3 major worries…

* Features
* Quality
* Schedule

Given any sort of constraint, the first thing that is kicked off the list are Features! Teams are always aiming for top notch quality, because high quality brings with it many advantages:

* High quality means less maintenance in the future&#x20;
  * … means less stress for the team
  * … means longevity of the system in production
  * ... means control and predictability of costs

{% hint style="info" %}
Organisations want a trustworthy schedule that they can believe in. It helps align the units of the organisation, and helps it work like an efficient machine.
{% endhint %}

In a competitive world, this is a critical advantage to companies. New products can be planned accordingly, because results for the current one will arrive in a predictable fashion. Other engineering teams (API, infrastructure, IT) know when to expect something new and be suitably prepared. Even marketing and sales teams are happy!


# Git commit messages

Writing clear and concise git commit messages is important to the overall health of a project and the team that is working on the project.

Good commit messages have 3 critical benefits:

1. Help speed up the code review process
2. Help in writing good release notes&#x20;
3. Help future maintainers (and your future self) understand why a change was made, or what exactly a particular bug was

### Sample commit message

```
 Short (70 chars or less) summary of changes

 More detailed explanatory text, if necessary.  Wrap it to about 80
 characters or so.  In some contexts, the first line is treated as the
 subject of an email and the rest of the text as the body.  The blank
 line separating the summary from the body is critical.

 Further paragraphs come after blank lines.
  - Bullet points are okay, too 
  - A hyphen is used for the bullet, surrounded by a single space
```

* The summary line is written in the imperative voice, and is structured in a way so that the message completes the sentence, “If applied, this commit will…”. For eg:
  * "Split the Rx streams in RecentPatientsViewController"
  * "Add Appium checkstyle task to the git pre-push hook"
  * "Add query in PatientRepository to get count of sync-pending records"
* Summary lines start with words like “Add”, “Update”, and “Fix” instead of Added, Updated and Fixed
* Summary lines never end with a period, just like the subject of an email&#x20;
* The explanatory text isn’t required but encouraged, especially when a commit fixes a bug. It’s good practice to explain clearly why a certain issue was occurring and how the commit fixes it.&#x20;


# Code reviews & pull requests

Regular, team-wide code reviews are important for the health of the software being built.

Code reviews ensure standards and guidelines are respected and followed, and the larger team learns about the new code being written. Sure, code reviews can (and do!) help with catching mistakes early on, but in large codebases, techniques like test-driven-development are far more effective for writing bug-free code.

Code reviews are an opportunity for discussion and evaluation; a chance for novice engineers to get feedback on their ideas from senior ones, and a time for senior engineers to walk the rest of the team through their thought process.

## Most important points

{% hint style="warning" %}
It is the code that is being reviewed, and not the person who wrote it!
{% endhint %}

* Many programming decisions are opinions and not facts. When discussing tradeoffs, ensure it doesn’t lead to bike-shedding and a cost-benefit analysis is done -- “What is the cost of discussing this thing for 60 minutes? What is the benefit or drawback of picking a choice? Is it worth our time?”&#x20;
* Ask questions and don’t *demand* changes. Good questions avoid judgment and avoid assumptions about the author's perspective.
* Don’t use hyperbolic words and avoid all sarcasm. Temper your communication, sit down, stay humble.&#x20;

Avoid selective ownership of code. Eventually, it is the team’s code and the entire team has to share the responsibility of maintenance. Team and project standards are much more important than personal opinions. When disagreeing, first commit to using the prevailing standard. Discuss the standard later... right here, in the handbook! Just [open a pull request](https://github.com/obvious/handbook/pulls).

## Assigning a PR

{% hint style="info" %}
You can automate this using [a tool like PullAssigner](https://pullpanda.com/assigner/)!
{% endhint %}

* In a round-robin fashion, assign your PR to a team member. This should be done without asking them. Everyone should be coding and reviewing at all times.&#x20;
* If you think your PR is non-trivial and needs more than one pair of eyes, then assign it to two people. If you’re new to the team, assign it to two people.
* If your PR isn’t reviewed in the next 24 hours, talk to the assignee in person and figure out what’s happening. Maybe they're busier than usual and need a helping hand?

## Helpful tips

* It is often easier to follow the author's train of thought by reviewing a PR commit by commit, instead of reading the entire diff file by file.
* When commenting on an intermediate commit in a PR, one should first make sure that the comment makes sense when the complete PR is seen as a whole. Because the author may have already addressed the concern in another commit down the PR.
* If you're reviewing on github.com itself, there are [handy keyboard shortcuts](https://help.github.com/en/github/getting-started-with-github/keyboard-shortcuts#changes-in-pull-requests) you can use!&#x20;

## More reading material

* [How to do a code review](https://google.github.io/eng-practices/review/reviewer/), on the Google engineering practices website.


# Trunk-based development

From Feature-based Delivery to Timeline-based Delivery. See trunkbaseddevelopment.com for the official documentation.

{% hint style="info" %}
The Trunk Based Development website says “It is a source-control branching model, where developers collaborate on code in a single branch called `master` (or “trunk”), and resist any pressure to create other long-lived development branches. They therefore avoid merge hell, do not break the build, and live happily ever after.”
{% endhint %}

That sounds great but... what exactly is it, and why should you care about it? For a bit, let’s forget about code and branches and use an analogy that is easier to understand -- the transit system of a city.

## When is the next train?

![](https://2090183177-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LzfhbfjxX5uAp-90-B_%2F-M72I7MyrgW1cAmuj8J3%2F-M72M4CyABqdcgJImPZv%2FHeader%20Illustration%40300x.png?alt=media\&token=61771e9b-8da2-4f27-bbba-6aec0a5b3a8d)

Imagine a city with lots of different train stations. The network can run using lots of trains at different frequencies. Let’s consider three different scenarios:

* A train passes through each station once every day
* Trains pass through each station six times every day
* Trains pass through each station a hundred times every day

What will be the effect of the three different possibilities on the people living in the city?

**In the first case**, if a person misses the train there is no other way to reach the destination until the next train, which unfortunately will arrive on the next day.

**In the second case**, if a person misses one train they can catch another train in a few hours and won’t have to wait for an entire day to reach their destination. This means people don’t care about the schedule of the trains as much as they do in the first case. It is possible to reach the destination in a few hours -- late, but possible.

**In the last case**, if a person misses a train they can easily catch another train in a few minutes. It’s easy to imagine that people will stop caring about the train schedule altogether and focus on what they want to do at the destination. The transit system becomes an artifact that recedes in the background, letting people concentrate on what they actually want to do -- living their lives and getting things done!

Now let’s go back to building and delivering software.

## Feature-driven delivery a.k.a. Unpredictability

In a lot of teams, the frequency of releases is determined by “when this Important List of Features gets done”. That leads to unpredictable releases with large delays between deployments. Although such teams try to “fix” a release date and try to cut scope so that the Very Important Date can be met, it rarely works.

Engineers working on different feature branches rush to get their tasks done before The Date. Merging all of those feature branches becomes a painful ritual as people discover all sorts of changes that have happened in the repository over the past few weeks that they were working on their own branch. Merge meetings are scheduled and a War Room is created to tackle issues that stand in the way of meeting The Date. Inevitable, The Date starts to move. Seven “medium priority” bugs that customers have been complaining about need to be fixed. The CEO’s personal favourite feature request has to be part of this release even though the team heard of it a week ago.

Every little thing is important because who knows when the next release will go out? The entire team -- nay the org -- rallies around The Date even though it has changed three times and the original date has been forgotten.

There are some themes that emerge in this familiar scenario:

* **Merge hell**, as discussed above, since multiple, long-running feature branches become part of the primary codebase very close to The Date.&#x20;
* **Massive changesets** to review, or what happens in reality, no code review at all. Reviewing a three-thousand line diff that has been worked on for two weeks is an exercise in frustration.&#x20;
* **Favouring the Rockstar Programmer** over the team, since it is considered acceptable and natural that a great engineer will disappear for a few days or weeks, and come back with all the work done in a branch far, far away from the rest of the codebase. Merging is the team’s collective problem, unfortunately.&#x20;
* **Emotional turmoil** and a high probability of burnout for everyone in the team especially as The Date inches closer.&#x20;

So what is the solution to this problem? We need to increase the frequency of the trains, of course. Hundreds of them every day!

## Timeline-based Delivery a.k.a. Daily Success

For software engineering, that implies…

* We increase the frequency of production releases to as frequent as possible -- daily, or even hourly!&#x20;
* We drastically reduce the size of changes that are merged into the trunk. As each merge request becomes small, reviewing it becomes far easier.&#x20;
* Since each merge integrates only a small number of changes, the possibility of conflicts also rapidly goes down. When conflicts do happen, resolving them is fast and painless.&#x20;
* Changes arrive into the codebase on a daily basis, which means the team is aware of the state of work that is in progress. Any impact from the changes being done is felt very early in the process, giving the team ample time to reach a resolution.

![](https://2090183177-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LzfhbfjxX5uAp-90-B_%2F-M72I7MyrgW1cAmuj8J3%2F-M72MGLGnwYi2kZ1OfPm%2FIllustration2%40300x.png?alt=media\&token=b1f039f0-8ce6-41ab-9da4-6322713d40f9)

All of this sounds great in theory and it makes sense. How about in practice?

* TBD promotes **short-lived feature branches** and frequent merges with the trunk. A branch usually has only one developer, it doesn’t last more than a day or two before it gets merged into the trunk.
* This automatically pushes teams towards **Continuous Integration**. Every commit that lands on the trunk goes through the CI pipeline, confirming that it is indeed ready for integration.&#x20;
* Once continuous integration is in place, it is natural to follow it up with **Continuous Delivery**. Since all commits that land on trunk have been marked “stable” by the CI pipeline, they can be deployed immediately.&#x20;
* Since an approved code review means the code will be available on trunk immediately, **teams rally together to review code** as fast and as many times as possible.&#x20;
* Not everything can be done within a day, and features can take a long time to build. In those cases, **work-in-progress code is “hidden” behind a feature flag**. Flags ensure that incomplete features can be reviewed and still land on the trunk.
* Flags can also **act as a remote control** for making features available at a later time. Features can be fully developed and be part of the codebase, and then be remotely toggled on (or off). Once a feature has been “enabled”, the alternative code path and flags can be deleted from the codebase.&#x20;

All of this comes together to ensure the codebase is releasable on demand. Bug fixes are deployed as soon as the fix is available on the trunk. Teams stop coordinating releases to figure out which commits are “safe” to release.

Developers go back to focusing on what is important – building features and eliminating bugs – rather than being burdened with a release date.

## Associated techniques

* [Feature flags](https://trunkbaseddevelopment.com/feature-flags/)
* [Branch by abstraction](https://trunkbaseddevelopment.com/branch-by-abstraction/)


# Our methodology

Following "pure" TBD is difficult without a lot of tooling, so here's the lightweight approach that we follow that relies on team discipline.

## Daily branches

To ensure that constant integration of code is happening, we prefer making "daily branches". This doesn't strictly mean a branch every day, but branches *rarely last beyond 2 days* without being raised as a PR. We also ensure that the changeset of a PR doesn't exceed *300-400 lines of code*.

### Conventions

* Daily branches are named as `initials/date/subject`
* For example, if your initials are PK, and you raise a branch on 17th December to update the Android Gradle Plugin, your branch title should be something like `pk/17dec/upgrade-agp`
* No underscores allowed, only dashes

## Releases

In the ideal world of TBD, every commit is stable and release-ready, which is why Continuous Deployment works so well once a team switches to doing TBD.

On a platform like the Web, every commit to `master` should be deployed as soon as possible, and it makes sense because users immediately get the updated resources. However, on mobile platforms like Android and iOS, deploying a commit leads to the creation of an installable binary file. This file is pushed to a Store and it usually takes a few hours to a few days before all devices can see the available update -- and this process is entirely out of our control. Not only that, the user can choose to not install an update for days or weeks on end!

As a result of this, we follow a periodic release cycle -- once a week, or once every two weeks -- for mobile apps, instead of pushing every single commit. To ensure that the binary that is being published is stable, we pursue the following strategy:

* We create a release branch from master; this is titled as `release/yyyy-mm-dd`, where the date in the title is the date this branch will be released to the Store
* The code in the branch is tested till the date of the release
* No one directly commits anything to a release branch. If a bug is found or an urgent change needs to be made, that change is first done on `master` and then cherry-picked onto the release branch


# Service Dependencies

List of services Obvious has used in past projects

## Simple (Android app)

* Remote Mobile App Configuration Database
  * [Firebase](https://firebase.google.com/)
* Mobile App Error Logging
  * [Sentry](https://sentry.io)
* Mobile App Usage Analytics
  * [Heap](https://heap.io/)
* Continuous Integration & Deployment
  * [Bitrise](https://www.bitrise.io/)
* App Deployment
  * [Google Play Console](https://play.google.com/apps/publish/)

## Simple Dashboard & API (Ruby on Rails web app)

* Application Hosting (Ubuntu Linux, nginx, Passenger)
  * [AWS EC2](https://aws.amazon.com/ec2/)
* PostgresSQL Database Hosting
  * [AWS RDS](https://aws.amazon.com/rds/)
* Redis Cache Hosting
  * [AWS ElastiCache](https://aws.amazon.com/elasticache/)
* External Storage (for log files, database backups)
  * [AWS S3](https://aws.amazon.com/s3)
* Server & Application Monitoring
  * [New Relic](https://newrelic.com/)
* Server Error Logging
  * [Sentry](https://sentry.io)
* Automated SMS
  * [Twilio](https://www.twilio.com/)
* Patient calls with masked caller ID
  * [Exotel (in India)](https://exotel.com/)
* Email Delivery
  * [SendGrid](https://sendgrid.com/)
* Web App Usage Analytics
  * [Google Analytics](https://analytics.google.com/)
* Continuous Integration & Deployment
  * [Semaphore](https://semaphoreci.com/)


# Tooling & infrastructure

## Code

{% embed url="<https://github.com>" %}

## Crash reporting

{% embed url="<https://Sentry.io>" %}

## Continuous Integration

{% embed url="<https://Bitrise.io>" %}

{% embed url="<https://semaphoreci.com>" %}

{% embed url="<http://codeclimate.com/>" %}

{% embed url="<https://pullreminders.com>" %}

{% embed url="<https://github.com/tibdex/autorebase>" %}

## User and System Analytics

{% embed url="<https://heap.io>" %}

{% embed url="<https://metabase.com>" %}

## Communication

{% embed url="<https://slack.com>" %}

{% embed url="<https://zoom.us>" %}


# Git commands & workflows

List of Git commands and workflows we generally use

## Git commands and workflows

* [Rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) - Instead of creating a merge commit to merge a feature from a different branch, we "rebase and merge" the branch to keep a clean commit history. Please read more about how to use it [here](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase).
* [Cherry pick](https://www.atlassian.com/git/tutorials/cherry-pick)
* [`commit --amend`](https://www.atlassian.com/git/tutorials/rewriting-history) - To change the last commit
* `push -f`

## Git GUI aid

* [Android Studio/IntelliJ git UI](https://www.jetbrains.com/help/idea/investigate-changes.html)
* [Gitkraken Git Client](https://gitkraken.com/git-client)
* [SourceTree](https://www.sourcetreeapp.com/)
* [Github Desktop](https://desktop.github.com/)


# Product Requirements Document

A product requirements document (PRD) is a document containing all the requirements to a certain product. It is written to allow people to understand **what** a product should do. A PRD should, however, generally **avoid anticipating or defining how** the product will do it in order to later allow interface designers and engineers to use their expertise to provide the optimal solution to the requirements.

Typically, a PRD is created from a user's point-of-view by a user/client. The requirements are then analyzed by a (potential) maker/supplier from a more technical point of view, broken down and detailed.

## References

* [Wikipedia](https://en.wikipedia.org/wiki/Product_requirements_document)


# Pivotal Tracker

A guide to how we use Pivotal Tracker, our favourite software project management tool.

## Terms

### **Epic**

Epics capture high-level goals associated with a feature, and usually consist of many stories (and bugs).&#x20;

It isn't compulsory to have Epics in every project, but they do help in maintaining a sense of "achievement" within the team. Simply completing story after story, fixing bug after bug, can get monotonous... and "completing" an epic marks the end of a consolidated effort by the team.

### **Story**

The smallest part of a feature is called a User Story.  It is a concrete, well-understood, independent unit of work that can be delivered to the user for some demonstrable value (n.b.: also see Chores).&#x20;

Stories are estimated by using a "points system" before they are started.&#x20;

### **Chore**

A purely technical task that does not add *demonstrable* value to any user of the system. It is important to track such chores because they add value to the overall project. For e.g.: refactoring code, upgrading dependencies, adding automation scripts.&#x20;

### **Bug**

A feature in production that does not function as expected. 💔

### **Blocker**

* A question related to a story that needs to be answered before that story can be worked on. &#x20;
* A dependency where another story needs to be completed before a story can be worked on.

### **Release**

A marker in the Backlog that represents a version to be delivered or a milestone to be achieved. All stories "above" a Release marker must be delivered and accepted, before the due date.&#x20;

## Lists

### **Current Iteration**

A prioritized list of stories to be worked on during the current iteration. An iteration is usually one (1) week long, but this can be configured in Pivotal on a per-project level.&#x20;

### **Backlog**

A prioritised list of stories planned to be worked on in the upcoming iterations.&#x20;

### **Icebox**

An unprioritsed list of all stories, chores, and bugs. Items from the Icebox are added the Backlog during prioritisation discussions, usually an [Iteration Planning Meeting](broken://pages/-LcpfiEsgQh8XQnvKyWV).


