Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Semi-Automatic Evaluation of Free and Open Source Software Quality Paulo Meirelles Fabio Kon IME-USP and OSI from Paulo Meirelles,

Similar presentations


Presentation on theme: "1 Semi-Automatic Evaluation of Free and Open Source Software Quality Paulo Meirelles Fabio Kon IME-USP and OSI from Paulo Meirelles,"— Presentation transcript:

1 1 Semi-Automatic Evaluation of Free and Open Source Software Quality Paulo Meirelles Fabio Kon fabio.kon@ime.usp.br IME-USP and OSI from Paulo Meirelles, Antonio Terceiro, João Machini, and Fabio Kon previous slides. It is licensed under a Creative Commons Atribuição 2.5 Brasil License Creative Commons Atribuição 2.5 Brasil License

2 2 ● Ph.D Student at CCSL- IME-USP ● Visiting researcher at SIUC (USA) ● Free Software Communities: ● PSL-RN and ASL.org ● Analizo, Kalibro, and Noosfero (Mezuro)

3 3 What is Quality?

4 4

5 5 What is Software Quality?

6 6 Quality is a perception... User: ● Featues, no bugs, short releases, performance...

7 7 Quality is a perception... Developers: ● Clean code, flexibility, modularity, automated tests, etc

8 8 What is Software Development? ● Modeling (Jacobsen) ● Engineering (Meyer) ● Discipline (Humphreys) ● Poetry (Cockburn) ● Craft(Knuth) ● Art(Gabriel) ● Science(Jain) source: from Alistair Cockburn

9 An important aspect of software development is neglected in some software engineering communities...

10 We should look at the most important deliverable on a software project: The Code

11 “Show me the Code!” from the free software communities...

12 Show me a Beautiful and Clean Code ! We want more...

13 13 Beautiful Code ● brings pleasure to the reader ● makes the writer happy ● makes working in groups fun

14 14 Beautiful Code ● fewer bugs ● maintainability ● team productivity

15 15 Beauty is fundamental vinicius de morais In Software Development, Beauty Leads to Quality

16 16 Bjarne Stroustrup Inventor of C++ What is Clean Code? “I like my code to be elegant and efficient. The logic should be straighforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy, and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. Clean code does one thing well.”

17 17 Grady Booch Author of Object Oriented Analysis and Design with Applications What is Clean Code? “Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer's intent but rather is full of crisp [clearly defined] abstractions and straighforward lines of control.”

18 18 Dave Thomas Founder of OTI, godfather of the Eclipse Strategy What is Clean Code? “Clean code can be read, and enhanced by a developer other than its original author. It has unit and acceptance tests. It has meaningful names. It provides one way rather than many ways for doing one thing. It has minimal dependencies, which are explicitly defined, and provides a clear and minimal API. Code should be literate since depending on the language, not all necessary information can be expressed clearly in code alone.”

19 19 Michael Feathers Author of Working Effectively With Legacy Code What is Clean Code? “I could list all of the qualities that I notice in clean code, but there is one overarching quality that leads to all of them. Clean code always looks it was written by someone who cares. There is nothing obvious that you can do to make it better. All of those things were thought about by the code's author, and if you try to imagine improvements, you're led back to where you are, sitting in appreciation of the code someone left for you – code left by someone who cares deeply about the craft.”

20 20 Ron Jeffries Author of Extreme Programming Installed What is Clean Code? “In recent years I begin, and nearly end, with Beck's rules of simple code. In priority order, simple code: ● Runs all tests ● Contains no duplication ● Expresses all the design ideas that are in the system ● Minimizes the number of entities such as classes, methods, functions, and the like.”

21 21 Ward Cunningham Inventor of Wiki, Fit and much more ”Godfather of all those who care about code” What is Clean Code? You know you are working on clean code when each routine you read turns out to be pretty much what you expected. You can call it beautiful code when the codes also makes it look like the language was made for the problem.”

22 22 Simple Straightforward Efficient Expressive Runs all tests Literal Turns out to be what you expected Minimal Contains no duplications Full of meaning Without obvious improvements Written by someone who cares Reads well Beautiful: when the language was made for the problem What is Clean Code?

23 23 What is Clean Code? ● Meaningful Names ● Code is basically names and reserved words ● Choosing good names takes time but saves more than it takes ● Names should be expressive and should answer questions

24 24 What is Clean Code? ● Functions should be small! ● Functions that do one thing can't be divided into sections ● Functions should do one thing ● Functions should do it well ● Functions should do it only ● One level of abstractionuments

25 25 What is Clean Code? ● Functions should minimize the number of arguments ● don't use flag arguments ● Functions should not have side effects ● Don't Repeat Yourself (DRY) ● duplication is the root of all evil in software

26 Functions should be short, well named and nicely organized

