Cheatography
https://cheatography.com
Building great software is more than just writing code. Here are a collection of tools and best practices specifically drawn from my experience developing ruby applications for the last 15 years.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Linters
|
Commit linter configuration to project repo for the team to share. |
|
Code Quality : Static Analyzers
|
Static analysis of code quality, SaaS |
|
Comprehensive static analysis of code quality, can run locally |
|
Ruby static analysis gem |
|
Code style analysis & feedback, can integrate with IDE |
|
Static analysis for lots of languages |
|
Check the quality of your Ruby on Rails code |
Pull Requests
PRs should be as small and incremental as possible |
Include screenshots / animations when appropriate |
All CI tests should pass prior to assigning reviewers |
Don't take feedback personally! Receiving and learning from criticism is one of the best ways to become a better software developer. |
|
|
Security
|
Integrate static analysis security tools into CI. Dependency auditing is an easy place to start. Enable Github's Dependabot. |
|
Always require SSL. Let's Encrypt provides free, secure certificates. |
|
Testing
Unit Tests : test the output of a single given state |
Functional Tests : test the output of changes to state |
Integration Tests : test the results of cross-service interactions from the user's perspective. Use Cypress. |
Implement continuous integration, which runs all tests, performs static analysis, and automates security audits. |
Ensure that test coverage is over 95%. |
Performance
Identify and eliminate N+1 queries. bullet is helpful. |
|
Ensure that GZIP / HTTP Deflate are enabled and properly configured. |
Use Rails caching. It includes easy-to-implement patterns for lots of different types of caching. |
|
|
Documentation
README.md
must include these sections: Summary, Prerequisites, Infrastructure, ENV Variables, Cron, Gotchas |
|
|
Provide well-formatted and sensical seed data. |
Diagram complex processes. Whimsical is great for this. |
APIs should have comprehensive Swagger documentation. |
Frontends should have wireframes prior to writing code. |
Pivotal / Jira stories document application evolution. |
Always consider the perspective of a developer who has never touched this project, but needs to rescue it because you’re on vacation.
|