Software regression explained

A software regression is a type of software bug where a feature that has worked before stops working. This may happen after changes are applied to the software's source code, including the addition of new features and bug fixes.[1] They may also be introduced by changes to the environment in which the software is running, such as system upgrades, system patching or a change to daylight saving time.[2] A software performance regression is a situation where the software still functions correctly, but performs more slowly or uses more memory or resources than before.[3] Various types of software regressions have been identified in practice, including the following:[4]

Regressions are often caused by encompassed bug fixes included in software patches. One approach to avoiding this kind of problem is regression testing. A properly designed test plan aims at preventing this possibility before releasing any software.[5] Automated testing and well-written test cases can reduce the likelihood of a regression.

Prevention and detection

Techniques have been proposed that try to prevent regressions from being introduced into software at various stages of development, as outlined below.

Prior to release

See main article: Regression testing.

In order to avoid regressions being seen by the end-user after release, developers regularly run regression tests after changes are introduced to the software. These tests can include unit tests to catch local regressions as well as integration tests to catch remote regressions.[6] Regression testing techniques often leverage existing test cases to minimize the effort involved in creating them.[7] However, due to the volume of these existing tests, it is often necessary to select a representative subset, using techniques such as test-case prioritization.

For detecting performance regressions, software performance tests are run on a regular basis, to monitor the response time and resource usage metrics of the software after subsequent changes.[8] Unlike functional regression tests, the results of performance tests are subject to variance - that is, results can differ between tests due to variance in performance measurements; as a result, a decision must be made on whether a change in performance numbers constitutes a regression, based on experience and end-user demands. Approaches such as statistical significance testing and change point detection are sometimes used to aid in this decision.[9]

Prior to commit

Since debugging and localizing the root cause of a software regression can be expensive,[10] [11] there also exist some methods that try to prevent regressions from being committed into the code repository in the first place. For example, Git Hooks enable developers to run test scripts before code changes are committed or pushed to the code repository.[12] In addition, change impact analysis has been applied to software to predict the impact of a code change on various components of the program, and to supplement test case selection and prioritization.[13] [14] Software linters are also often added to commit hooks to ensure consistent coding style, thereby minimizing stylistic issues that can make the software prone to regressions.[15]

Localization

Many of the techniques used to find the root cause of non-regression software bugs can also be used to debug software regressions, including breakpoint debugging, print debugging, and program slicing. The techniques described below are often used specifically to debug software regressions.

Functional regressions

A common technique used to localize functional regressions is bisection, which takes both a buggy commit and a previously working commit as input, and tries to find the root cause by doing a binary search on the commits in between.[16] Version control systems such as Git and Mercurial provide built-in ways to perform bisection on a given pair of commits.[17] [18]

Other options include directly associating the result of a regression test with code changes;[19] setting divergence breakpoints;[20] or using incremental data-flow analysis, which identifies test cases - including failing ones - that are relevant to a set of code changes,[21] among others.

Performance regressions

Profiling measures the performance and resource usage of various components of a program, and is used to generate data useful in debugging performance issues. In the context of software performance regressions, developers often compare the call trees (also known as "timelines") generated by profilers for both the buggy version and the previously working version, and mechanisms exist to simplify this comparison.[22] Web development tools typically provide developers the ability to record these performance profiles.[23] [24]

Logging also helps with performance regression localization, and similar to call trees, developers can compare systematically-placed performance logs of multiple versions of the same software.[25] A tradeoff exists when adding these performance logs, as adding many logs can help developers pinpoint which portions of the software are regressing at smaller granularities, while adding only a few logs will also reduce overhead when executing the program.[26]

Additional approaches include writing performance-aware unit tests to help with localization,[27] and ranking subsystems based on performance counter deviations.[28] Bisection can also be repurposed for performance regressions by considering commits that perform below (or above) a certain baseline value as buggy, and taking either the left or the right side of the commits based on the results of this comparison.

See also

