Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Sonar Code Quality Testing Essentials

You're reading from  Sonar Code Quality Testing Essentials

Product type Book
Published in Aug 2012
Publisher Packt
ISBN-13 9781849517867
Pages 318 pages
Edition 1st Edition
Languages
Author (1):
Charalampos S Arapidis Charalampos S Arapidis
Profile icon Charalampos S Arapidis

Table of Contents (18) Chapters

Sonar Code Quality Testing Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
1. Preface
1. An Overview of Sonar 2. Installing Sonar 3. Analyzing your First Project 4. Following Coding Standards 5. Managing Measures and Getting Feedback 6. Hunting Potential Bugs 7. Refining Your Documentation 8. Working with Duplicated Code 9. Analyzing Complexity and Design 10. Code Coverage and Testing 11. Integrating Sonar Sonar Metrics Index

Architecture of Sonar


The core engine of the platform, Squid, is supported by additional code analyzers which Sonar orchestrates together to measure quality.

The following diagram represents the upper-level components of the platform and how they interact with each other:

  1. 1. An analysis request is triggered using one of three possible methods:

    • Maven Plugin

    • Ant Task

    • Java Runner

  2. 2. Sonar receives the request and starts analyzing the project's source code. The analysis is based on the project's Sonar profile activating any additional plugins or reporting capabilities, if any.

  3. 3. When the analysis is over, results are stored to a database for future reference and history tracking.

  4. 4. Finally, the user interface and its components are updated with the new data. You can access data from your browser and the web dashboard. Conveniently, Sonar reporting is also made available within your IDE, either Eclipse or IDEA, allowing you to review and correct code violations on the spot.

In a continuously integrated environment, the analysis process is triggered by the build server. The server checks out source code from the repository, compiles and executes all unit or integration tests, after which it produces the necessary builds. Finally, Sonar takes over analyzing the source. A good practice for a time-consuming process such as this is to trigger it once a day, when developers are inactive. The process is then called a nightly job and the final build produced a nightly snapshot. Next time, developers will have access to the latest data and reports about the project, enabling them to review how recent changes affected the overall quality of the project.

You have been reading a chapter from
Sonar Code Quality Testing Essentials
Published in: Aug 2012 Publisher: Packt ISBN-13: 9781849517867
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}