Upload
kurtis-kemple
View
226
Download
0
Embed Size (px)
Citation preview
ENTERPRISE NODECODE QUALITY
ABOUT ME
Tech Lead @ MLS
Medium: @kurtiskempleTwitter: @kurtiskemple
GitHub: @kkemple
3
REPO FOR THIS WEBINARKKEMPLE/AWESOME-ENTERPRISE-WEB-SERVICE
WHY IS CODE QUALITY IMPORTANT?
BENEFITS
• Prevents Entropy
• Improves Velocity
• Increases Developer Morale
WHAT DEFINES QUALITY CODE?
THE THREE Cs OF CODE QUALITY
• Clarity
• Complexity
• Coverage
CLARITY
WHAT DOES CLARITY MEAN?
• Code Is Formatted Well
• Code Is Cohesive (Things that belong together are
together)
• Variable and Function Names Give Context
COMPLEXITY
“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.”
http://blog.codeclimate.com/blog/2013/12/12/the-roots-of-static-analysis/
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…)
COVERAGE
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.
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
SETTING STANDARDS
BIKESHEDDING
or Parkinson’s Law of Triviality…https://en.wikipedia.org/wiki/Law_of_triviality
PICKING A STANDARD
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!
INTEGRATING STANDARDS INTO YOUR WORKFLOW
CODE CLIMATE
HOUND CI
CODECOV
Q&A
• 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
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