Notes and References

  1. Book: Wong . W. Eric . Horgan . J.R. . London . Saul . Agrawal . Hira . Proceedings of the Eighth International Symposium on Software Reliability Engineering (ISSRE 97) . 1997 . IEEE . 0-8186-8120-9 . A Study of Effective Regression Testing in Practice. 10.1109/ISSRE.1997.630875 . 2911517 .
  2. Yehudai. Amiram . Tyszberowicz. Shmuel . Nir. Dor. Locating Regression Bugs. Haifa Verification Conference. https://www.research.ibm.com/haifa/conferences/hvc2017/previous.shtml. 2007. 10.1007/978-3-540-77966-7_18 . 10 March 2018.
  3. Shang. Weiyi. Hassan. Ahmed E.. Nasser. Mohamed. Flora. Parminder. 11 December 2014. Automated Detection of Performance Regressions Using Regression Models on Clustered Performance Counters. 22 December 2019. 13 January 2021. https://web.archive.org/web/20210113231136/https://sail.cs.queensu.ca/Downloads/ICPE2015_AutomatedDetectionofPerformanceRegressionsUsingRegressionModelsOnClusteredPerformanceCounters.pdf#page=1. dead.
  4. Book: Henry . Jean-Jacques Pierre . The Testing Network: An Integral Approach to Test Activities in Large Software Projects . 2008 . Springer Science & Business Media . 978-3540785040 . 74.
  5. Book: Richardson, Jared . Gwaltney, William Jr . Ship It! A Practical Guide to Successful Software Projects . 2006 . The Pragmatic Bookshelf . Raleigh, NC . 32, 193 . 978-0-9745140-4-8 .
  6. Book: Leung . Hareton K.N. . White . Lee . Proceedings of the International Conference on Software Maintenance . November 1990 . IEEE . San Diego, CA, USA . 0-8186-2091-9 . A study of integration testing and software regression at the integration level. 10.1109/ICSM.1990.131377 . 62583582 .
  7. Rothermel . Gregg . Harrold . Mary Jean . Dedhia . Jeinay . Regression test selection for C++ software . Software Testing, Verification and Reliability . 2000 . 10 . 2 . 77–109 . 10.1002/1099-1689(200006)10:2<77::AID-STVR197>3.0.CO;2-E . en . 1099-1689.
  8. Weyuker . E.J. . Vokolos . F.I. . Experience with performance testing of software systems: issues, an approach, and case study . IEEE Transactions on Software Engineering . December 2000 . 26 . 12 . 1147–1156 . 10.1109/32.888628 . 1939-3520.
  9. Book: Daly . David . Brown . William . Ingo . Henrik . O'Leary . Jim . Bradford . David . Proceedings of the International Conference on Performance Engineering . 20 April 2020 . Association for Computing Machinery . 978-1-4503-6991-6 . 67–75 . The Use of Change Point Detection to Identify Software Performance Regressions in a Continuous Integration System. 10.1145/3358960.3375791 . 211677818 .
  10. Book: Nistor . Adrian . Jiang . Tian . Tan . Lin . Proceedings of the Working Conference on Mining Software Repositories (MSR) . May 2013 . 237–246 . Discovering, reporting, and fixing performance bugs. 10.1109/MSR.2013.6624035 . 978-1-4673-2936-1 . 12773088 .
  11. Agarwal . Pragya . Agrawal . Arun Prakash . Fault-localization techniques for software systems: a literature review . ACM SIGSOFT Software Engineering Notes . 17 September 2014 . 39 . 5 . 1–8 . 10.1145/2659118.2659125 . 12101263 . 0163-5948.
  12. Web site: Git - Git Hooks . git-scm.com . 7 November 2021.
  13. Orso . Alessandro . Apiwattanapong . Taweesup . Harrold . Mary Jean . Leveraging field data for impact analysis and regression testing . ACM SIGSOFT Software Engineering Notes . 1 September 2003 . 28 . 5 . 128–137 . 10.1145/949952.940089 . 0163-5948.
  14. Book: Qu . Xiao . Acharya . Mithun . Robinson . Brian . Proceedings of the International Conference on Software Maintenance . September 2012 . 129–138 . Configuration selection using code change impact analysis for regression testing. 10.1109/ICSM.2012.6405263 . 978-1-4673-2312-3 . 14928793 .
  15. Book: Tómasdóttir . Kristín Fjóla . Aniche . Mauricio . van Deursen . Arie . Proceedings of the International Conference on Automated Software Engineering . October 2017 . 578–589 . Why and how JavaScript developers use linters. 10.1109/ASE.2017.8115668 . 978-1-5386-2684-9 . 215750004 .
  16. Book: Gross . Thomas . Proceedings of the International Workshop on Automatic Debugging . 10 September 1997 . Linkøping University Electronic Press . 185–191 . en . Bisection Debugging.
  17. Web site: Git - git-bisect Documentation . git-scm.com . 7 November 2021.
  18. Web site: hg - bisect . www.selenic.com . Mercurial . 7 November 2021.
  19. Web site: Reading 11: Debugging . web.mit.edu . MIT.
  20. Book: Buhse . Ben . Wei . Thomas . Zang . Zhiqiang . Milicevic . Aleksandar . Gligoric . Milos . Proceedings of the International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) . May 2019 . 15–18 . VeDebug: Regression Debugging Tool for Java. 10.1109/ICSE-Companion.2019.00027 . 978-1-7281-1764-5 . 174799830 .
  21. Book: Taha . A.-B. . Thebaut . S.M. . Liu . S.-S. . Proceedings of the Annual International Computer Software & Applications Conference . September 1989 . IEEE . 527–534 . An approach to software fault localization and revalidation based on incremental data flow analysis. 10.1109/CMPSAC.1989.65142 . 0-8186-1964-3 . 41978046 .
  22. Ocariza . Frolin S. . Zhao . Boyang . Localizing software performance regressions in web applications by comparing execution timelines . Software Testing, Verification and Reliability . 2021 . 31 . 5 . e1750 . 10.1002/stvr.1750 . 225416138 . en . 1099-1689.
  23. Web site: Analyze runtime performance . Chrome Developers . Google . 7 November 2021 . en.
  24. Web site: Performance analysis reference - Microsoft Edge Development . docs.microsoft.com . Microsoft . 7 November 2021 . en-us.
  25. Book: Yao . Kundi . B. de Pádua . Guilherme . Shang . Weiyi . Sporea . Steve . Toma . Andrei . Sajedi . Sarah . Proceedings of the International Conference on Performance Engineering . 30 March 2018 . Association for Computing Machinery . 978-1-4503-5095-2 . 127–138 . Log4Perf: Suggesting Logging Locations for Web-based Systems' Performance Monitoring. 10.1145/3184407.3184416 . 4557038 .
  26. A Qualitative Study of the Benefits and Costs of Logging from Developers' Perspectives . IEEE Transactions on Software Engineering . 30 January 2020 . 10.1109/TSE.2020.2970422 . Li . Heng . Shang . Weiyi . Adams . Bram . Sayagh . Mohammed . Hassan . Ahmed E. . 47 . 12 . 2858–2873 . 213679706 .
  27. Book: Heger . Christoph . Happe . Jens . Farahbod . Roozbeh . Proceedings of the International Conference on Performance Engineering . 21 April 2013 . Association for Computing Machinery . 978-1-4503-1636-1 . 27–38 . Automated root cause isolation of performance regressions during software development. 10.1145/2479871.2479879 . 2593603 .
  28. Book: Malik . Haroon . Adams . Bram . Hassan . Ahmed E. . Proceedings of the International Symposium on Software Reliability Engineering . November 2010 . 201–210 . Pinpointing the Subsystems Responsible for the Performance Deviations in a Load Test. 10.1109/ISSRE.2010.43 . 978-1-4244-9056-1 . 17306870 .