0                                                                                                                         ...
Software Quality –you know it when you see it          Erik Doernenburg           ThoughtWorks   @erikdoe // erik.doernenb...
3
Software QualityExternal perspective • Is the software of value to its users?Internal perspective • How appropriate is the...
30.000ft and ground level      http://opensimulator.org/wiki/Grid_Architecture_Diagrampg                                  ...
The 1000ft view     • Is   at the “right” level     • Aggregates             data and metrics     • Utilises       visuali...
Metrics    • lines of code    • method length    • class size    • cyclomatic complexity    • weighted methods per class  ...
More metrics     • duplication     • check-in counts     • coverage     • testability     • test/code ratio               ...
Metrics tree maps   Shows distribution of metrics   Created with checkstyle and InfoVis                                   ...
0.0                                                                                                                       ...
Size & complexity pyramid                         5.75 NOP          224                  6.13 NOC                1289     ...
0.80                                                                                               1.00                   ...
System complexity view    Part of Moose Technology    Polymetric view of class hierarchy                                  ...
CodeCity   Also part of Moose Technology   Polymetric views in 3D and more                                                ...
CodeCity continuedMight need a license for VisualWorks Smalltalk                                                 15
Dependency Structure Matrix   Not metrics based   Looks at “complex complexity”                                           ...
Test coverage   Not as a percentage, shows call graph   AspectJ + GraphViz                                                ...
DIY1. Get metrics   • SourceMonitor, checkstyle, text tools, etc   • iPlasma, et al2. Aggregate data   • Ruby scripts, uni...
How do you see quality?Comparisons• industry standards• different revisions: trends• different parts: outliersAesthetics• ...
What next?Measure• tech debt• effectiveness of trainingGuide• refactoring• clean-upCelebrate                              20
Thank youhttp://erik.doernenburg.com/topics/softvizhttp://97things.oreilly.com/wiki/index.php/Get_the_1000ft_viewhttp://ww...
Upcoming SlideShare
Loading in …5
×

ErikDoernenburg_SoftwareQualityYouKnowItWhenYouSeeIt

