Software Engineering Culture - Improve Code Quality

Preview:

Citation preview

Software Engineering Culture:Improve your Code Quality.

Dmytro Patserkovskyi

2 CULTURE

What is

CULTURE?

That complex whole which includes knowledge, belief, art, morals, law, custom

and any other capabilities and habits acquired by man as a member of society.

3

Edward Burnett Tylor

CULTURE AND SOCIETY4

CULTURE SOCIETY

CULTURE AND SOCIETY5

CULTURE SOCIETY

Automate everything

Fast reaction on events

Identify problem on early stage

Best Practices

Approaches

Tools

Let’s Play CULTURE

6

CODE CONVENTIONS & AUTOMATED TESTING

7

CODE CONVENTIONS

A set of guidelines for a specific programming language that recommend programming style, practices and methods for each aspect of a piece program written in this language.

8

Spaghetti code is a bad practice.

AUTOMATED TESTING

- Unit testing;- Integrating testing;- System testing;- Performance testing;- Other testing...

9

VERSION CONTROL

10

Problems we need to solve:➔ retain few latest versions of our

product;➔ retain history of changes;➔ possibility to work in parallel;➔ possibility to rollback some changes;

VERSION CONTROL

File System

11

Central Version Control

Distributed Version Control

first generation second generation third generation

VERSION CONTROL - Our Solution

Use BitBucket as git server.

Implement each feature in separated branch.

Merge through pull request.

Make tag for each version.

12

CODE REVIEW

13

Problems we need to solve:➔ minimize human mistakes;➔ catch problematic code on early

stage;➔ exchange experience between

teammates;

CODE REVIEW

Code Looks Good

14

Advanced Reviewer

Group Code Reviews

first generation second generation third generation

CODE REVIEW - Our Solution

Pull request for every merge in master.

Each repository have primary reviewers.

Everyone can review and decline any pull request.

Group decision about merge.

15

CODE ANALYSIS

16

Problems we need to solve:➔ keep code clean;➔ argumentative measures of our code;➔ fast and automated code analysis;➔ track history of our code measures.

CODE ANALYSIS

Code Review

17

Automated Static Analysis

Continuous Inspection

first generation second generation third generation

CODE ANALYSIS - Our Solution

Use SonarQube for Continuous Inspection.

Run code analysis during night builds.

Make KPI for code improvements monthly (metrics and value that we need to improve during the month).

18

CODE INSPECTION - SonarQube

SonarQube - code quality management pluggable platform.

Support of several languages.Duplications & Complexity.Code coverage.Detection violations (Checkstyle, PMD, FindBugs).Quality profiles and gates.

19

CODE INSPECTION - SonarQube20

CODE INSPECTION - SonarQube21

CODE INSPECTION - SonarQube22

CONTINUOUS INTEGRATION

23

Problems we need to solve:➔ integrate changes of teammates

frequently;➔ check each integration;➔ painless releases;➔ painless deployments.

CONTINUOUS INTEGRATION

Continuous Integration

24first generation

Continuous Deployment

second generation third generation

Continuous Delivery

CONTINUOUS INTEGRATION - Our Solution

Use Jenkins for running jobs.

Check every pull request.

Check every integration into master branch.

Prepare release by one button click or by schedule.

Deploy each release into artifacts storage.

25

Problems we need to solve:➔ monitor health of our application on

different layers and aspects;➔ collect information about specific

nuances about our functionality;➔ analyze collected information in

comfortable way.

MONITORING

26

MONITORING27first generation second generation

Writing Logs

third generation

Black-Box Monitoring

White-Box Monitoring

MONITORING - Our Solution

Use Zabbix for black box monitoring: hardware.

Use Grafana and Kibana for white box monitoring.

Monitor layers:

Hardware;

Operation System;

Docker & VM;

Application.

28

MONITORING - Zabbix

Zabbix is the ultimate enterprise-level software designed for real-time monitoring of millions of metrics collected from tens of thousands of servers, virtual machines and network devices.

29

MONITORING - Zabbix30

MONITORING - Grafana, Kibana

Grafana - graph and dashboard builder for visualizing time series metrics.

Kibana - data visualization platform that allows you to interact with your data through stunning, powerful graphics.

31

MONITORING - Grafana, Kibana32

MONITORING - Grafana, Kibana33

GET OUR ASPECTS MIXED

34

SERVICES STACK

Code Writing Monitoring

35

GET OUR ASPECTS MIXED36

Writing Code, Tests

Push to VCS

Integration, Inspection

Create PullRequest

Code Review and Merge CD

USEFUL LINKS37

▹ http://www.sonarqube.org

▹ http://www.zabbix.com

▹ http://grafana.org

▹ https://www.elastic.co/products/kibana

QUESTIONS

38

Not seeking for improvements and automations is the most uncultured in IT

39

THANK YOU FOR YOUR TIME

40