> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/intro-to-sealights/technical-overview/new-coverage-calculation-options.md). Agents can also search and read this documentation through its [MCP server](https://docs.sealights.io/knowledgebase/~gitbook/mcp).

# New Coverage Calculation Options

{% hint style="info" %}
Technology compatibility:

* **Java:** Supported from version 4.0.2531 onwards.
  {% endhint %}

SeaLights is excited to announce two groundbreaking additions to your code coverage analysis toolkit: Advanced Method Coverage and Line Level Coverage. These features offer an unparalleled level of granularity, empowering you to assess how effectively your tests exercise your codebase.

<figure><img src="https://1255034336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxSagdStwf6CJ9cI6lA68%2Fuploads%2FQiaQQDNPdvhlMfV4Cdj8%2FScreenshot%202024-07-04%20at%2013.07.38.png?alt=media&amp;token=3bc50f1b-7dc5-44f7-a9cd-2131e6dd0d0d" alt="" width="354"><figcaption><p>New Calculation for SeaLights Coverage Metrics </p></figcaption></figure>

### **Advanced Method Coverage**

Advanced Method Coverage goes beyond the basic question of whether a method was invoked during testing. Instead, it delves deeper, calculating the **percentage of code lines actually executed within each method**. This provides a clearer picture of test effectiveness, especially for methods with intricate logic. By identifying sections within methods that lack coverage, you can pinpoint areas that might require additional testing efforts, ultimately leading to a more comprehensive understanding of your code's functionality.

Using this option affects both the Overall Coverage and Code Changes Coverage (Modified Coverage) metrics, as they now take into account the percentage of executed lines within each method.

### Line-Level Coverage <a href="#line-level-coverage" id="line-level-coverage"></a>

Beyond method-level coverage metrics (Overall Coverage and Code Changes Coverage), SeaLights offers a complementary line-level coverage metric: Overall Line Coverage.

This metric takes a more granular approach, calculating the percentage of **executable lines within methods** that were executed during **any testing stage**. It provides a broader view of how thoroughly your test suite exercises the code across your entire application.

### **The Benefits of Utilizing Both Features Together**

By leveraging both Advanced Method Coverage and Line Level Coverage, you can achieve a holistic understanding of how thoroughly your tests exercise your code. This comprehensive view empowers you to make data-driven decisions about where to focus your testing efforts for maximum impact. Ultimately, this improved code coverage analysis leads to the development of more robust and reliable software.

### **Getting Started**

These powerful features are readily available within SeaLights. To unlock their full potential and delve deeper into the details of these calculation methods, configuration options, and best practices, visit our dedicated [**Coverage Calculation**](broken://pages/76izOfT4C0S5kuy6O9PI) page.

<div><figure><img src="https://1255034336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxSagdStwf6CJ9cI6lA68%2Fuploads%2FbbupelH6qxNlgBaYiSyB%2FScreenshot%202024-07-04%20at%2013.26.46.png?alt=media&amp;token=7b3d3763-6bc0-4b07-a832-045ed04d8577" alt=""><figcaption><p>New Coverage Settings Button</p></figcaption></figure> <figure><img src="https://1255034336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxSagdStwf6CJ9cI6lA68%2Fuploads%2FUPuCZXFN1kG6UAI0zvOW%2FScreenshot%202024-07-04%20at%2012.54.52.png?alt=media&amp;token=28626175-10a6-40ca-88ed-b8f0da553ab6" alt=""><figcaption><p>New Coverage Settings Popup</p></figcaption></figure> <figure><img src="https://1255034336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxSagdStwf6CJ9cI6lA68%2Fuploads%2FU8Lnq2D7uJAvaugJYTzf%2FScreenshot%202024-07-04%20at%2013.29.22.png?alt=media&amp;token=bcc700d8-e9c4-49b8-b801-be66ca9145dc" alt=""><figcaption><p>Build Coverage Calculation Indication</p></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/intro-to-sealights/technical-overview/new-coverage-calculation-options.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
