Production Coverage Demo


In [ ]:
import pandas as pd
pd?

In [ ]:
pd.read_csv("../input/spring-petclinic/jacoco.csv").T

In [ ]:
coverage = pd.read_csv("../input/spring-petclinic/jacoco.csv", usecols=[1,2,7,8])
coverage.head()

In [ ]:
coverage['LINES'] = coverage.LINE_COVERED + coverage.LINE_MISSED
coverage['RATIO'] = coverage.LINE_COVERED / coverage.LINES
coverage.head()

In [ ]:
coverage[coverage.RATIO == 0]

In [ ]:
grouped_by_packages = coverage.groupby('PACKAGE').mean()
grouped_by_packages

In [ ]:
%matplotlib inline
grouped_by_packages['RATIO'].plot(kind='barh', figsize=(10,5))

In [ ]:
coverage['FQN'] = coverage.PACKAGE + "." + coverage.CLASS
coverage.head()

In [ ]:
coverage.to_csv("../vis/flare.csv", 
                columns=['FQN', 'LINES', 'RATIO'], 
                header=['id','value','ratio'],
                index=None)