130 likes | 261 Views
A Study of Cloning in the Linux SCSI Drivers. Wei Wang, Michael W. Godfrey Software Architecture Group David R. Cheriton School of Computer Science University of Waterloo, Canada {w65wang,migod}@ uwaterloo.ca. Yet another clone case study?. Why study Linux SCSI drivers?.
E N D
A Study of Cloning in the Linux SCSI Drivers Wei Wang, Michael W. Godfrey Software Architecture Group David R. Cheriton School of Computer Science University of Waterloo, Canada {w65wang,migod}@uwaterloo.ca
Why study Linux SCSI drivers? • Big, real, 16 years of history • A large collection of components that do roughly the same thing • 96 hardware-specific low-level drivers • We know there are clones!
“I should also mention the driver written by Hamish Macdonald for the Amiga A 2091 card.[…] It gives me a good initial understanding of the proper way to run a WD33C93 chip and I ended up stealing lots of code from it.” Extract from /driver/scsi/in2000.c
A Three-level Design in SCSI Drivers Top Level Generic driver Generic driver for tapes Generic driver for disks Mid Level Interfaces to the kernel Lower Level Concrete driver #1 Concrete driver #2 Concrete driver #3
Quick results (Read the paper!) • Most clones are contributed by concrete drivers • Clone coverage rate of lower-level is much higher than mid- and upper-level • Average lifetime of clone traces among three levels are similar
Does the presence of cloning have predictive power? • Can we use cloning to predict hardware similarity?
Matching Bus Type Dependency Three steps: • Extract bus type dependency info from config files • Convert each logical expression into DNF formula • Perform matching
Build the clone-based model For a pair of conceptual drivers in a clone relationship, do they have compatible bus type dependency? File level in2000.c wd33c9c.c Clone relationship between two files IN 2000 driver Amiga A 2091 driver Conceptual driver level ISA && SCSI PCI && SCSI
Discussion • Cloning is a strong indicator of hardware bus similarity for SCSI cards • A model relying solely on syntactical analysis works better than a domain knowledge-based model • Cloning can suggest high-level similarity • Can we use cloning analysis to predict similarity in other features or other systems?
Questions • New areas of leveraging clone detection besides “refactor them immediately”? • Software quality assessment • Clone management • License pollution
A Study of Cloning in the Linux SCSI Drivers Wei Wang, Michael W. Godfrey Software Architecture Group David R. Cheriton School of Computer Science University of Waterloo, Canada {w65wang,migod}@uwaterloo.ca