software engineering culture - improve code quality

40
Software Engineering Culture: Improve your Code Quality. Dmytro Patserkovskyi

Upload: dmytro-patserkovskyi

Post on 10-Feb-2017

666 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Software Engineering Culture - Improve Code Quality

Software Engineering Culture:Improve your Code Quality.

Dmytro Patserkovskyi

Page 2: Software Engineering Culture - Improve Code Quality

2 CULTURE

What is

CULTURE?

Page 3: Software Engineering Culture - Improve Code Quality

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

Page 4: Software Engineering Culture - Improve Code Quality

CULTURE AND SOCIETY4

CULTURE SOCIETY

Page 5: Software Engineering Culture - Improve Code Quality

CULTURE AND SOCIETY5

CULTURE SOCIETY

Automate everything

Fast reaction on events

Identify problem on early stage

Best Practices

Approaches

Tools

Page 6: Software Engineering Culture - Improve Code Quality

Let’s Play CULTURE

6

Page 7: Software Engineering Culture - Improve Code Quality

CODE CONVENTIONS & AUTOMATED TESTING

7

Page 8: Software Engineering Culture - Improve Code Quality

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.

Page 9: Software Engineering Culture - Improve Code Quality

AUTOMATED TESTING

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

9

Page 10: Software Engineering Culture - Improve Code Quality

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;

Page 11: Software Engineering Culture - Improve Code Quality

VERSION CONTROL

File System

11

Central Version Control

Distributed Version Control

first generation second generation third generation

Page 12: Software Engineering Culture - Improve Code Quality

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

Page 13: Software Engineering Culture - Improve Code Quality

CODE REVIEW

13

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

stage;➔ exchange experience between

teammates;

Page 14: Software Engineering Culture - Improve Code Quality

CODE REVIEW

Code Looks Good

14

Advanced Reviewer

Group Code Reviews

first generation second generation third generation

Page 15: Software Engineering Culture - Improve Code Quality

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

Page 16: Software Engineering Culture - Improve Code Quality

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.

Page 17: Software Engineering Culture - Improve Code Quality

CODE ANALYSIS

Code Review

17

Automated Static Analysis

Continuous Inspection

first generation second generation third generation

Page 18: Software Engineering Culture - Improve Code Quality

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

Page 19: Software Engineering Culture - Improve Code Quality

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

Page 20: Software Engineering Culture - Improve Code Quality

CODE INSPECTION - SonarQube20

Page 21: Software Engineering Culture - Improve Code Quality

CODE INSPECTION - SonarQube21

Page 22: Software Engineering Culture - Improve Code Quality

CODE INSPECTION - SonarQube22

Page 23: Software Engineering Culture - Improve Code Quality

CONTINUOUS INTEGRATION

23

Problems we need to solve:➔ integrate changes of teammates

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

Page 24: Software Engineering Culture - Improve Code Quality

CONTINUOUS INTEGRATION

Continuous Integration

24first generation

Continuous Deployment

second generation third generation

Continuous Delivery

Page 25: Software Engineering Culture - Improve Code Quality

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

Page 26: Software Engineering Culture - Improve Code Quality

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

Page 27: Software Engineering Culture - Improve Code Quality

MONITORING27first generation second generation

Writing Logs

third generation

Black-Box Monitoring

White-Box Monitoring

Page 28: Software Engineering Culture - Improve Code Quality

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

Page 29: Software Engineering Culture - Improve Code Quality

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

Page 30: Software Engineering Culture - Improve Code Quality

MONITORING - Zabbix30

Page 31: Software Engineering Culture - Improve Code Quality

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

Page 32: Software Engineering Culture - Improve Code Quality

MONITORING - Grafana, Kibana32

Page 33: Software Engineering Culture - Improve Code Quality

MONITORING - Grafana, Kibana33

Page 34: Software Engineering Culture - Improve Code Quality

GET OUR ASPECTS MIXED

34

Page 35: Software Engineering Culture - Improve Code Quality

SERVICES STACK

Code Writing Monitoring

35

Page 36: Software Engineering Culture - Improve Code Quality

GET OUR ASPECTS MIXED36

Writing Code, Tests

Push to VCS

Integration, Inspection

Create PullRequest

Code Review and Merge CD

Page 37: Software Engineering Culture - Improve Code Quality

USEFUL LINKS37

▹ http://www.sonarqube.org

▹ http://www.zabbix.com

▹ http://grafana.org

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

Page 38: Software Engineering Culture - Improve Code Quality

QUESTIONS

38

Page 39: Software Engineering Culture - Improve Code Quality

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

39

Page 40: Software Engineering Culture - Improve Code Quality

THANK YOU FOR YOUR TIME

40