This application is a U.S. National Stage Application of and claims priority to international Patent Application No. PCT/US2013/067488, filed on Oct. 30, 2013, and entitled “SOFTWARE COMMIT RISK LEVEL,” the entire content of which is hereby incorporated in its entirety.
With the advent of on-line services, executable software often is available 24 hours per day, every day. Any changes or improvements to the software should function correctly when released into the production version of the software. The continuous availability of software code creates a stress point on the ability to test the code.
For a detailed description of various examples, reference will now be made to the accompanying drawings in which:
As used herein, the term “code” refers to all files related to an executable application. For example, code may be executable software itself (e.g., source or object code) as well as various files used by the executable code such as images, documentation, etc.
A model of a software code's creation cycle is illustrated in
As noted above, the testing portion of the cycle can be very intensive and time consuming. The examples described herein provide a technique by which the testing phase may be eliminated in at least some situations (as indicated by the “X” in
The disclosed technique involves the use of a supervised machine learning approach to generate a classifier which predicts a risk level with merging the software commit in to the production environment. The disclosed machine learning approach assumes that there is a common denominator to a “bad” commit, that is, a commit that introduces a bug into the production environment. The common denominator can be learned by generating a classifier based on prior commits. If the classifier deems a particular commit to be a good commit (e.g., a commit that does not introduce a bug), then the testing phase may be skipped and the commit released into production. However, if the classifier deems a particular commit to be a bad commit, further testing may be performed to fix any bugs. The classifier generates a risk level for each commit to designate the likelihood that a commit is good (bug free) or bad (likely contains a bug).
Testing may be skipped for good commits and only performed for bad commits, thereby generally reducing the amount of testing needing to be performed.
As used herein, referring to a commit as “good” means the commit is bug-free. Referring to a commit as “bad” means the commit contains a bug. The term “risk level” may indicate whether the commit is risky or not risky. That is, in some implementations, a risk level only contains two levels (risky, not risky). In other implementations, more than two risk levels are provided.
The commits in a given data structure 100 may be commits that pertain to different software projects. In other implementations, however, the data structure 100 may contain commits that al pertain to the same software project. For example, an on-line web service may have undergone multiple software updates. The various updates (commits) for the on-line web service are all stored in one data structure for subsequent use in estimating the risk level of a future commit for the same project. In such implementations, a separate data structure of software commits may be provided for each software project.
Each commit in the data structure 100 includes a plurality of attributes 104. The attributes include at least one attribute about the software commit. In at least some implementations, the attributes 104 do not pertain to the functionality or logic implemented by the code itself. Instead, the attributes characterize the environment associated with the software commit. Any number of attributes 104 is possible.
In some implementations, the attributes may be categorized in three classes. A first class of attributes includes attributes based on the commit itself without considering the entire project history (source control). Source control attributes include, for example, the number of days that have elapsed since the last commit for the project (project age). In general, there may be a correlation between the frequency with which a software project is updated and the likelihood of a bug. A software project that has not needed an update in a long time is generally less likely to experience a bug when an update is made as compared to a software project that has experienced a higher frequency of software updates. Another example of a source control attribute is the time of day when the commit was made. In general, commits made during normal business hours may be more reliable than commits made during off-hours.
A second class of attributes includes attributes based on the labels of the prior commits (previous labels). As explained above, a “label” is a characterization as to whether a software commit proved to be, for example, good (bug free) or bad (had a bug). The previous labels attributes include attributes pertaining to labels of prior commits such as, for example, whether the last commit had a “good” or “bad” label (label of last 1 commits), the average of the last three commits (label of last 3 commits), the minimum number of days that have elapsed since the last “good” commit of each file in the commit (last good commit days min), etc.
A third class of attributes includes attributes pertaining to the complexity of the committed code (code complexity). In general, a modification made to more complex code is more likely to result in a bug than a modification made to simpler code. Any of a variety of techniques for measuring code complexity may be used. One suitable complexity attribute, for example, is the number of lines of source code (SLOG). Other complexity metrics may include the cyclomatic complexity, Halstead complexity measures, and maintainability metrics. Cyclomatic complexity measures the number of linearly independent paths through the source code. Cyclomatic complexity may be computed using a control flow graph of the source code whose nodes correspond to indivisible groups of commands and whose directed edges connect two nodes if the second command might be executed immediately after the first command. Halstead complexity produces a difficulty measure that is related to the difficulty of the program to write or understand. The maintainability index is computed based on lines of code measures, Halstead complexity measures and possibly different or other measures. Additional or different complexity metrics are possible as well.
Table I below provides examples of various attributes, some of which are discussed above. Other implementations may use a different set of attributes.
At 154, the method includes generating a classifier based on the commits' attributes and corresponding labels in the data structure. In some examples, operation 154 is implemented as an off-line learning operation in which the data structure with the commits' attributes and labels are provided to the classifier engine 110. The classifier engine 110 may implement any suitable classifier technique such as a “leave-1-out” cross validation to generate the classifier 120. For example, for each commit in the data structure, the method removes that commit from the data structure, calculates the classifier on the remaining commits, run the newly computed classifier on the commit that was removed, and compare the risk level label returned by the classifier to the actual label of the removed commit.
Once the classifier 120 is generated, the classifier 120 can be used to assess a risk level for a given commit. The generated classifier 120 is usable to classify a new commit (i.e., a commit that is not already in the data structure or for which a label has not already been determined) as good or bad.
The above discussion is meant to be illustrative of the principles and various embodiments of the present invention. Numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2013/067488 | 10/30/2013 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2015/065367 | 5/7/2015 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6219805 | Jones | Apr 2001 | B1 |
6895577 | Noble | May 2005 | B1 |
6944759 | Crisan | Sep 2005 | B1 |
7487545 | Hall | Feb 2009 | B2 |
7707265 | Gibson | Apr 2010 | B2 |
7757125 | Bassin | Jul 2010 | B2 |
8255362 | Johnson | Aug 2012 | B2 |
8572679 | Wang | Oct 2013 | B1 |
8584079 | Yassin | Nov 2013 | B2 |
8589203 | Collins | Nov 2013 | B1 |
8627287 | Fanning | Jan 2014 | B2 |
9354867 | Jain | May 2016 | B2 |
9395979 | Bullukian | Jul 2016 | B1 |
9558464 | Bassin | Jan 2017 | B2 |
9785430 | Viswanathan | Oct 2017 | B2 |
20050114829 | Robin | May 2005 | A1 |
20050283751 | Bassin | Dec 2005 | A1 |
20050289503 | Clifford | Dec 2005 | A1 |
20060107121 | Mendrala | May 2006 | A1 |
20060161879 | Lubrecht | Jul 2006 | A1 |
20070033445 | Hirsave | Feb 2007 | A1 |
20070038977 | Savage | Feb 2007 | A1 |
20070157195 | Gaa-Frost | Jul 2007 | A1 |
20070260607 | Hajdukiewicz | Nov 2007 | A1 |
20070288923 | Nishikawa | Dec 2007 | A1 |
20080034258 | Moriya | Feb 2008 | A1 |
20080077530 | Banas | Mar 2008 | A1 |
20080201611 | Bassin | Aug 2008 | A1 |
20080201612 | Bassin | Aug 2008 | A1 |
20080263534 | Hirsave | Oct 2008 | A1 |
20090144698 | Fanning | Jun 2009 | A1 |
20090204946 | Fienblit | Aug 2009 | A1 |
20100049723 | Aebig | Feb 2010 | A1 |
20100049745 | Aebig | Feb 2010 | A1 |
20100049746 | Aebig | Feb 2010 | A1 |
20100162200 | Kamiyama | Jun 2010 | A1 |
20100174501 | Myadam | Jul 2010 | A1 |
20100293519 | Groves | Nov 2010 | A1 |
20100306732 | Zhu | Dec 2010 | A1 |
20110067005 | Bassin | Mar 2011 | A1 |
20120159420 | Yassin | Jun 2012 | A1 |
20120197686 | Abu El Ata | Aug 2012 | A1 |
20120203590 | Deb | Aug 2012 | A1 |
20120291014 | Shrinivasan | Nov 2012 | A1 |
20130006701 | Guven | Jan 2013 | A1 |
20130074038 | Fox | Mar 2013 | A1 |
20130204837 | Sabharwal | Aug 2013 | A1 |
20130346956 | Green | Dec 2013 | A1 |
20140033176 | Rama | Jan 2014 | A1 |
20140136901 | Butler | May 2014 | A1 |
20140282406 | Narasimhan | Sep 2014 | A1 |
20160092185 | Botti | Mar 2016 | A1 |
20160323378 | Coskun | Nov 2016 | A1 |
20160378618 | Cmielowski | Dec 2016 | A1 |
20170169370 | Cornilescu | Jun 2017 | A1 |
Entry |
---|
Will Snipes et al., Code Hot Spot: A Tool for Extraction and Analysis of Code Change History, IEEE 978-1-4577-0664-6/11, 2011, [Retrieved on Oct. 19, 2017]. Retrieved from the internet: <URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6080806> 10 Pages (392-401). |
Raimund Moser et al., A Comparative Analysis of the Efficiency of Change Metrics and Static Code Attributes for Defect Prediction, ACM 978-1-60558-079-1, May 10-18, 2008, [Retrieved on Oct. 19, 2017]. Retrieved from the internet: <URL: http://delivery.acm.org/10.1145/1370000/1368114/p181-moser.pdf> 10 Pages (181-190). |
Bhattacharya, P., “Quantitative Decision-making in Software Engineering,” (Research Paper), Diss. University of California Riverside, Jun. 2012, 180 pages, available at http://www.cs.ucr.edu/˜neamtiu/pubs/dissertation-bhattacharya.pdf. |
Eyolfson, J. et al., “Correlations Between Bugginess and Time-based Commit Characteristics,” (Research Paper), Empirical Software Engineering 19.4, Apr. 10, 2013, 32 pages, available at https://ece.uwaterloo.ca/˜lintan/publications/commitTime-emse13.pdf. |
Giger, E. et al., “Method-level Bug Prediction,” (Research Paper), Proceedings of the ACM-IEEE International Symposium on Empirical Software Engineering and Measurement, ACM, Sep. 20, 2012, pp. 171-180, available at https://pdfs.semanticscholar.org/feb5/a1efebae4a349078dde9dea9aac0a020d3e7.pdf. |
International Search Report & Written Opinion received in PCT Application No. PCT/US2013/067488, Jul. 23, 2014, 12 pages. |
Moser, R. et al., “A Comparative Analysis of the Efficiency of Change Metrics and Static Code Attributes for Defect Prediction,” 2008 ACM/IEEE 30th International Conference on Software Engineering, May 2008, pp. 181-190, available at https://hiper.cis.udel.edu/lp/lib/exe/fetch.php/courses/icse08-moser-defectpredict.pdf. |
Snipes, W. et al., “Code Hot Spot: A Tool for Extraction and Analysis of Code Change History,” (Research Paper), Software Maintenance (ICSM), 27th IEEE International Conference on, Sep. 25, 2011, pp. 392-401, available at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.416.9811&rep=rep1&type=pdf. |
Synopsys Inc., “Coverity Integrity Control Governs Code Risk From Third Party Suppliers,” (Web Page), 2016, 4 pages, available at http://www.coverity.com/press-releases/coverity-integrity-control-governs-code-risk-from-third-party-suppliers/. |
Synopsys, Inc., “Coverity Save,” (Web Page), 2016, 4 pages, available at http://www.coverity.com/products/coverity-save/. |
Synopsys, Inc., “Coverity Test Advisor—Development,” (Web Page), 2016, 4 pages, available at http://www.coverity.com/products/test-advisor-development/. |
Tarvo, A. et al., “Predicting Risk of Pre-release Code Changes with Checkinmentor,” (Research paper), 2013 IEEE 24th International Symposium on Software Reliability Engineering (ISSRE), 2013, pp. 128-137, available at http://cs.brown.edu/˜alexta/Doc/pubs/2013—ISSRE—PredictRiskofPreReleaseCodeChanges.pdf. |
Wikipedia, “Cyclomatic Complexity,” (Web Page), Oct. 24, 2013, 8 pages, available at https://en.wikipedia.org/w/index.php?title=Cyclomatic—complexity&oldid=578592301. |
Wikipedia, “Halstead Complexity Measures,” (Web Page), Aug. 6, 2013, 3 pages, available at https://en.wikipedia.org/w/index.php?title=Halstead—complexity—measures&oldid=567445559. |
Wikipedia, “Maintainability,” (Web Page), Aug. 10, 2013, 3 pages, available at https://en.wikipedia.org/w/index.php?title=Maintainability&oldid=567944596. |
Wikipedia, “Source Line of Code,” (Web Page), Oct. 24, 2013, 9 pages, available at https://en.wikipedia.org/w/index.php?title=Source—lines—of—code&oldid=578535056. |
Number | Date | Country | |
---|---|---|---|
20160239402 A1 | Aug 2016 | US |