logging library migrations - a case study for the apache software foundation projects

38
Logging Library Migrations Logging Library Migrations Suhas Kabinna, Cor-Paul Bezemer , Weiyi Shang, Ahmed E. Hassan A Case Study for the A Case Study for the Apache Software Foundation Projects Apache Software Foundation Projects

Upload: corpaulbezemer

Post on 15-Apr-2017

137 views

Category:

Science


1 download

TRANSCRIPT

Logging Library MigrationsLogging Library Migrations

Suhas Kabinna, Cor-Paul Bezemer, Weiyi Shang, Ahmed E. Hassan

A Case Study for the A Case Study for the Apache Software Foundation ProjectsApache Software Foundation Projects

2

Logging statements generate output about the execution of a program

function fun(){log(“In fun()”);// ...log(“Leave fun()”);

}

3

Logging statements generate output about the execution of a program

function fun(){log(“In fun()”);// ...log(“Leave fun()”);

}

[13:40:00] In fun()[13:40:05] Leave fun()

4

The usage of logging evolves

Printf / system.out.println

1990s

5

The usage of logging evolves

Printf / system.out.println

Logging levelsCentralized output location

1990s 2002

6

The usage of logging evolves

Printf / system.out.println

Logging levelsCentralized output location

Using several libraries in the same project

1990s 2002

2004

7

The usage of logging evolves

Printf / system.out.println

Logging levelsCentralized output location

Using several libraries in the same project All previous features in one library

1990s 2002

2004 2010

8

Logging library migration requires effort

Propose

9

Logging library migration requires effort

Propose Plan

10

Logging library migration requires effort

Propose Plan

Implement

11

Developers migrate to newer logging libraries

1. How often do they migrate?

12

Developers migrate to newer logging libraries

1. How often do they migrate?

2. Why do they migrate?

13

Developers migrate to newer logging libraries

1. How often do they migrate?

2. Why do they migrate?

3. What is the performance impact of such migration?

14

We study logging library migrations in Java projects

223 Java projects

450 JIRA issues related to logging

15

How often do developers migrate their logging libraries?

49 attempts identified in JIRA

33 projects successfully migrated (at least once)

16

14 migration attempts were abandoned

Mostly because nobody stepped up to make the required changes, or the developers did not agree on the value of the migration

17

Migrations can lead to problems

24 out of 33 projects encounter an average of 2 post-migration bugs due

to the migration

18

Why do developers migrate their logging libraries?

1. Flexibility 57.4%2. Performance 37.0%3. Code maintenance 33.3%

Based on manual tagging of JIRA issues that are related to logging library migration (multiple tags per issue possible)

19

Was the migration justified?

We calculate the time to generate output of one logging statement

pre and post-migration

Calculating the time it takes to generate output for one logging statement

ProjectRun test without logging

Executiontime without

logging

Calculating the time it takes to generate output for one logging statement

ProjectRun test without logging

Executiontime withlogging

Run test with logging

Executiontime without

logging

# of generated logs

Calculating the time it takes to generate output for one logging statement

ProjectRun test without logging

Executiontime withlogging

Run test with logging

Executiontime without

logging

Logging time

# of generated logs

Calculating the time it takes to generate output for one logging statement

ProjectRun test without logging

Executiontime withlogging

Run test with logging

Executiontime without

logging

Logging time

Time per log# of generated logs

24

Was the migration justified?

Project pre-migration Run testPre-migr. execution

time

25

Was the migration justified?

Project pre-migration

Project post-migration

Run test

Post-migr.execution

timeRun test

Pre-migr. execution

time

26

Was the migration justified?

Project pre-migration

Project post-migration

Compare

Run test

Post-migr.execution

timeRun test

Pre-migr. execution

time

27

There is a 28-44% speedup of logging after migration

28

There is a 28-44% speedup of logging after migration

However…

in 2 out of 3 projects this speedup is only noticeable at debug level

(so NOT in practice!)

Logging library migration requires effort

Propose Plan

Implement

30

31

Migrations can lead to problems

24 out of 33 projects encounter an average of 2 post-migration bugs due

to the migration

32

33

Why do developers migrate their logging libraries?

1. Flexibility 57.4%2. Performance 37.0%3. Code maintenance 33.3%

34

35

There is a 28-44% speedup of logging after migration

However…

in 2 out of 3 projects this speedup is only noticeable at debug level

(so NOT in practice!)

36

37

Cor-Paul [email protected]

http://sailhome.cs.queensu.ca/~corpaul/

38