enterprise node - code quality

28
ENTERPRISE NODE CODE QUALITY

Upload: kurtis-kemple

Post on 13-Apr-2017

226 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Enterprise Node - Code Quality

ENTERPRISE NODECODE QUALITY

Page 2: Enterprise Node - Code Quality

ABOUT ME

Tech Lead @ MLS

Medium: @kurtiskempleTwitter: @kurtiskemple

GitHub: @kkemple

Page 3: Enterprise Node - Code Quality

3

REPO FOR THIS WEBINARKKEMPLE/AWESOME-ENTERPRISE-WEB-SERVICE

Page 4: Enterprise Node - Code Quality

WHY IS CODE QUALITY IMPORTANT?

Page 5: Enterprise Node - Code Quality

BENEFITS

• Prevents Entropy

• Improves Velocity

• Increases Developer Morale

Page 6: Enterprise Node - Code Quality

WHAT DEFINES QUALITY CODE?

Page 7: Enterprise Node - Code Quality

THE THREE Cs OF CODE QUALITY

• Clarity

• Complexity

• Coverage

Page 8: Enterprise Node - Code Quality

CLARITY

Page 9: Enterprise Node - Code Quality
Page 10: Enterprise Node - Code Quality

WHAT DOES CLARITY MEAN?

• Code Is Formatted Well

• Code Is Cohesive (Things that belong together are

together)

• Variable and Function Names Give Context

Page 11: Enterprise Node - Code Quality

COMPLEXITY

Page 12: Enterprise Node - Code Quality

“Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code.”

Page 14: Enterprise Node - Code Quality

WHY IS MEASURING COMPLEXITY IMPORTANT?

• It identifies tightly coupled sections of your application

• It identifies methods that might not be clear due to

excessive logic

• It helps identify trends (developer fatigue, tech-debt,

etc…)

Page 15: Enterprise Node - Code Quality

COVERAGE

Page 16: Enterprise Node - Code Quality

COVERAGE !== QUALITY

It’s important to note that a high coverage score is not equivalent to a quality test suite. However, it does show parts of your application that have no tests.

Page 17: Enterprise Node - Code Quality

WHY IS COVERAGE IMPORTANT?

• It identifies areas of the application that are not tested

• It identifies trends in test/code addition ratios

• It helps instill confidence in the application

Page 18: Enterprise Node - Code Quality

SETTING STANDARDS

Page 19: Enterprise Node - Code Quality

BIKESHEDDING

or Parkinson’s Law of Triviality…https://en.wikipedia.org/wiki/Law_of_triviality

Page 20: Enterprise Node - Code Quality

PICKING A STANDARD

Page 21: Enterprise Node - Code Quality

ENFORCING THE STANDARD

• Linting should be run during development (editor

plugins, watching files, etc)

• Linting should break your build when it fails!

• Broken builds should never be merged!

Page 22: Enterprise Node - Code Quality

INTEGRATING STANDARDS INTO YOUR WORKFLOW

Page 23: Enterprise Node - Code Quality

CODE CLIMATE

Page 24: Enterprise Node - Code Quality

HOUND CI

Page 25: Enterprise Node - Code Quality

CODECOV

Page 26: Enterprise Node - Code Quality

Q&A

Page 27: Enterprise Node - Code Quality

• Enterprise Node.js - Code Qualityhttps://www.crowdcast.io/e/enterprise-node-1

• Enterprise Node.js - Code Discoveryhttps://www.crowdcast.io/e/enterprise-node-2

• Enterprise Node.js - Securing Your Environmenthttps://www.crowdcast.io/e/enterprise-node-3

• Enterprise Node.js - Deploying with Dockerhttps://www.crowdcast.io/e/enterprise-node-4

27

ENTERPRISE NODE.JS

Page 28: Enterprise Node - Code Quality

JavaScript is replacing Java, Ruby, and .NET as the technology of choice for companies that want to build enterprise software faster, and with fewer resources. Learn about enterprise JavaScript applications at every level of the stack. As well as how to secure, integrate, test, store, monitor, and deploy them.

O’REILLY SOFTWARE ARCHITECTURE CONFERENCEArchitecting For Enterprise in Node.js