skip to main content
10.5555/2818754.2818846acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Assert use in GitHub projects

Published: 16 May 2015 Publication History

Abstract

Asserts have long been a strongly recommended (if non-functional) adjunct to programs. They certainly don't add any user-evident feature value; and it can take quite some skill and effort to devise and add useful asserts. However, they are believed to add considerable value to the developer. Certainly, they can help with automated verification; but even in the absence of that, claimed advantages include improved understandability, maintainability, easier fault localization and diagnosis, all eventually leading to better software quality. We focus on this latter claim, and use a large dataset of asserts in C and C++ programs to explore the connection between asserts and defect occurrence. Our data suggests a connection: functions with asserts do have significantly fewer defects. This indicates that asserts do play an important role in software quality; we therefore explored further the factors that play a role in assertion placement: specifically, process factors (such as developer experience and ownership) and product factors, particularly interprocedural factors, exploring how the placement of assertions in functions are influenced by local and global network properties of the callgraph. Finally, we also conduct a differential analysis of assertion use across different application domains.

References

[1]
M. Barthelemy. Betweenness centrality in large complex networks. The European Physical Journal B-Condensed Matter and Complex Systems, 38(2): 163--168, 2004.
[2]
B. Baudry, Y. L. Traon, and J.-M. Jézéquel. Robustness and diagnosability of oo systems designed by contracts. In Proceedings of the 7th International Symposium on Software Metrics, METRICS '01, pages 272--, Washington, DC, USA, 2001. IEEE Computer Society.
[3]
C. Bird, A. Bachmann, E. Aune, J. Duffy, A. Bernstein, V. Filkov, and P. Devanbu. Fair and balanced?: bias in bug-fix datasets. In Proceedings of the the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, pages 121--130. ACM, 2009.
[4]
C. Bird, N. Nagappan, B. Murphy, H. Gall, and P. Devanbu. Don't touch my code!: examining the effects of ownership on software quality. In Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering, pages 4--14. ACM, 2011.
[5]
K. Börner, S. Sanyal, and A. Vespignani. Network science. Annual review of information science and technology, 41(1): 537--607, 2007.
[6]
L. C. Briand, Y. Labiche, and H. Sun. Investigating the use of analysis contracts to support fault isolation in object oriented code. In Proceedings of the 2002 ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA '02, pages 70--80, New York, NY, USA, 2002. ACM.
[7]
A. C. Cameron and P. K. Trivedi. Regression analysis of count data. Number 53. Cambridge university press, 2013.
[8]
P. Chalin. Logical foundations of program assertions: What do practitioners want? In Proceedings of the Third IEEE International Conference on Software Engineering and Formal Methods, SEFM '05, pages 383--393, Washington, DC, USA, 2005. IEEE Computer Society.
[9]
P. Chalin, J. R. Kiniry, G. T. Leavens, and E. Poll. Beyond assertions: Advanced specification and verification with jml and esc/java2. In Formal methods for components and objects, pages 342--363. Springer, 2006.
[10]
L. A. Clarke and D. S. Rosenblum. A historical perspective on runtime assertion checking in software development. SIGSOFT Softw. Eng. Notes, 31(3): 25--37, May 2006.
[11]
J. Cohen. Applied multiple regression/correlation analysis for the behavioral sciences. Lawrence Erlbaum, 2003.
[12]
K. Cremer, A. Marburger, and B. Westfechtel. Graph-based tools for re-engineering. Journal of software maintenance and evolution: research and practice, 14(4): 257--292, 2002.
[13]
K. El Emam, S. Benlarbi, N. Goel, and S. N. Rai. The confounding effect of class size on the validity of object-oriented metrics. Software Engineering, IEEE Transactions on, 27(7): 630--650, 2001.
[14]
M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The daikon system for dynamic detection of likely invariants. Sci. Comput. Program., 69(1-3): 35--45, Dec. 2007.
[15]
H.-C. Estler, C. Furia, M. Nordio, M. Piccioni, and B. Meyer. Contracts in practice. In C. Jones, P. Pihlajasaari, and J. Sun, editors, FM 2014: Formal Methods, volume 8442 of Lecture Notes in Computer Science, pages 230--246. Springer International Publishing, 2014.
[16]
J. Eyolfson, L. Tan, and P. Lam. Do time of day and developer experience affect commit bugginess? In Proceedings of the 8th Working Conference on Mining Software Repositories, pages 153--162. ACM, 2011.
[17]
N. E. Fenton and S. L. Pfleeger. Software metrics: a rigorous and practical approach. PWS Publishing Co., 1998.
[18]
R. W. Floyd. Assigning meanings to programs. Mathematical aspects of computer science, 19(19--32): 1, 1967.
[19]
J.-F. Girard and R. Koschke. Finding components in a hierarchy of modules: a step towards architectural understanding. In Software Maintenance, 1997. Proceedings., International Conference on, pages 58--65. IEEE, 1997.
[20]
S. Henry and D. Kafura. The evaluation of software systems' structure using quantitative software metrics. Software: Practice and Experience, 14(6): 561--573, 1984.
[21]
T. Hoare. Assertions in modern software engineering practice. In 2013 IEEE 37th Annual Computer Software and Applications Conference, pages 459--459. IEEE Computer Society, 2002.
[22]
T. Illes-Seifert and B. Paech. Exploring the relationship of a file's history and its fault-proneness: An empirical method and its application to open source programs. Information and Software Technology, 52(5): 539--558, 2010.
[23]
JContract. Using design by contract to automate java software and component testing, 2004.
[24]
H. Jeong, S. P. Mason, A.-L. Barabási, and Z. N. Oltvai. Lethality and centrality in protein networks. Nature, 411(6833): 41--42, 2001.
[25]
J. M. Kleinberg. Authoritative sources in a hyperlinked environment. Journal of the ACM (JACM), 46(5): 604--632, 1999.
[26]
G. Kudrjavets, N. Nagappan, and T. Ball. Assessing the relationship between software assertions and faults: An empirical investigation. In Proceedings of the 17th International Symposium on Software Reliability Engineering, ISSRE '06, pages 204--212, Washington, DC, USA, 2006. IEEE Computer Society.
[27]
G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of jml: A behavioral interface specification language for java. SIGSOFT Softw. Eng. Notes, 31(3): 1--38, May 2006.
[28]
N. G. Leveson, S. S. Cha, J. C. Knight, and T. J. Shimeall. The use of self checks and voting in software error detection: An empirical study. IEEE Trans. Softw. Eng., 16(4): 432--443, Apr. 1990.
[29]
S. Mancoridis, B. S. Mitchell, C. Rorres, Y. Chen, and E. R. Gansner. Using automatic clustering to produce high-level system organizations of source code. In International Conference on Program Comprehension, pages 45--45. IEEE Computer Society, 1998.
[30]
S. McConnell and D. Johannis. Code complete, volume 2. Microsoft press Redmond, 2004.
[31]
B. Meyer. Applying "design by contract". Computer, 25(10): 40--51, Oct. 1992.
[32]
A. Mockus and L. G. Votta. Identifying reasons for software changes using historic databases. In ICSM '00: Proceedings of the International Conference on Software Maintenance, page 120. IEEE Computer Society, 2000.
[33]
H. A. Müller, S. R. Tilley, and K. Wong. Understanding software systems using reverse engineering technology perspectives from the rigi project. In Proceedings of the 1993 conference of the Centre for Advanced Studies on Collaborative research: software engineering-Volume 1, pages 217--226. IBM Press, 1993.
[34]
M. Muller, R. Typke, and O. Hagner. Two controlled experiments concerning the usefulness of assertions as a means for programming. In Software Maintenance, 2002. Proceedings. International Conference on, pages 84--92, 2002.
[35]
G. C. Murphy, D. Notkin, W. G. Griswold, and E. S. Lan. An empirical study of static call graph extractors. ACM Transactions on Software Engineering and Methodology (TOSEM), 7(2): 158--191, 1998.
[36]
G. C. Murphy, D. Notkin, and K. Sullivan. Software reflexion models: Bridging the gap between source and high-level models. In ACM SIGSOFT Software Engineering Notes, volume 20, pages 18--28. ACM, 1995.
[37]
N. Polikarpova, I. Ciupa, and B. Meyer. A comparative study of programmer-written and automatically inferred contracts. In Proceedings of the Eighteenth International Symposium on Software Testing and Analysis, ISSTA '09, pages 93--104, New York, NY, USA, 2009. ACM.
[38]
R Development Core Team. R: A language and environment for statistical computing, 2008. ISBN 3-900051-07-0.
[39]
F. Rahman and P. Devanbu. Ownership, experience and defects: a fine-grained study of authorship. In Proceedings of the 33rd International Conference on Software Engineering, pages 491--500. ACM, 2011.
[40]
B. Ray, D. Posnett, V. Filkov, and P. Devanbu. A large scale study of programming languages and code quality in github. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, FSE '14. ACM, 2014.
[41]
D. S. Rosenblum. A practical approach to programming with assertions. IEEE Trans. Softw. Eng., 21(1): 19--31, Jan. 1995.
[42]
Z. M. Saul, V. Filkov, P. Devanbu, and C. Bird. Recommending random walks. In Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, pages 15--24. ACM, 2007.
[43]
T. W. Schiller, K. Donohue, F. Coward, and M. D. Ernst. Case studies and tools for contract specifications. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pages 596--607, New York, NY, USA, 2014. ACM.
[44]
K. Shrestha and M. J. Rutherford. An empirical evaluation of assertions as oracles. In Proceedings of the 2011 Fourth IEEE International Conference on Software Testing, Verification and Validation, ICST '11, pages 110--119, Washington, DC, USA, 2011. IEEE Computer Society.
[45]
A. Tosun, B. Turhan, and A. Bener. Validation of network measures as indicators of defective modules in software systems. In Proceedings of the 5th international conference on predictor models in software engineering, page 5. ACM, 2009.
[46]
J. Voas and K. Miller. Putting assertions in their place. In Software Reliability Engineering, 1994. Proceedings., 5th International Symposium on, pages 152--157, Nov 1994.
[47]
M. M. Wasko and S. Faraj. Why should i share? examining social capital and knowledge contribution in electronic networks of practice. MIS quarterly, pages 35--57, 2005.
[48]
S. Yau and R. Cheung. Design of self-checking software. In ACM SIGPLAN Notices, volume 10, pages 450--455. ACM, 1975.
[49]
H. Yin and J. Bieman. Improving software testability with assertion insertion. In Test Conference, 1994. Proceedings., International, pages 831--839, Oct 1994.
[50]
T. Zimmermann and N. Nagappan. Predicting defects using network analysis on dependency graphs. In Proceedings of the 30th international conference on Software engineering, pages 531--540. ACM, 2008.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '15: Proceedings of the 37th International Conference on Software Engineering - Volume 1
May 2015
999 pages
ISBN:9781479919345

Sponsors

Publisher

IEEE Press

Publication History

Published: 16 May 2015

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)0
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media