27 in the end Code is the only truth There are other clean code attributes... (ask us for a detailed technical report if you're interested)

28 Source Code Metrics

29 29 Size

30 30 Cohesion

31 31 Coupling

32 Clean Code Concepts to Source Code Metrics We are mapping...

33 33 Ex: Clean Code → Metrics ● Clean code problem ● Large methods ● Source code metrics ● Maximum Nesting Level (MaxNesting), Lines of Code (LOC), and Cyclomatic Complexity (MacCabe)

34 34 Ex: Clean Code → Metrics ● Clean code problem ● high coupling, lack of flexibility ● Source code metrics ● Number of External Calls (NEC) and Number of Called Classes (NCC)

35 Source Code quality influences FLOSS Attractiveness

36 “Given enough eyeballs, all bugs are shallow”

37 Attractiveness is the capacity of bringing users and developers to a project

38 38 Attractiveness (I)

39 39 Attractiveness (II)

40 40 Source Code → Attractiveness 18%12% 6.773 C projects analyzed (from sourceforge.net) a detailed scientific paper is available in our web site

41 41 Attractiveness (III) It is being selected according to the mapping between clean code concepts and source code metrics

42 ~ 42.000 Source Forge projects (C, C++, and Java) At this moment, we are downloading...

43 43 How? SF-Downloads $ git clone git://gitorious.org/sf-explorer/sf- downloads.git $ cd sf-downloads $./sf-downloads project_list.csv... $ apt-get install analizo... $ analizo metrics-batch -s metrics_dataset.csv project_list.csv (unixname, scm) metrics.csv

44 Analizo Toolkit

45 45 Analizo Toolkit

46 46 Analizo Toolkit metrics, metrics-bach, metrics-history graph, evolution-matrix

47 47 Analizo Toolkit metrics, metrics-bach, metrics-history, graph, evolution-matrix Doxyparse, Sloccount

48 48 Analizo Toolkit metrics, metrics-bach, metrics-history, graph, evolution-matrix Doxyparse, Sloccount 24 source code metrics

49 49 Analizo Toolkit metrics, metrics-bach, metrics-history, graph, evolution-matrix Doxyparse, Sloccount 24 source code metrics YAML, Graphviz

50 50 Analizo Toolkit

51 Kalibro Metrics

52 52 Kalibro Metrics ● Download source code from SVN, Git, or Mercurial repositories ● Download source code from local and remote zip and tarball files ● Creation of quality evaluation configurations

53 53 Kalibro Metrics ● Creation of ranges ● Creation of new metrics ● Computation of statistical results

54 54 Kalibro Metrics ● Exports results to a CSV file ● Cross-project comparisons ● grades are given for each project based on a configurable combination of metrics ● User-friendly visualization by associating colors with ranges

55 55

56 Kalibro Desktop

57 57 Main window

58 58 Settings Edit settings

59 59 Settings options

60 60 Metrics configuration Kalibro has a default configuration according to thresholds defined in the Qualipso project, but you can create a new set of thresholds or create compound metrics

61 61 Configuration description

62 62 Adding a new metric a compound metric

63 63 Defining thresholds An interpretation of a threshold can be added to explain what a metric means within a specific range

64 64 Thresholds added Multiple thresholds can be added

65 65 Creating a Kalibro project

66 66 Defining a Kalibro project

67 67 Analyzing source code

68 68 Open Project

69 69 Global project results...

70 70 Analyzed 148,593 lines of code...... in 10 min. and 35 seg.

71 71 Choose a configuration: a set of thresholds

72 72

73 73 By package

74 74 By class/module:.java,.c, or.cpp files

75 Kalibro for QualiPSO Kalibo Service → Spago4Q

76 76 Qualipso Platform Integration Quality Platfor m Kalibro Kalibro Desktop WS Code repository Kalibro Core Projects, Configuration s and Results

77 77

78 78 Spago4Q

79 79 Spago4Q Threshols for C/C++ projects from USP research

80 our current work... Mezuro source code tracking network

81 81 Plug-in for Noosfero Social network platform

82 82

83 83

84 84 Get Involved Community: softwarelivre.org/mezuro community.qualipso.org/kalibro Mailling list: mezuro@listasmezuro@listas.softwarelivre.org Network: http://mezuro.orghttp://mezuro.org (2012)

85 85 Our tools are Free Software SF-Downloads Source code (LGPL): gitorious.org/sf-explorer/sf-downloads analizo.org Source code (GPL V3): gitorious.org/analizo

86 86 Our tools are Free Software mezuro.org Source code (AGPL V3): gitorious.org/+mezuro/noosfero/mezuro-noosfero kalibro.org Source code (LGPL): gitorious.org/kalibro

87 87 Contacts at IME/USP Paulo Meirelles paulo@softwarelivre.org Prof. Fabio Kon fabio.kon@ime.usp.br Centro de Competência em Sofware Livre ccsl@ime.usp.br

88 88 License of this Document


Download ppt "1 Semi-Automatic Evaluation of Free and Open Source Software Quality Paulo Meirelles Fabio Kon IME-USP and OSI from Paulo Meirelles,"

Similar presentations


Ads by Google