Book description
"Achieve higher levels of Software Quality with Sonar with this book and ebook.
- Take full advantage of the Sonar platform and its visual components to track code quality and defects.
- Create step by step software quality profiles that match your needs
- Real world examples that use Sonar efficiently to assess quality and improve Java code
In Detail
Sonar is an open source platform used by development teams to manage source code quality. Sonar has been developed with this main objective in mind: make code quality management accessible to everyone with minimal effort. As such, Sonar provides code analyzers, reporting tools, manual reviews, defect-hunting modules, and TimeMachine as core functionalities. It also comes with a plugin mechanism enabling the community to extend the functionality, making Sonar the one-stop-shop for source code quality by addressing not only the developer’s requirements, but also the manager’s needs.
The "Sonar Code Quality Testing Essentials" book will help you understand the different factors that define code quality and how to improve your own or your team's code using Sonar.
You will learn to use Sonar effectively and explore the quality of your source code in the following axes:
- Coding Standards
- Documentation and Comments
- Potential Bugs and Defects
- Unit Testing Coverage
- Design and Complexity
Through practical examples, you will customize Sonar components and widgets to identify areas where your source code is lacking. The book goes down to proposing good practices and common solutions that you can put to use to improve such code.
You will start with installing and setting up a Sonar server and performing your first project analysis. Then you will go through the process of creating a custom and balanced quality profile exploring all Sonar components through practical examples. After reading the book, you will be able to analyze any project using Sonar and know how to read and evaluate quality metrics.
Hunting potential bugs and eliminating complexity are the hottest topics regarding code quality. The book will guide you through the process of finding such problematic areas, leveraging and customizing the most appropriate components. Knowing the best tool for each task is essential. While you improve code and design through the book, you will notice that metrics go high and alerts turn green. You will use the Time Machine and the Timeline to examine how your changes affected the quality.
"Sonar Code Quality Testing Essentials" will enable you to perform custom quality analysis on any Java project and quickly gain insight on even large code bases, as well as provide possible solutions to code defects and complexity matters.
Table of contents
-
Sonar Code Quality Testing Essentials
- Table of Contents
- Sonar Code Quality Testing Essentials
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. An Overview of Sonar
-
2. Installing Sonar
- Prerequisites for Sonar
- Downloading Sonar
- Installing the Sonar web server
- Configuring MySQL
- Starting Sonar as a service
- Logging in to Sonar for the first time
- Securing your Sonar instance
- Creating users and groups
- Backing up your data
- Extending Sonar with plugins
- Upgrading Sonar from the Update Center section
- Summary
- 3. Analyzing your First Project
-
4. Following Coding Standards
- A brief overview of coding standards and conventions
- Sonar profiles, rules, and violations
- Managing quality profiles
- Managing rules
- Creating a coding standards profile
- 5. Managing Measures and Getting Feedback
-
6. Hunting Potential Bugs
-
Potential bugs violations
-
Dodgy code rules
- Use notifyAll instead of notify
- StringBuffer instantiation with char
- Use StringBuffer for String appends
- Constructor calls overridable method
- Close Resource
- Ambiguous invocation of either an inherited or outer method
- Consider returning a zero length array rather than null
- Method ignores return value
- Method does not release lock on all paths
- Null pointer dereference
- Suspicious reference comparison
- Misplaced null check
- Impossible cast
- Program flow rules
- Security rules
-
Dodgy code rules
- Installing the Violation Density plugin
- Integrating Sonar to Eclipse
- Summary
-
Potential bugs violations
- 7. Refining Your Documentation
- 8. Working with Duplicated Code
- 9. Analyzing Complexity and Design
- 10. Code Coverage and Testing
- 11. Integrating Sonar
- A. Sonar Metrics Index
- Index
Product information
- Title: Sonar Code Quality Testing Essentials
- Author(s):
- Release date: August 2012
- Publisher(s): Packt Publishing
- ISBN: 9781849517867
You might also like
book
Infrastructure as Code, 2nd Edition
Six years ago, Infrastructure as Code was a new concept. Today, as even banks and other …
book
Certified Kubernetes Application Developer (CKAD) Study Guide
Exclusively on O'Reilly: Get more hands-on training and test your CKAD exam readiness by working through …
video
DevOps with GIT(Flow) Jenkins, Artifactory, Sonar, ELK, JIRA
This course teaches on how to build DevOps environment for organizations. This identifies DevOps toolchain fit …
book
Full Stack Testing
Testing is a critical discipline for any organization looking to deliver high-quality software. This practical book …