logging library migrations - a case study for the apache software foundation projects
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()
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
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
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
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!)
31
Migrations can lead to problems
24 out of 33 projects encounter an average of 2 post-migration bugs due
to the migration
33
Why do developers migrate their logging libraries?
1. Flexibility 57.4%2. Performance 37.0%3. Code maintenance 33.3%
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!)