java - JUnit report to show test functionality, not coverage -


one of problems of team lead people on team (sometimes including myself) create junit tests without testing functionality.

it's done since developers use junit test harness launch part of application coding, , either deliberately or forgetfully check in without assert tests or mock verifies.

then later gets forgotten tests incomplete, yet pass , produce great code coverage. running application , feeding data through create high code coverage stats cobertura or jacoco , yet nothing tested except ability run without blowing - , i've seen worked-around big try-catch blocks in test.

is there reporting tool out there test tests, don't need review test code often?

i temporarily excited find jester tests tests changing code under test (e.g. if clause) , re-running see if breaks test.

however isn't set run on ci server - requires set-up on command line, can't run without showing gui, prints results onto gui , takes ages run.

pit standard java mutation tester. site:

mutation testing conceptually quite simple.

faults (or mutations) automatically seeded code, tests run. if tests fail mutation killed, if tests pass mutation lived.

...

traditional test coverage (i.e line, statement, branch etc) measures code executed tests. not check tests able detect faults in executed code. therefore able identify code not tested.

the extreme example of problem tests no assertions. fortunately these uncommon in code bases. more common code partially tested suite. suite partially tests code can still execute branches (examples).

as able detect whether each statement meaningfully tested, mutation testing gold standard against other types of coverage measured.

the quality of tests can gauged percentage of mutations killed.

it has corresponding maven plugin make simple integrate part of ci build. believe next version include proper integration maven site reports too.

additionally, creator/maintainer pretty active here on stackoverflow, , responding tagged questions.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -