Development
tools
Development tools
Continuous integration (CI)
Code coverage
Code formatter
Static code analysis tools
Git hooks
What is CI?
Continuous Integration is a software development practice where members of a team integrate
their work frequently, usually each person integrates at least daily - leading to multiple
integrations per day. Each integration is verified by an automated build (including test) to detect
integration errors as quickly as possible.
- Martin Fowler
Good practices of CI
- Maintain a single source repository.
- Automate the Build
- Make the Build self-testing
- Everyone commits to the mainline every day
- Every commit should build the mainline on an integration machine
- Fix broken Builds immediately
- Keep the Build fast
- Test in a clone of the production environment
- Make it Easy for Anyone to Get the Latest Executable
- Everyone can see what's happening
- Automate Deployment (CD)
CI tools
Jenkins Travis CI TeamCity
Circle CI GitLab CI/CD Github Actions
What is code coverage?
Code coverage is a metric used to understand how much of the source code is tested.
How is code coverage
calculated?
- Function coverage
- Statement coverage
- Branches coverage
- Condition coverage
- Line coverage
Code format
All the code should have the same format:
- Indentation
- Spaces
- Lines breaks
- Comments style
- Etc.
Why?
It should be automatic.
Some code formatting tools
Java
- Google java format
https://github.com/google/google-java-format
JavaScript
- Prettier https://prettier.io
Scala
- Scalafmt https://scalameta.org/scalafmt/
Kotlin
- Klint https://ktlint.github.io
What is static code analysis ?
Static code analysis is a method of debugging by
examining source code before a program is run. It’s done
by analyzing a set of code against a set (or multiple sets) of
coding rules.
Static code analysis
tools
Multi language
- Sonarqube https://www.sonarqube.org
JavaScript
- ESlint https://eslint.org
Java
- Checkstyle https://checkstyle.org/checks.html
Kotlin
- Detekt https://detekt.dev
- Klint https://ktlint.github.io
Git hooks
Git hooks are scripts that run automatically every time a particular event occurs in a Git
repository. They let you customize Git’s internal behavior and trigger customizable actions at
key points in the development life cycle.
Some uses:
- Enforce the organization’s standard git conventions
- Check if commit messages fulfill a standard
- Check commit author’s
- Branch protection
- Run tests before committing
- Preprocess code before committing
- Run Build
References
- Continuous integration:
- https://www.martinfowler.com/articles/continuousIntegration.html
- Code coverage:
- https://www.atlassian.com/continuous-delivery/software-testing/code-coverage
- Static code analysis:
- https://www.perforce.com/blog/sca/what-static-analysis
- https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
- Git hooks:
- https://www.atlassian.com/git/tutorials/git-hooks
- https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks