wishlist: Code coverage testing for SelfTest

Bug #335995 reported by Darsey Litzenberger
2
Affects Status Importance Assigned to Milestone
Python-Crypto
Confirmed
Wishlist
Unassigned

Bug Description

It would be nice to see automatically how much code is actually covered by the SelfTest module.

Changed in pycrypto:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Thorsten Behrens (sbehrens-gmx) wrote :
Download full text (9.1 KiB)

I don't think this needs to become part of pycrypto. At least for the Python portions of pycrypto, coverage analysis is available using coverage.py. It currently, as of today's trunk, looks like the below.

Mainly, it'll show you what modules have tests in the first place. AllOrNothing is missing, as is elgamal, qNew, and random/random. Everything else gets tested to one extent or another.
Adding additional tests using public test vectors is always welcome.

I'm not quite sure whether coverage.py could handle the C extensions, had they been compiled with coverage support. It does show the test code written for those C extensions.

Please do experiment. :)

python -m coverage report
Name Stmts Miss Cover
----------------------------------------------------------------------------------------------------
build\lib.win-amd64-3.1\crypto\__init__ 5 0 100%
build\lib.win-amd64-3.1\crypto\cipher\__init__ 3 0 100%
build\lib.win-amd64-3.1\crypto\hash\__init__ 3 0 100%
build\lib.win-amd64-3.1\crypto\hash\hmac 44 2 95%
build\lib.win-amd64-3.1\crypto\hash\md5 15 7 53%
build\lib.win-amd64-3.1\crypto\hash\ripemd 1 0 100%
build\lib.win-amd64-3.1\crypto\hash\sha 15 7 53%
build\lib.win-amd64-3.1\crypto\pct_warnings 8 0 100%
build\lib.win-amd64-3.1\crypto\protocol\__init__ 3 0 100%
build\lib.win-amd64-3.1\crypto\protocol\chaffing 74 36 51%
build\lib.win-amd64-3.1\crypto\publickey\__init__ 3 0 100%
build\lib.win-amd64-3.1\crypto\publickey\_dsa 73 7 90%
build\lib.win-amd64-3.1\crypto\publickey\_rsa 28 3 89%
build\lib.win-amd64-3.1\crypto\publickey\_slowmath 83 7 92%
build\lib.win-amd64-3.1\crypto\publickey\dsa 111 29 74%
build\lib.win-amd64-3.1\crypto\publickey\pubkey 75 17 77%
build\lib.win-amd64-3.1\crypto\publickey\rsa 159 28 82%
build\lib.win-amd64-3.1\crypto\random\__init__ 10 1 90%
build\lib.win-amd64-3.1\crypto\random\_userfriendlyrng 118 19 84%
build\lib.win-amd64-3.1\crypto\random\fortuna\__init__ 0 0 100%
build\lib.win-amd64-3.1\crypto\random\fortuna\fortunaaccumulator 72 5 93%
build\lib.win-amd64-3.1\crypto\random\fortuna\fortunagenerator 60 3 95%
build\lib.win-amd64-3.1\crypto\random\fortuna\shad256 ...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.