476 views
450 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
476
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ErikDoernenburg_SoftwareQualityYouKnowItWhenYouSeeIt

  1. 1. 0 10 20 30 40 50 60 SessionFactoryUtils AbstractBeanFactory BeanWrapperImpl DispatcherServlet SchedulerFactoryBean AntPathMatcher SQLErrorCodeSQLExceptionTranslator HibernateTemplate ReloadableResourceBundleMessageSource PropertiesBeanDefinitionReader StatementCreatorUtils LazyConnectionDataSourceProxy BooleanExpressionComplexity DefaultMessageListenerContainer JdoTransactionManager TopLinkTransactionManager ScriptFactoryPostProcessor TransactionAwareConnectionFactoryProxy NumberUtils HibernateAccessor SpringSessionSynchronization BeanDefinitionValueResolver ExtendedEntityManagerCreator ParameterMethodNameResolver ClassDataAbstractionCoupling MBeanClientInterceptor BeanFactoryAspectJAdvisorsBuilder CustomizableTraceInterceptor AbstractXsltView GenericCollectionTypeResolver ArgumentConvertingMethodInvoker SharedEntityManagerCreator FreeMarkerConfigurationFactory OC4JJtaTransactionManager ClassFanOutComplexity MockHttpServletRequest FrameworkPortlet ResourceArrayPropertyEditor AspectJWeaverMessageHandler MethodMapTransactionAttributeSource SingleConnectionFactory MessageListenerAdapter JdoTemplate CyclomaticComplexity FieldRetrievingFactoryBean VelocityView AbstractMessageListenerContainer SqlLobValue PortletRequestHandledEvent FileLength JdbcOperations TxAdviceBeanDefinitionParser ConnectorServerFactoryBean RefreshablePagedListHolder SqlMapClientTemplate MethodLength ClassUtils SystemPropertyUtils JmsTransactionManager DefaultBeanDefinitionDocumentReader TransactionAttributeEditor AbstractInterceptorDrivenBeanDefinitionDecorator NestedIfDepth ResultSetWrappingSqlRowSet HsqlMaxValueIncrementer AbstractSessionFactory AbstractPropertyAccessor LocalSlsbInvokerInterceptor BeansDtdResolver AnonInnerLength TransactionAwareDataSourceProxy PersistenceManagerFactoryUtils TomcatInstrumentableClassLoader LocalContainerEntityManagerFactoryBean AopNamespaceUtils JpaInterceptor HtmlCharacterEntityReferences ParameterNumber JdoInterceptor CciTemplate AspectJPrecedenceComparator AdvisedSupport OpenEntityManagerInViewFilter ScopedProxyBeanDefinitionDecorator ServletRequestAttributes ReflectiveVisitorHelper MissingSwitchDefault BeanDefinitionReaderUtils CustomEditorConfigurer AbstractBeanDefinitionReader ScopedProxyFactoryBean AbstractModelAndViewTests TreeWalker HessianServiceExporter MockPageContext CommonsLoggingLogSystem 0.80 1.00 1.20 1.40 1.60 1/4/06 15/4/06 29/4/06 1 13/5/06 27/5/06 10/6/06 2 24/6/06 8/7/06 22/7/06 5/8/06 19/8/06 2/9/06 3 16/9/06 30/9/06 14/10/06 28/10/06 3 3.05.1 11/11/06 Releases 25/11/06 9/12/06 23/12/06 4 6/1/07 5 20/1/07 3/2/07 6 Unit test LOC/LOC 17/2/07 3/3/07 7 17/3/07 31/3/07 Lines of unit test code per line of production code 8 9 14/4/07 10 28/4/07 12/5/07 26/5/07 11 12 13 9/6/07 14 23/6/07 15 7/7/07 16 21/7/07 17 4/8/07 18/8/071
  2. 2. Software Quality –you know it when you see it Erik Doernenburg ThoughtWorks @erikdoe // erik.doernenburg.com 2
  3. 3. 3
  4. 4. Software QualityExternal perspective • Is the software of value to its users?Internal perspective • How appropriate is the design? • How easy is it to understand and extend? • How maintainable is the software? 4
  5. 5. 30.000ft and ground level http://opensimulator.org/wiki/Grid_Architecture_Diagrampg 5
  6. 6. The 1000ft view • Is at the “right” level • Aggregates data and metrics • Utilises visualisation techniques • Makes every pixel count 6http://97things.oreilly.com/wiki/index.php/Get_the_1000ft_view
  7. 7. Metrics • lines of code • method length • class size • cyclomatic complexity • weighted methods per class • coupling between (object) classes ckjm 7http://www.campwoodsw.com/sourcemonitor.html
  8. 8. More metrics • duplication • check-in counts • coverage • testability • test/code ratio simian 8http://www.redhillconsulting.com.au/products/simian/
  9. 9. Metrics tree maps Shows distribution of metrics Created with checkstyle and InfoVis 9http://erik.doernenburg.com/2010/05/metrics-tree-maps/
  10. 10. 0.0 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 SessionFactory Utils.java AbstractBeanFactory .java BeanWrapperImpl.jav a DispatcherServ let.java SchedulerFactory Bean.java AntPathMatcher.jav a SQLErrorCodeSQLExceptionTranslator.jav a HibernateTemplate.jav a ReloadableResourceBundleMessageSource.jav a PropertiesBeanDef initionReader.jav a StatementCreatorUtils.java Lazy ConnectionDataSourceProxy .java BooleanExpressionComplexity Def aultMessageListenerContainer.java JdoTransactionManager.jav a TopLinkTransactionManager.jav a ScriptFactory PostProcessor.java TransactionAwareConnectionFactory Proxy.java NumberUtils.jav a HibernateAccessor.jav a SpringSessionSy nchronization.jav a BeanDef initionValueResolv er.java ExtendedEntity ManagerCreator.jav a ParameterMethodNameResolv er.java CallableStatementCreatorFactory.java BeanFactory AspectJAdvisorsBuilder.java CustomizableTraceInterceptor.jav a AbstractXsltView.jav a GenericCollectionTy peResolv er.java ArgumentConv ertingMethodInv oker.java SharedEntity ManagerCreator.jav a FreeMarkerConf igurationFactory.java SelectedValueComparator.jav a ClassDataAbstractionCoupling ClassFanOutComplexity MockHttpServ letRequest.java FrameworkPortlet.jav a ResourceArray Property Editor.java AspectJWeav erMessageHandler.java MethodMapTransactionAttributeSource.jav a SingleConnectionFactory .java MessageListenerAdapter.jav a JdoTemplate.jav a CyclomaticComplexity DataSourceUtils.java Velocity View.jav a Toxicity chart AbstractMessageListenerContainer.java SqlLobValue.jav a FileLength PortletRequestHandledEv ent.java JdbcOperations.jav a TxAdv iceBeanDef initionParser.java ArgTy pePreparedStatementSetter.jav a Ref reshablePagedListHolder.java AbstractJasperReportsSingleFormatView.java MethodLength ClassUtils.java SimpleMailMessage.jav a JmsTransactionManager.jav a TransactionAttributeEditor.jav a Def aultBeanDef initionDocumentReader.java NestedIfDepth AbstractInterceptorDrivenBeanDefinitionDecorator.java ResultSetWrappingSqlRowSet.jav a HsqlMaxValueIncrementer.jav a CodebaseAwareObjectInputStream.jav a AbstractSingletonProxy FactoryBean.java LocalSlsbInv okerInterceptor.java BeansDtdResolv er.java AnonInnerLength AbstractMessageSource.jav a AbstractDependency InjectionSpringContextTests.java TomcatInstrumentableClassLoader.java LocalContainerEntity ManagerFactoryBean.java ResourceEntity Resolver.javahttp://erik.doernenburg.com/2008/11/how-toxic-is-your-code/ Developed by ThoughtWorks using Excel RedirectView.jav a HtmlCharacterEntityReferences.java AbstractPathMapHandlerMapping.jav a AspectJPrecedenceComparator.java ResourceServ let.java Adv isedSupport.jav a EhCacheFactory Bean.java CustomCollectionEditor.java CommonsMultipartFile.jav a Provides easy to compare overview of quality OpenEntity ManagerInViewFilter.jav a TopLinkInterceptor.jav a MethodInv okingJobDetailFactoryBean.java Def aultNamespaceHandlerResolver.java XmlValidationModeDetector.jav a GenericFilterBean.jav a ParameterNumber MissingSwitchDefault TreeWalker HessianServ iceExporter.java Property AccessorUtils.java InstantiationModelAwarePointcutAdv isorImpl.java 10
  11. 11. Size & complexity pyramid 5.75 NOP 224 6.13 NOC 1289 5.69 NOM 7905 7905 NOM 2.79 0.26 LOC 44988 22039 CALLS 0.40 CYCLO 11602 8798 FANOUT Developed at Universities of Berne and Lugano Shows key metrics and their relationships Allows comparison to “industry standards” Created by iPlasma tool from source code 11http://loose.upt.ro/iplasma/http://www.intooitus.com/inFusion.html
  12. 12. 0.80 1.00 1.20 1.40 1.60 1/4/06 15/4/06 29/4/06 1 13/5/06 27/5/06 10/6/06 2 24/6/06 8/7/06 22/7/06 5/8/06 19/8/06 2/9/06 3 16/9/06 30/9/06 14/10/06 28/10/06 3 3.05.1 11/11/06 Releases 25/11/06 9/12/06 23/12/06 4 6/1/07 5 Created with Unix tools and Excel 20/1/07 3/2/07 Test to code ratio 6 Unit test LOC/LOC 17/2/07 Shows the test to code ratio over time 3/3/07 7 17/3/07 31/3/07 Lines of unit test code per line of production code 8 9 14/4/07 10 28/4/07 12/5/07 26/5/07 11 12 13 9/6/07 14 23/6/07 15 7/7/07 16 21/7/07 17 4/8/07 18/8/0712
  13. 13. System complexity view Part of Moose Technology Polymetric view of class hierarchy 13http://www.moosetechnology.org/http://www.inf.usi.ch/faculty/lanza/codecrawler.htmlhttp://sourceforge.net/projects/java2cdif/
  14. 14. CodeCity Also part of Moose Technology Polymetric views in 3D and more 14http://www.inf.usi.ch/phd/wettel/codecity-download.htmlhttp://erik.doernenburg.com/2009/07/moose-mse-for-java-and-cs/
  15. 15. CodeCity continuedMight need a license for VisualWorks Smalltalk 15
  16. 16. Dependency Structure Matrix Not metrics based Looks at “complex complexity” 16http://erik.doernenburg.com/2010/04/dependency-structure-matrix/
  17. 17. Test coverage Not as a percentage, shows call graph AspectJ + GraphViz 17http://erik.doernenburg.com/2008/09/call-graph-visualisation-with-aspectj-and-dot/
  18. 18. DIY1. Get metrics • SourceMonitor, checkstyle, text tools, etc • iPlasma, et al2. Aggregate data • Ruby scripts, unix tools, etc • VBA and pivot tables3. Render graphics • Excel is a powerful graphing tool • Gnuplot and InfoViz are easy to use 18
  19. 19. How do you see quality?Comparisons• industry standards• different revisions: trends• different parts: outliersAesthetics• symmetry• balance/harmony 19
  20. 20. What next?Measure• tech debt• effectiveness of trainingGuide• refactoring• clean-upCelebrate 20
  21. 21. Thank youhttp://erik.doernenburg.com/topics/softvizhttp://97things.oreilly.com/wiki/index.php/Get_the_1000ft_viewhttp://www.moosetechnology.org 21

×