Hallo

code


In [3]:
import pandas as pd
pd?

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


Out[10]:
PACKAGE CLASS LINE_MISSED LINE_COVERED
0 org.springframework.samples.petclinic PetclinicInitializer 0 24
1 org.springframework.samples.petclinic.model NamedEntity 1 4
2 org.springframework.samples.petclinic.model Specialty 0 1
3 org.springframework.samples.petclinic.model PetType 0 1
4 org.springframework.samples.petclinic.model Vets 4 0

In [13]:
coverage['LINES'] = coverage.LINE_MISSED + coverage.LINE_COVERED
coverage['RATIO'] = coverage.LINE_COVERED / coverage.LINES
coverage


Out[13]:
PACKAGE CLASS LINE_MISSED LINE_COVERED LINES RATIO
0 org.springframework.samples.petclinic PetclinicInitializer 0 24 24 1.000000
1 org.springframework.samples.petclinic.model NamedEntity 1 4 5 0.800000
2 org.springframework.samples.petclinic.model Specialty 0 1 1 1.000000
3 org.springframework.samples.petclinic.model PetType 0 1 1 1.000000
4 org.springframework.samples.petclinic.model Vets 4 0 4 0.000000
5 org.springframework.samples.petclinic.model Visit 0 12 12 1.000000
6 org.springframework.samples.petclinic.model BaseEntity 0 5 5 1.000000
7 org.springframework.samples.petclinic.model Person 0 7 7 1.000000
8 org.springframework.samples.petclinic.model Owner 14 26 40 0.650000
9 org.springframework.samples.petclinic.model Pet 3 18 21 0.857143
10 org.springframework.samples.petclinic.model Vet 11 1 12 0.083333
11 org.springframework.samples.petclinic.service ClinicServiceImpl 2 16 18 0.888889
12 org.springframework.samples.petclinic.web OwnerController 13 23 36 0.638889
13 org.springframework.samples.petclinic.web PetTypeFormatter 1 9 10 0.900000
14 org.springframework.samples.petclinic.web PetController 12 18 30 0.600000
15 org.springframework.samples.petclinic.web PetValidator 3 8 11 0.727273
16 org.springframework.samples.petclinic.web VisitController 3 13 16 0.812500
17 org.springframework.samples.petclinic.web VetController 7 3 10 0.300000
18 org.springframework.samples.petclinic.web CrashController 1 1 2 0.500000
19 org.springframework.samples.petclinic.util EntityUtils 6 0 6 0.000000
20 org.springframework.samples.petclinic.util CallMonitoringAspect 11 13 24 0.541667
21 org.springframework.samples.petclinic.reposito... JdbcVisitRowMapper 7 0 7 0.000000
22 org.springframework.samples.petclinic.reposito... JdbcPetRepositoryImpl 33 0 33 0.000000
23 org.springframework.samples.petclinic.reposito... JdbcVetRepositoryImpl 17 0 17 0.000000
24 org.springframework.samples.petclinic.reposito... JdbcPetRowMapper 9 0 9 0.000000
25 org.springframework.samples.petclinic.reposito... JdbcVisitRepositoryImpl 26 0 26 0.000000
26 org.springframework.samples.petclinic.reposito... JdbcPet 7 0 7 0.000000
27 org.springframework.samples.petclinic.reposito... JdbcPetVisitExtractor 8 0 8 0.000000
28 org.springframework.samples.petclinic.reposito... JdbcOwnerRepositoryImpl 43 0 43 0.000000
29 org.springframework.samples.petclinic.reposito... JpaVisitRepositoryImpl 4 4 8 0.500000
30 org.springframework.samples.petclinic.reposito... JpaOwnerRepositoryImpl 1 10 11 0.909091
31 org.springframework.samples.petclinic.reposito... JpaVetRepositoryImpl 1 1 2 0.500000
32 org.springframework.samples.petclinic.reposito... JpaPetRepositoryImpl 1 6 7 0.857143

In [14]:
coverage[coverage['RATIO'] == 0]


Out[14]:
PACKAGE CLASS LINE_MISSED LINE_COVERED LINES RATIO
4 org.springframework.samples.petclinic.model Vets 4 0 4 0.0
19 org.springframework.samples.petclinic.util EntityUtils 6 0 6 0.0
21 org.springframework.samples.petclinic.reposito... JdbcVisitRowMapper 7 0 7 0.0
22 org.springframework.samples.petclinic.reposito... JdbcPetRepositoryImpl 33 0 33 0.0
23 org.springframework.samples.petclinic.reposito... JdbcVetRepositoryImpl 17 0 17 0.0
24 org.springframework.samples.petclinic.reposito... JdbcPetRowMapper 9 0 9 0.0
25 org.springframework.samples.petclinic.reposito... JdbcVisitRepositoryImpl 26 0 26 0.0
26 org.springframework.samples.petclinic.reposito... JdbcPet 7 0 7 0.0
27 org.springframework.samples.petclinic.reposito... JdbcPetVisitExtractor 8 0 8 0.0
28 org.springframework.samples.petclinic.reposito... JdbcOwnerRepositoryImpl 43 0 43 0.0

In [16]:
grouped_by_package = coverage.groupby("PACKAGE").mean()
grouped_by_package


Out[16]:
LINE_MISSED LINE_COVERED LINES RATIO
PACKAGE
org.springframework.samples.petclinic 0.000000 24.000000 24.000000 1.000000
org.springframework.samples.petclinic.model 3.300000 7.500000 10.800000 0.739048
org.springframework.samples.petclinic.repository.jdbc 18.750000 0.000000 18.750000 0.000000
org.springframework.samples.petclinic.repository.jpa 1.750000 5.250000 7.000000 0.691558
org.springframework.samples.petclinic.service 2.000000 16.000000 18.000000 0.888889
org.springframework.samples.petclinic.util 8.500000 6.500000 15.000000 0.270833
org.springframework.samples.petclinic.web 5.714286 10.714286 16.428571 0.639809

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


Out[18]:
<matplotlib.axes._subplots.AxesSubplot at 0x1aeb589f860>

Conclusion

JDBC package rauswerfen


In [ ]:
import py2neo
import pandas as pd