🔧 AI Nachrichten How to evaluate LLMs before production(25.08.2026 um 23:35 Uhr)
⚠️ Malware / Trojaner / VirenStill: From Akira to Ink Wash, Building a Generative Garden in WebGPU(09.09.2026 um 16:11 Uhr)
🔧 AI Nachrichten LLMs im Browser – Teil 1: Eine neue KI-Runtime(09.09.2026 um 09:10 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra now available in Microsoft applications(08.09.2026 um 18:30 Uhr)
🔧 AI Nachrichten Build vs Buy: When to Outsource Machine Learning Development(10.09.2026 um 18:40 Uhr)
🔧 AI Nachrichten How to evaluate LLMs before production(25.08.2026 um 23:35 Uhr)
⚠️ Malware / Trojaner / VirenStill: From Akira to Ink Wash, Building a Generative Garden in WebGPU(09.09.2026 um 16:11 Uhr)
🔧 AI Nachrichten LLMs im Browser – Teil 1: Eine neue KI-Runtime(09.09.2026 um 09:10 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra now available in Microsoft applications(08.09.2026 um 18:30 Uhr)
🔧 AI Nachrichten Build vs Buy: When to Outsource Machine Learning Development(10.09.2026 um 18:40 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 4 Min Lesezeit
0

Creating coverage information

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

This is part 3 in the module that allows a developer to test how well the tests of a distribution actually check the code of a distribtion. The second blog delved into the development process of making the module. And in its simplest use, it looks like this:




CODE
use Code::Coverage;

my $coverage = Code::Coverage.new(
targets => @targets,
runners => @test-scripts
);

$coverage.run;

say .key ~ ": " ~ .value for $coverage.missed;






At object instantiation, provide two named arguments.



The first one is called targets and should contain the use targets for which to provide coverage information. These use targets are usually the key of the Code::Coverable object returned by the coverables subroutine of the Code::Coverable distribution.




In the Test::Coverage case, this would be obtained from the "provides" section from the META6.json file of a distribution.




The second one is called runners, and it should contain the path(s) of the scripts that should be executed to create coverage information.




In the Test::Coverage that would be set up with all the .t and .rakutest files in the t and xt directories of the distribution.




Then, call the run method on the Code::Coverage object to execute the scripts and create the coverage information, scan and process it.



After that, you can call one of several report methods, such as missed, which will then report the line numbers of the code that was not covered.






Multiple runs



Sometimes you may want to run the same script multiple times, but with different arguments, to get complete coverage information. And you can! Just call the run method once again, and specify any command line arguments as arguments to run method:




CODE
$coverage.run("foo");
$coverage.run("bar");






After each call, the coverage information is updated and you can call any of the report methods again.



If the different code paths depend on environment variables, you should just set those in the %*ENV variable:




CODE
%*ENV<FROBNICATE>=1
$coverage.run; # run with frobnication









Annotations



It is always nice to know the line numbers of code that didn't get covered. But that would still be a lot of looking up and down the code to find out what the contents was of the lines that didn't get covered.



To make that process easier, the Code::Coverage object has an annotated method that will produce the source code of a use target, and prefix each line of source with one of these four possibilities:




  • "*" - line was coverable, and covered

  • "" - line was not coverable, but covered anyway

  • "x" - line was coverable and not covered

  • "" - line was not coverable



Looks familiar? It should be if you've read the first post of this blog series! Yes, that's indeed the logic that Test::Coverage uses to create the .rakucov files.






More control



The would mean a great deal to me!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Samsung Taps Mistral AI for On-Premises Chip Manufacturing
1 Quelle
CISA’s ChatGPT Incident Exposes a Bigger AI Governance Problem
1 Quelle
California Establishes Framework for Independent AI Assessors
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Creating coverage information

Thematisch verwandte Begriffe: Creating, coverage, information · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...