Code coverage integrated into your IDE with Coco

The new release of Coco is now available and offers a huge step forward in usability and functionality for your testing. Developers can now review code coverage directly from their Integrated Development Environment (IDE) without switching back and forth between tools.

By bringing this information into the IDE, you’re empowering your developers to consider code testing and coverage as part of their ongoing development rather than seeing it as a separate process.

 

“With the new version of Coco, you can take the code coverage to where a developer is working. There’s no need to switch between different UIs.”

Harri Porten, Director of Product Management, The Qt Company

 

This new feature set works with MS Visual Studio, Visual Studio Code, Eclipse, QT Creator, and other IDEs.

Test Coverage In Your IDE

Traditionally, you’re used to using Coco from its desktop application browser.  From this, you may run reports to publish to your intranet or integrations with a Continuous Integration (CI) system like Jenkins, and coverage data from an overnight build may be displayed there. However, this leaves a gap between a developer’s view in the IDE and what the code coverage snapshot is reporting.

The new mode added to Coco allows it to run in the background as a server. This means a developer can use their IDE and connect the two, showing their code coverage right where they edit their code.

On-screen for the developer in their IDE, red and green lines will indicate if the code is tested or not. This kind of instant visual feedback will help them with the next step.

When a developer knows something is tested, they can have higher confidence that they won’t break something if they change it. They will also know which tests to run if they make the change. This is crucial feedback since you may have hundreds or even thousands of tests; running them all would take a long time. With this, if a developer changes a line of code, Coco will tell them which, for example, two or three tests to run.

It’s a continuous feedback loop that will bring testing coverage directly to the developers rather than being seen as a separate process reported periodically.

This also enables and incentivizes your developers to improve test coverage even further since it shows as they work where the gaps are and encourages them to write tests for them. When they can see them in front of their eyes, it’s hard to deny they exist!

Utilizing LSP for Code Test Coverage 

 

The new feature in Coco uses Language Server Protocol (LSP) to transport coverage information. This means you can take any IDE that works with LSP and use Coco.

However, in addition to this, for users of Visual Studio, Visual Studio Code and Qt Creator, there is a dedicated add-on that improves the experience even further. In a pure LSP-mode, there are only hints, but with the add-on, it will also show colors to highlight when code is covered, not covered, or even dead. 

 

“The LSP feedback loop with Coco promises to help change the testing coverage experience for developers. We believe that it will help solve many issues around testing.”

Harri Porten, Director of Product Management, The Qt Company

Integrating Coco with a CI System

It is possible to integrate Coco into a CI system. Our customer support team can work with development teams that want to set this up.

Once in place, a developer on a local machine can push the changes to the CI System, where the tests will execute. You can set up automation so that once Coco picks up the results, this coverage data will be fed back to all the local machines, meaning a team of ten developers, for example, can profit from the coverage data visualised in their IDE. 

 

Coco Brings Confidence When Coding

From a developer's viewpoint, seeing whether they are working in tested or untested code helps their mindset. A clear indication that code is tested will bring a feeling of security to their work. At the same time, if the code is untested, it will encourage extra caution and prompt a developer to think about what new tests to write to increase that coverage.

For situations where more detailed analysis is needed, the full power of Coco is still available through the coverage browser. For example, if a developer wanted to do some manual validation.

It creates an environment that will allow developers to feel confident in their work on an ongoing basis as the testing feedback is there for them to see. Meanwhile, they can still use the classic report style if they want to distribute data to others.

Accessing The Coco Integrated IDE Feature

Coco’s integrated IDE feature is available to everyone with a current Coco subscription. If you have a previous Coco license, you’ll only be able to use the old version of the software without this updated feature set. Upgrade and access the newest version here.

If you don’t currently have any license, request a demo here and see how Coco can bring surety to your test coverage.

Comments