question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accuracy for && and ||

See original GitHub issue

Hey, in Java when the coverage is calculated it also checks if only one and or or statement in an if is called. Currently as far as I can see this is not the case for solifidy coverage.

function check(string typeString, uint8 currentType)
        private
        pure
        returns (bool)
    {
        return
            (mapType(typeString, 2) == currentType && mapType(typeString, 4) == currentType ) ||
            (mapType(typeString, 1) == currentType && mapType(typeString, 3) == currentType);
    }

This is satisfied if it returns true and false once, even it has not been triggered with all possible combinations.

Maybe this is also just not displayed in the html report.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
cgeweckecommented, Dec 28, 2017

Hi @rmeissner, thanks for raising this. (FWIW, a similar issue is open at Istanbul here.)

Agree this would increase accuracy and the return snippet you’ve provided is a nice example of where this could be useful.

However, it would be quite difficult to implement with our current design which relies on injecting Solidity event statements into the source code before compilation and tracking the tests’ execution path at the log opcode in the VM. We’re constrained by Solidity’s grammar for conditionals.

That said, we’re working on re-writing solidity-coverage to use in-memory source mappings and passively track the vm’s opcode step with a websocket subscription. This additional level of detail should be possible if that approach succeeds - definitely worth aiming for.

0reactions
cgeweckecommented, Sep 5, 2022

Thanks @frangio 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Part 1: Simple Definition and Calculation of Accuracy ... - NCBI
In this educational review, we will simply define and calculate the accuracy, sensitivity, and specificity of a hypothetical test. Definitions: Patient: ...
Read more >
Classification: Accuracy | Machine Learning
Accuracy is one metric for evaluating classification models. Informally, accuracy is the fraction of predictions our model got right.
Read more >
Accuracy, Precision, Recall or F1? | by Koo Ping Shung
Precision is a good measure to determine, when the costs of False Positive is high. For instance, email spam detection.
Read more >
Accuracy & Precision in Data | Examples & Formula
Accuracy is how far off a measurement is from its true value. A measured value that's far from a true value is inaccurate,...
Read more >
Accuracy Calculator
The accuracy calculator is a simple tool for calculating accuracy using three simple methods.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found