Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.

Slides:



Advertisements
Similar presentations
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
Advertisements

Unit Tests DEFINITION AND OVERVIEW by Paul M. code of the damned. com.
QAAC 1 Metrics: A Path for Success Kim Mahoney, QA Manager, The Hartford
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
PS4: Test Driven Development Based on Test Driven Development by Example By Kent Beck.
SOLID Object Oriented Design Craig Berntson
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Software engineering for real-time systems
24/06/2015Dr Andy Brooks1 MSc Software Maintenance MS Viðhald hugbúnaðar Fyrirlestur 41 Maintainability of OSS OSS Open Source Software CSS Closed Source.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Systems Design. Analysis involves understanding and documenting user requirements in a clear and unambiguous way. It focuses on the business side and.
Chapter 13 & 14 Software Testing Strategies and Techniques
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
Continuous Integration and Testing
Building SOLID Software with Dependency Injection Jeremy Rosenberg.
S oftware Q uality A ssurance Part One Reviews and Inspections.
Validation Metrics. Metrics are Needed to Answer the Following Questions How much time is required to find bugs, fix them, and verify that they are fixed?
Prof. Mohamed Batouche Software Testing.
University of Sunderland CIFM03Lecture 4 1 Software Measurement and Reliability CIFM03 Lecture 4.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
© ALEXANDRE CUVA  VERSION 2.00 Test Driven Design.
1Software Measurement Advanced Software Engineering COM360 University of Sunderland © 2001.
Agenda Introduction Overview of White-box testing Basis path testing
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
T Iteration Demo Group name [PP|I1|I2] Iteration
 What is SOLID  The S in SOLID  The O in SOLID  The L in SOLID  The I in SOLID  The D in SOLID  Questions.
T Project Review (Template for PI and I1 phases) Group name [PI|I1] Phase
Test-Driven Development Eduard Miric ă. The problem.
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Five design principles
Ivar Jacobson, Grady Booch, and James Rumbaugh The Unified Software Development Process Addison Wesley, : James Rumbaugh's OOMD 1992: Ivar Jacobson's.
Theory and Practice of Software Testing
Software Engineering Principles Practical Advice and Steps for Managing Your Project.
T Iteration Demo Group name [PP|I1|I2] Iteration
SOLID Design Principles
Session 33 More on SOLID Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench.
Engineering Practices Necessary for Scrum andrew fuqua enterprise agile coach LeadingAgile, LLC
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
T Project Review RoadMappers I2 Iteration
CS223: Software Engineering Lecture 21: Unit Testing Metric.
More SQA Reviews and Inspections. Types of Evaluations  Verification Unit Test, Integration Test, Usability Test, etc  Formal Reviews  aka "formal.
Liskov Substitution Principle Jon McBee CLA, CLED, CTD, CPI, LabVIEW Champion.
Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Beginning Software Craftsmanship Brendan Enrick Steve Smith
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Testing under the Agile Method CSCI 521 Software Project Management based on the book Testing Extreme Programming by Lisa Crispin and Tip House.
Mantas Radzevičius ifm-2/2
Software Testing.
Software Testing.
Software Engineering (CSI 321)
Copyright © by Curt Hill
CPSC 873 John D. McGregor GQM.
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
Software testing strategies 2
Software Testing (Lecture 11-a)
CS 190 Lecture Notes: Wrapup
Test Driven Development
Software Testing “If you can’t test it, you can’t design it”
The SOLID Principles.
A (partial) blueprint for dealing with change
Continuous Integration
1. Cyclomatic complexity
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.

Achieving Zero Defects Is it possible?

Achieving Zero Defects Why is this so important?

What is Clean Code? Clean code is simple and direct. Clean code reads like well-written prose. -Grady Booch

Clean Code Basics Clear & Consistent Naming Avoid using Comments Keep functions less than 10 lines

Four Simple Rules Pass All Tests Clear, Expressive, & Consistent Duplicates No Behavior Or Configuration Minimal Methods, Classes, & Modules -Kent Beck

Test Driven Development Red Green Refactor

Test Driven Development Red Green Refactor

Test Driven Development You should have > 80% Coverage. If you don’t have at least 80%, try harder.

Code of Conduct 1.Only Ship Quality Software 2.Stable Productivity 3.Inexpensive Adaptability 4.Continuous Improvement 5.Fearless Competence 6.Extreme Quality

Code of Conduct 7.QA Will Find Nothing! 8.Automation 9.Honest Estimates 10.Say No When We Can't Commit 11.Continuous Aggressive Learning 12.Mentor Each Other 13.Not Be A Knowledge Silo

Accountability & Code Analysis Code Analysis can detect problem areas Continuous Integration and Code Analysis together provide an automated process to gain code metrics. Facilitates peer review

Project Code Analysis

Cyclomatic Complexity The count of the number of linearly independent paths through the source code M = E − N + 2P E=the number of edges of the graph N=the number of nodes of the graph P=the number of connected components *Source: Wikipedia

Cyclomatic Complexity AKA: The canary in the coal mine Any function with a complexity greater than 8 should be re-evaluated.

SOLID Principles The S ingle Responsibility Principle A class should have one, and only one, reason to change. The O pen Closed Principle You should be able to extend a classes behavior, without modifying it. The L iskov Substitution Principle Derived classes must be substitutable for their base classes. The I nterface Segregation Principle Make fine grained interfaces that are client specific. The D ependency Inversion Principle Depend on abstractions, not on concretions.

Customizing Alfresco ActionExecutor classes Web Scripts Task Listeners Custom Service Classes

Customizing Alfresco ActionExecutor classes Web Scripts Task Listeners Custom Service Classes

Maintain Metrics Estimates to Actuals Coverage Complexity Violations Bugs Logged

The Big Picture Evangelize An Ethos of Craftsmanship and Accountability

In Summary The only way to go fast, is to go well. -Uncle Bob Martin

Resources Related Blog Posts