Uma abordagem efetiva para melhoria contínua da qualidade de software
Roberto Pepato Mellado @rpepato
Gabriel Moreira @gspmoreira
James Q. Wilson
George L. Kelling
Maintainability
Analisability
Modificability
Stability
Testability
[ISO 9126 / 25000]
Software Maintainability Maintenance Effort and
Accuracy
Preventive
why?
[Kemerer et. Al, 1999]
[Jones, 2007]
[Bennet, 2002]
Not me!
Programmers are constantly in
maintenance mode “You are rarely writing original
code.” "I'm maintaining from day one." “It's only the first 10 minutes that the code's original, when you type it in the first time. That's it.”
Don’t Make This Common Mistake
Technical Debt
Quality or Fast Delivery?
It’s not my fault, but it is still my problem
Dreaming and Planning Software Quality for his next project
Dijkstra
is Watching
[design by Philip Calçado]
Formal Inspection
Lightweight Inspection
Next, please!
Static Code Analysis
What about tools?
http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
FxCop (.NET)
StyleCop (.NET)
Resharper (.NET)
NDepend (.NET)
JDepend (Java)
Find Bugs (Java)
CCFinder (C#, Java, C++, VB)
SimpleCov (Ruby)
SimpleCov (Ruby)
Metric-fu -- Churn (Ruby)
Metric-fu -- Flog(Ruby)
Metric-fu -- Reek(Ruby)
Metric-fu -- Stats(Ruby)
Metric-fu -- Hotspots(Ruby)
Continuous
Inspection
CI + SCA
Metrics
Bad Smells
Inspection
Refactoring
Continuous Improvement
Measure: Cyclomatic complexity Tools • JavaNCSS • PMD • NDepend Refactorings • Replace Conditional with
Polymorphism • Extract Method
Conditional Complexity
Duplicated Code
Measure: Code duplication Tools: CheckStyle, PMD Refactorings: • Extract Method • Pull Up Method • Form Template Method • Substitute Algorithm
Measure: Source lines of code (SLOC) Tool: PMD, JavaNCSS, CheckStyle Refactorings: Extract Method, Replace Temp with Query, Introduce Parameter Object, Preserve Whole Object, Replace Method with Method Object
Long Method / Class
Measure: Efferent coupling (fan-out per class) Tool: CheckStyle, NDepend Refactorings: • Move Method • Extract Class
Excessive Dependency
Inspection Automation in CI
<target name="inspect" >
<exec program="${tools.fxcop}"
commandline="/p:${reports.scripts}\Mineradores.fxcop /out:${reports.output}\ccnet-fxcop-results.xml" failonerror="false"/>
<exec program="${tools.stylecopcmd}"
commandline="-sf "${libandunittest.buildfile.path}\LibAndUnitTest.sln" -of "${reports.output}\ccnet-libstylecop-output.xml"" failonerror="false"/>
<exec program="${tools.ndepend}" failonerror="false">
<arg value="${reports.scripts}\Mineradores-NDepend.xml" />
<arg value="/OutDir "${reports.ndepend.output}"" />
</exec>
</target>
NDepend Report
NDepend Report
Combination from measures of attributes belonging to a software product, or to its development process, which shows quantitatively some of its characteristics.
Métricas de Produto OO
Tamanho
•LOC
•N. Métodos
•N. Atributos
Complexidade
•CC - Complexidade Ciclomática
•Métricas de Halstead
•MCD - Max Conditional Depth
•MLD - Max Loop Depth
•DD - Decision Density
Acoplamento
•AC – Aferent Coupling
•EC – Eferent Coupling
•ABC – Association Between Classes
Coesão
•LCOM – Lack of Cohesion Methods
•LCOM-HS - Lack of Cohesion Of Methods Henderson-Sellers
Herança
•NOC - Number of Children
•DIT - Depth of Inheritance Tree
Other Metrics
•Churn
•Program Vocabulary
•...
Software Product Metrics
How to Deal With Lots Of Data?
Metrics Analysis – Dashboards (Sonar)
Metrics Analysis – Temporal Series
Metrics Analysis - Control Charts
Metrics Analysis - OLAP
Metrics Analysis – Indicators from DW
Build Definition
Going Deeper
I need some help!
Roberto Pepato Mellado [email protected]
@rpepato
Gabriel Moreira [email protected]
@gspmoreira
http://workingsweng.wordpress.com/
19 e 20 de Agosto de 2011
http://www.agilevale.com.br/ @agilevale #agilevale
Top Related