Transcript
Page 1: Automating Code Reviews for Salesforce Apps

AUTOMATING CODE REVIEWS FOR SALESFORCE APPS

LORENZO FRATTINI

Page 2: Automating Code Reviews for Salesforce Apps

ABOUT ME

LORENZO FRATTINI

▸ Not very photogenic

▸ Salesforce Certified Technical Architect

▸ 10+ years experienced in Professional Services

▸ Strong focus on Agile & DevOps

▸ Based in London, UK

▸ Creator of Clayton.io

Page 3: Automating Code Reviews for Salesforce Apps

ON TWITTER @LOFRATTINI

Page 4: Automating Code Reviews for Salesforce Apps

AS A TECHNICAL ARCHITECT, WHAT’S THE #1 THING YOU DO ON ANY PROJECT?

Page 5: Automating Code Reviews for Salesforce Apps

PUT CODE REVIEWS IN PLACE.MY ANSWER NORMALLY IS

Page 6: Automating Code Reviews for Salesforce Apps

CODE REVIEWS

BENEFITS OF CODE REVIEWS

▸ Enforce standards, promote internal consistency

▸ Make your code better

▸ Early issue detection

▸ Simple, yet very effective

▸ Slowly erode your technical debt

▸ Promote a culture in which code quality matters

Page 7: Automating Code Reviews for Salesforce Apps

CODE REVIEWS

HOW TO DO CODE REVIEWS?

▸ Use a checklist

▸ Simple Git workflow

▸ Build your feature on a branch

▸ Pull request

▸ Comments on the pull request diff

My code review checklist available at https://github.com/eroispaziali/force-code-review-checklists

Page 8: Automating Code Reviews for Salesforce Apps

CAN CODE REVIEWS BE AUTOMATED?

IDEA

Page 9: Automating Code Reviews for Salesforce Apps

AUTOMATING CODE REVIEWS

CLAYTON: IN A NUTSHELL

▸ Connects to GitHub or Bitbucket and acts as a gatekeeper to block bad code from slipping into your repository

▸ 100% cloud based, nothing to install

▸ Configure your own standards

▸ A code review is triggered every time a pull request is created/updated

▸ Review completed in seconds with pass-or-fail result

▸ Inline comments on the diff

Page 10: Automating Code Reviews for Salesforce Apps

CLAYTON.IODEMO

Page 11: Automating Code Reviews for Salesforce Apps

CLAYTON

SOME RESULTS

▸ First prototype presented at Dreamforce 16, now available to the public

▸ 27 million lines reviewed

▸ It works! The project on the right is an AppExchange product

▸ ~500,000 lines of code

▸ ~10 pull requests per day (average)

▸ 20 active developers

▸ From 7% to 1% defect density in 2 months

Page 12: Automating Code Reviews for Salesforce Apps

CLAYTON

SOME FEATURES

▸ GitHub and Bitbucket

▸ Detects and reviews Apex

▸ Support for teams

▸ Insights

▸ Historic issue distribution

▸ Track team quality of contributions, per project

▸ On the roadmap

▸ Visualforce

▸ Lightning

▸ Dynamic Code Analysis

Page 13: Automating Code Reviews for Salesforce Apps

GET INVOLVED

ARE YOU INTERESTED?

▸ Reach out on Twitter @lofrattini

▸ Try Clayton! Go on www.clayton.io and create an account

▸ Share your feedback and suggestions


Recommended