Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspiciousness is either 0 or 1 #2

Closed
JoranHonig opened this issue Jan 13, 2021 · 4 comments
Closed

Suspiciousness is either 0 or 1 #2

JoranHonig opened this issue Jan 13, 2021 · 4 comments

Comments

@JoranHonig
Copy link
Owner

@cgewecke adding an issue here so we can figure out wha't going wrong. Continueing from sc-forks/solidity-coverage#430 (comment)

In short:
@cgewecke ran fault localisation on the coverage output for sushiswap, and got the following output:
https://gist.github.com/cgewecke/2859f6e35aeb780f107757a45fd174c8https://gist.github.com/cgewecke/2859f6e35aeb780f107757a45fd174c8

It's weird because there is no gradient in the score, only min or max suspiciousness. Maybe there is a bug in the library that causes this problem.

@JoranHonig
Copy link
Owner Author

@cgewecke can you share the mocha & coverage json files that you used as an input?

@cgewecke
Copy link

cgewecke commented Jan 13, 2021

Yes, gists here:

And my tarantula script was:

const fl = require('tarantula-fl');
const mochaOutput = require('./mochaOutput.json');
const testMatrix = require('./testMatrix.json');

const testData = {
  testResults: fl.fromMocha(mochaOutput),
  coverage: fl.fromSolCover(testMatrix)
}

const score = fl.tarantulaScore(testData)
console.log(JSON.stringify(score, null, ' '));

@cgewecke
Copy link

Also, I published that branch as a beta today. It's installable as

npm install --save-dev solidity-coverage@beta

The mocha JSON is automatically generated with the --matrix flag and written to mochaOutput.json

@JoranHonig
Copy link
Owner Author

@cgewecke I found the problem 👌

I had no special treatment for situations where there were no failing tests. Should be fixed with v0.0.7!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants