Submitted:
28 October 2025
Posted:
29 October 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- The introduction and formalization of test analysis and rich tests,
- a prototype implementation working with rich tests for C code using CBMC,
-
Two enrichments:
- -
- Enrichment 1: introduction of property-based stubs,
- -
- Enrichment 2: regular expression specification of string values,
- and a few select examples demonstrating the capabilities of the approach.
2. Background
2.1. Software Testing
2.2. Formal Methods
2.2.1. Bounded Model Checking
3. Test Analysis
3.1. Traditional Testing
- yields the state after arrangement.
- yields the state after act.
- is true if and only if the assert holds in the given state.2
- ,
- ,
- ,
- It has no parameters.
-
it is separated into three phases: arrange, act and assert.
- -
- the arrange phase contains only variable initializations, variable assignments and function calls,
- -
- the act phase contains only a single function call, with the return value possibly assigned to a single variable,
- -
- and the assert phase contains only a single call to assert.
3.2. Rich Tests
- yields the abstract state after arrangement.
- yields the abstract state after act.
- is true if a concrete state would pass the test.
- ,
- ,
- It has no parameters.
-
it is separated into three phases: arrange, act and assert.
- the arrange phase contains only variable initializations,with possible non-deterministic assignment, function calls, andassumptions.
- the act phase contains only a single function call, with the return value possibly assigned to a single variable.
- and the assert phase contains only a single call to assert.
4. rUnit—Rich Testing with CBMC
4.1. Syntax
4.2. Back-End
#ASSUME
#ASSERT
x =
4.2.0.4. x = [l,b]
4.3. Analysing Rich Tests
5. Enrichment 1: Property-Based Stubbing
| Input Property | Output Property |
5.1. Automatic Stubs
- For each specification we introduce achoice variable indicating whether the pre-condition is met or not.
-
We introduce a covering assertion which ensures that at least one of the specifications apply, by asserting the disjunction of the pre-conditions>ASSERT Pre(s1) || ... || Pre(sn)
-
For each specification we introduce apre-condition choiceof the following formASSUME (si == 0 || Pre(si)) (si != 0 || !Pre(si))
-
For each specification we introduce apost-condition assumptionof the following formASSUME si == 0 || Post(si)
- (1)
- The target line is removed and replaced by a non-deterministic assignment to target.
- (2)
- Before the target line, each is declared (but with no value).
- (3)
- Before the target line, after declaration of , each pre-condition choice is introduced.
- (4)
- After the target line, the post-condition assumptions are introduced.
6. Enrichment 2: Non-Deterministic Strings
6.1. (Simple) Regular Expressions
- is a set of states,
- Σ is the input alphabet,
- is the transition function,
- is the initial state,
- and is the set of accepting states.
7. Related Work
8. Examples
8.1. Valid Username
8.2. Identifying Filename
8.3. Count Files
9. Conclusions
9.1. Future Work
References
- Kassab, M.; DeFranco, J.F.; Laplante, P.A. Software testing: The state of the practice. IEEE Software 2017, 34, 46–52. [Google Scholar] [CrossRef]
- Kasurinen, J.; Taipale, O.; Smolander, K. Software test automation in practice: empirical observations. Advances in Software Engineering 2010, 2010. [Google Scholar] [CrossRef]
- Khorikov, V. Unit testing : principles, practices, and patterns, 1st edition ed.; Manning: Shelter Island, New York, 2020. [Google Scholar]
- Dijkstra, E.W. The Humble Programmer. In Proceedings of the Communications of the ACM. ACM, Vol. 15; 1972; pp. 859–866. [Google Scholar] [CrossRef]
- State of the Art in Software Verification and Witness Validation: SV-COMP 2024. Lecture Notes in Computer Science; Springer Nature Switzerland: Cham, 2024; pp. 299–329. ISSN 0302-9743. [Google Scholar] [CrossRef]
- Davis, J.A.; Clark, M.; Cofer, D.; Fifarek, A.; Hinchman, J.; Hoffman, J.; Hulbert, B.; Miller, S.P.; Wagner, L. Study on the Barriers to the Industrial Adoption of Formal Methods. In Proceedings of the Formal Methods for Industrial Critical Systems; Pecheur, C.; Dierkes, M., Eds., Berlin, Heidelberg; 2013; pp. 63–77. [Google Scholar]
- Chong, N.; Cook, B.; Kallas, K.; Khazem, K.; Monteiro, F.R.; Schwartz-Narbonne, D.; Tasiran, S.; Tautschnig, M.; Tuttle, M.R. Code-Level Model Checking in the Software Development Workflow. In Proceedings of the Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: Software Engineering in Practice, New York, NY, USA, 2020. [CrossRef]
- Zakharov, I.S.; Mandrykin, M.U.; Mutilin, V.S.; Novikov, E.M.; Petrenko, A.K.; Khoroshilov, A.V. Configurable toolset for static verification of operating systems kernel modules. Programming and Computer Software 2015, 41, 49–64. [Google Scholar] [CrossRef]
- Ammann, P.; Offutt, J. Introduction to Software Testing.; Cambridge University Press, 2008.
- Appel, F. Testing with JUnit : master high-quality software development driven by unit tests; Packt Publishing, 2015.
- Salunke, S. Junit with examples, 1st ed.; CreateSpace Independent Publishing Platform: North Charleston, SC, USA, 2016. [Google Scholar]
- Google. Google Test. https://github.com/google/googletest, 2025. Version 1.17.0, Accessed on 2025-04-30.
- Clarke, E.; Kroening, D.; Lerda, F. A Tool for Checking ANSI-C Programs. In Proceedings of the Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2004); Jensen, K.; Podelski, A., Eds. Springer, Vol. 2988, Lecture Notes in Computer Science; 2004; pp. 168–176. [Google Scholar]
- Wei, C.; Xiao, L.; Yu, T.; Wong, S.; Clune, A. How Do Developers Structure Unit Test Cases? An Empirical Analysis of the AAA Pattern in Open Source Projects. IEEE Trans. Softw. Eng. 2025, 51, 1007–1038. [Google Scholar] [CrossRef]
- Turing, A.M. On Computable Numbers, with an Application to the {E}ntscheidungsproblem. Proceedings of the London Mathematical Society 1936, 2, 230–265. [Google Scholar]
- Hopcroft, J.E.; Motwani, R.; Ullman, J.D. Introduction to automata theory, languages, and computation. Acm Sigact News 2001, 32, 60–65. [Google Scholar] [CrossRef]
- Moy, Y.; Ledinot, E.; Delseny, H.; Wiels, V.; Monate, B. Testing or Formal Verification: DO-178C Alternatives and Industrial Experience. IEEE Software 2013, 30, 50–57. [Google Scholar] [CrossRef]
- Souyris, J.; Wiels, V.; Delmas, D.; Delseny, H. Formal Verification of Avionics Software Products. In Proceedings of the FM 2009: Formal Methods. Springer, Berlin, Heidelberg; 2009; pp. 532–3349. [Google Scholar] [CrossRef]
- Cook, B.; Khazem, K.; Kroening, D.; Tasiran, S.; Tautschnig, M.; Tuttle, M.R. Model checking boot code from AWS data centers. In Proceedings of the CAV 2018, 2018. [Google Scholar]
- Gunter, E.; Peled, D. , Heidelberg, 2003; pp. 548–567. https://doi.org/10.1007/978-3-540-39910-0-24.Code. In Verification: Theory and Practice: Essays Dedicated to Zohar Manna on the Occasion of His 64th Birthday; Springer Berlin Heidelberg: Berlin, Heidelberg, 2003; pp. 548–567. [Google Scholar]
- Amusuo, P.C.; Patil, P.V.; Cochell, O.; Lievre, T.L.; Davis, J.C. Enabling Unit Proofing for Software Implementation Verification, 2024. arXiv:2410. 1481. [Google Scholar] [CrossRef]
- Amusuo, P.C.; Cochell, O.; Lievre, T.L.; Patil, P.V.; Machiry, A.; Davis, J.C. Do Unit Proofs Work? An Empirical Study of Compositional Bounded Model Checking for Memory Safety Verification, 2025. arXiv:2503. 1376. [Google Scholar] [CrossRef]
- Tillmann, N.; Schulte, W. Parameterized unit tests. ACM SIGSOFT Software Engineering Notes 2005, 30, 253–262. [Google Scholar] [CrossRef]
- Albert, E.; Genaim, S.; Masud, A.N. On the Inference of Resource Usage Upper and Lower Bounds. ACM Transactions on Computational Logic 2013, 14, 1–35. [Google Scholar] [CrossRef]
| 1 | We wish to emphasize that this is not test analysis in the sense that tests are analysed to asses quality, e.g., coverage. |
| 2 |
representing true and false, respectively. |





















| Regular Expression | Description | Examples |
|---|---|---|
| constant | The exact string "constant" | "constant" |
| a* | One or more a | "", "a", "aaa", ... |
| .* | All strings | "", "a", "abcdef", ... |
| .*/sys.log | All paths for a file sys.log | "/sys.log", "/var/log/sys.log", ... |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).