80
01

About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

01

Page 2: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

About me02

Page 3: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Andrey AdamovichBio: Developer, coach, speaker, author

Company: Aestas/IT (http://aestasit.com)••

03

Page 4: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Contact detailsE­mail: [email protected]

Linkedin: http://www.linkedin.com/in/andreyadamovich

Lanyrd: http://lanyrd.com/profile/andrey­adamovich

GitHub: https://github.com/aadamovich

SO: http://stackoverflow.com/users/162792/andrey­adamovich

Twitter: @codingandrey, @aestasit

••••••

04

Page 5: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Let's start!05

Page 6: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

BackgroundFind new clients

Face big code bases

Need quick analysis

Need quick results

••••

06

Page 7: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Code sizeGoogle: 2 billions LOC

Facebook: 61 million LOC

Me: from 20K to 2M LOC

•••

07

Page 8: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

I hate reading...

08

Page 9: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Reading codeI want this to work

This just works

Working is the definition of this block

Work! You, stupid!

The work should be here

01.

02.

03.

04.

05.

09

Page 10: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

It's life, Jim, but not as we know it!

10

Page 11: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Code is data!11

Page 12: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Well, big data12

Page 13: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Snapshot

13

Page 14: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Temporal

14

Page 15: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

First steps15

Page 16: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Count thelines!

16

Page 17: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Size does matterGives you an estimate (on how much reading is needed).

Most of the code bases are polyglot. Ratio between languages can

tell a lot.

Ratio between test code, comments, blank lines is also interesting.

••

17

Page 18: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

cloc

18

Page 19: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Usagecloc ‐‐help

cloc ‐‐write‐lang‐def=lang.defs

01.

02.

19

Page 20: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Usagecloc ‐‐csv 

     ‐‐quite 

     ‐‐progress‐rate=0

     ‐‐ignored=files.ignored 

     ‐‐exclude‐dir=test,build

     ‐‐read‐lang‐def=lang.defs 

     ‐‐out=data.csv

     .

01.

02.

03.

04.

05.

06.

07.

08.

20

Page 21: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Language definitionsGradle

    filter remove_matches ^\s*//

    filter remove_inline //.*$

    filter call_regexp_common C

    extension gradle

    3rd_gen_scale 4.10

01.

02.

03.

04.

05.

06.

21

Page 22: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Where are thepictures?

22

Page 23: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

We havestats, let'splot them!

23

Page 24: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Excel?Probably not.

24

Page 25: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Pie charts areboring!

25

Page 26: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Infographics!26

Page 27: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

d3.js

27

Page 28: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

d3.jsJavascript library for data visualizations

Tons of examples

Many libraries built on top of d3.js

Several books

••••

28

Page 29: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Example29

Page 30: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Many alternativesvis.js

raphael.js

sigma.js

many, many, many more

••••

30

Page 31: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Tableau Public

31

Page 32: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Tableau Public

32

Page 33: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Tableau Public

33

Page 34: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

infogr.am

34

Page 35: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

infogr.am

35

Page 36: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Temporalanalysis

36

Page 37: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

GitHub

37

Page 38: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

GitHub

38

Page 39: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

FishEye

39

Page 40: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

GourceSoftware projects are displayed by Gource as an animated tree with

the root directory of the project at its centre.

Directories appear as branches with files as leaves.

Developers can be seen working on the tree at the times they

contributed to the project.

“40

Page 41: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Launch gourcegource ‐s 0.1 ‐1280x720 

gource ‐‐output‐custom‐log log1.txt 

gource ‐s 0.1 ‐1280x720 log1.txt

01.

02.

03.

41

Page 42: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Log format1444125624|Luke Daley|M|/ratpack‐core/.../WiretapPublisher.java

1444125624|Luke Daley|M|/ratpack‐core/.../YieldingPublisher.java

1444306114|Stian Lindhom|M|/ratpack‐manual/.../13‐http.md

1444312172|Andrey Antukh|M|/ratpack‐core/.../WebSocketEngine.java

01.

02.

03.

04.

42

Page 43: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Demo43

Page 44: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Metrics44

Page 45: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

SonarQube

45

Page 46: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Demo46

Page 47: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Supported langauges IABAP (comercial)

Android

C/C++ (comercial)

C#

COBOL (comercial)

Flex

••••••

47

Page 48: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Supported langauges IIGroovy

Java

JavaScript

Objective­C (comercial)

PHP

•••••

48

Page 49: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Supported langauges IIPL/I (comercial)

PL/SQL (comercial)

Python

RPG (comercial)

Swift (comercial)

•••••

49

Page 50: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Supported langauges IIVB.NET (comercial)

Visual Basic 6 (comercial)

Web (HTML, JSP/JSF)

XML

50

Page 51: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Extracting data

51

Page 52: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Structure52

Page 53: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Saikurohttps://github.com/ThoughtWorksStudios/saikuro_treemap

https://www.youtube.com/watch?v=iiIytERhV9o••

53

Page 54: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Structure101

54

Page 55: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Stan4j55

Page 56: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Graphs are everywhere!

56

Page 57: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

AST

57

Page 58: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

jQAssistantjQAssistant is a QA tool which allows the definition and validation of

project specific rules on a structural level.

It is built upon the graph database Neo4j and can easily be plugged

into the build process to automate detection of constraint violations

and generate reports about user defined concepts and metrics.

“58

Page 59: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Query your codeMATCH

  (class:Class)‐[:DECLARES]‐>(method:Method)

RETURN

  class.fqn, count(method) as Methods

ORDER BY

  Methods DESC

LIMIT 20

01.

02.

03.

04.

05.

06.

07.

59

Page 60: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Demo60

Page 61: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

That's it!61

Page 62: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

ConclusionExtract data from your code!

Visualize it!

Search for new facts and knowledge!

•••

62

Page 63: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Readingmaterial

63

Page 64: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

D3 Cookbook

64

Page 65: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

D3 Tips & Tricks

65

Page 66: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Metrics and models in SQE

66

Page 67: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Software metrics and metrology

67

Page 68: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Cool infographics

68

Page 69: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

The infographic history of the world

69

Page 70: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Infographica

70

Page 71: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Information is beautiful

71

Page 72: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Knowledge is beautiful

72

Page 73: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Show me numbers

73

Page 74: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Links: imageshttp://abstrusegoose.com/432

http://camarenaphoto.tumblr.com/post/112238079516/its­life­jim­but­

not­as­we­know­it­spock

http://technology.ie/big­data­looks­like/

http://www.informationisbeautiful.net/visualizations/million­lines­of­

code/

http://githut.info/

http://emmanueloga.com/2013/10/07/Graphs­are­Everywhere­An­

overview­of­GraphConnect­San­Francisco­2013.html

••

••

••

74

Page 75: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Links: toolshttps://github.com/AlDanial/cloc

http://gource.io/

http://d3js.org/

http://visjs.org/

••••

75

Page 76: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Links: toolshttp://www.sonarqube.org/

https://www.atlassian.com/pt/software/fisheye/overview

http://jqassistant.org/

http://neo4j.com/

••••

76

Page 77: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Links: toolshttps://github.com/ThoughtWorksStudios/saikuro_treemap

https://www.youtube.com/watch?v=iiIytERhV9o••

77

Page 78: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Danke schön!78

Page 79: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Thank you!79

Page 80: About me...Most of the code bases are polyglot. Ratio between languages can tell a lot. Ratio between test code, comments, blank lines is also interesting. • • • 17. cloc 18

Questions?80