Software Analytics in Practice
Total Page:16
File Type:pdf, Size:1020Kb
FOCUS: THE MANY FACES OF SOftWARE ANALYTICS • software practitioners could Software conduct software analytics by themselves, • researchers from academia or in- dustry could collaborate with soft- Analytics ware practitioners from software companies or open source commu- nities and transfer their analytics in Practice technologies to real-world use, or • practitioners could organically adopt analytics technologies devel- Dongmei Zhang, Shi Han, Yingnong Dang, Jian-Guang Lou, oped by researchers. and Haidong Zhang, Microsoft Research Asia However, no matter how this is pur- Tao Xie, University of Illinois at Urbana-Champaign sued, it remains a huge challenge. We’ve worked on a number of soft- ware analytics projects that have had a // The StackMine project produced a software analytics high impact on software development 7–10 system for Microsoft product teams. The project provided practice. To illustrate the lessons we’ve learned from them, we describe several lessons on applying software analytics technologies our experiences developing StackMine, to make an impact on software development practice. // a scalable system for postmortem per- formance debugging.7 The Promise and Challenges of Software Analytics As we mentioned before, software an- alytics aims to obtain insightful and actionable information. Insightful in- formation conveys knowledge that’s meaningful and useful for practitioners THE SOFTWARE DEVELOPMENT software domain, we formed Micro- performing a specific task. Actionable process produces various types of data soft Research Asia’s Software Analyt- information is information with which such as source code, bug reports, check- ics Group (http://research.microsoft. practitioners can devise concrete ways in histories, and test cases. Over the past com/groups/sa) in 2009. We proposed (better than any existing way) to com- few decades, researchers have used ana- the concept of software analytics to ex- plete that task. lytics techniques on such data to better pand the scope of analyzing software For example, ranked performance understand software quality (for some artifacts. Software analytics aims to bottlenecks represented by sequences examples, see the sidebar). Also during obtain insightful and actionable in- of function calls can help performance that period, Internet access has become formation from software artifacts that analysts focus the investigation scope widely available, and software services help practitioners accomplish tasks of the underlying performance issues. now play an indispensable role in ev- related to software development, sys- This information also provides guid- eryday life. Much richer types of data tems, and users. ance on where to investigate. So, it’s at much larger scales now help practi- Although much research has cov- both insightful and actionable. tioners better understand how software ered software analytics, little work has Software analytics focuses on the and services perform in real-world set- covered its impact on software develop- trinity of software development, sys- tings and how end users employ them.1 ment practice.2,3 Software analytics can tems, and users, with the ultimate goal To address the increasing impor- affect software development practice in of improving development productivity, tance and abundance of data in the different ways.4–6 For example, software quality, and user experience 30 IEEE SOFTWARE | PUBLisHED BY THE IEEE COMPUTER SOCieTY 0740-7459/13/$31.00 © 2013 IEEE (see Figure 1).11–13 Obviously, improve- ments in the software development RELATED WORK IN process will improve development pro- ductivity. Software quality focuses SOFTWARE ANALYTICS on issues such as reliability, perfor- TECHNIQUES mance, and security, whereas assess- ment of the user experience focuses on A plethora of research exists on predicting software reliability in terms of the defect the user’s perspective. In general, soft- count at different levels of software systems.1 Recent examples of using software ar- ware analytics employs these primary tifacts to improve software development are software intelligence2 and analytics for technologies: software development.3 They both offer pertinent information to support developers’ decision making. • large-scale computing to handle large-scale datasets, References • machine-learning-based and data- 1. T.L. Graves et al., “Predicting Fault Incidence Using Software Change History,” IEEE Trans. Software mining-enabled analysis algo- Eng., vol. 26, no. 7, 2000, pp. 653–661. 2. A.E. Hassan and T. Xie, “Software Intelligence: The Future of Mining Software Engineering Data,” rithms, and Proc. FSE/SDP Workshop Future of Software Eng. Research (FoSER 10), ACM, 2010, pp. 161–166. • information visualization to help 3. R.P.L. Buse and T. Zimmermann, “Information Needs for Software Development Analytics,” Proc. Int’l with data analysis and presenting Conf. Software Eng. (ICSE 12), IEEE, 2012, pp. 987–996. insights. The target audience of practitioners is broad, including developers, testers, program managers, software manage- ment personnel, designers, usability en- Research topics Technology pillars gineers, service engineers, and support E xp y e Information engineers. it r l i a e u n visualization c Software analytics has the poten- Q Software Software e system users tial to impact practice for two main Analysis reasons. First, the data sources under algorithms study come from real-world settings. Software For example, open source communities development Large-scale naturally provide a huge data vault of Productivityprocess computing source code, bug reports, check-in his- Prod vity tory, and so on. Better yet, the vault is ucti active and evolving, which makes the (a) (b) data sources fresh and live. Second, as Figure 1 illustrates, the discipline of FIGURE 1. (a) The trinity of software development, systems, and users, with the ultimate software analytics spreads across the goal of improving development productivity, software quality, and user experience. (b) There areas of system quality, user experi- are three key technology pillars employed: information visualization, data analysis algorithms, ence, and development productivity, in- and large-scale computing. dicating a wide scope and huge poten- tial for impact on practice. Despite these opportunities, putting evaluate your analysis techniques in execution traces with performance is- software analytics technologies into real-world settings? sues from a huge number of users at real-world use involves significant chal- deployment sites.7 One example of lenges. How do you ensure the analy- Experiences with such infrastructure support at Micro- sis output is insightful and actionable? StackMine soft is PerfTrack (http://channel9.msdn. How do you know you’re using the ap- Performance debugging in the large has com/Blogs/Charles/Inside-Windows-7 propriate data to answer the questions recently emerged, owing to available -Reliability-Performance-and practitioners care about? How do you infrastructure support for collecting -PerfTrack), which measures system SEPTEMBER/OCTOBER 2013 | IEEE SOFTWARE 31 FOCUS: THE MANY FACES OF SOftWARE ANALYTICS responsiveness to user actions on oper- topic with little published research. We instrumentation together with reliable ating systems. Consider a user clicking found this exciting because of the po- domain-specific heuristics. Third, the on a Windows Explorer menu item to tential opportunity to pursue pioneer- trace stream wasn’t the right granular- create a folder. PerfTrack measures how ing research. ity level for similarity modeling and long it takes for the user to receive a re- As researchers with machine learn- clustering; it was too high a level to sponse from the system. If the response ing backgrounds, we started the project help performance analysts locate root time exceeds a predefined threshold, in a way with which we were familiar. causes of issues. PerfTrack sends execution traces (con- On the basis of our understanding of So, we refocused the project on iden- taining call stacks collected during the the product team’s analysis records and tifying essential problems. We worked closely with the performance analysts on this throughout the rest of the proj- ect life cycle. Ultimately, we used Stack- Performance debugging can be Mine to identify high-impact program- execution patterns from a large number reduced to a software analytics problem. of trace streams. We selected call stack patterns—sequences of function calls that happen during program execu- tion (abbreviated as stack patterns for preceding time interval) back to Mi- our discussion with a Windows perfor- this article)—as the pattern representa- crosoft for debugging. All the collected mance analyst, we quickly decided to tion and formulated the pattern discov- traces in total could contain more than study the high CPU consumption ex- ery problem as a mining and clustering 1 billion call stacks, which greatly ex- hibited in traces. We then formulated problem against hundreds of millions ceed what performance analysts can af- issue detection as a classification prob- of call stacks. ford to investigate. lem and issue correlation as a cluster- Performance debugging can be re- ing problem (both at the granularity of The Need for Domain Knowledge duced to a software analytics problem. trace streams). After a few months, we Deep domain knowledge is embed- Given enormous call stacks collected at got promising results from a machine ded in trace streams, in which more the deployment