-
Notifications
You must be signed in to change notification settings - Fork 46
Troubleshooting
Here is the list of known but unsolved UnitTestBot Java problems with workarounds:
- JDK 17: successful symbolic executions fail due to failing utility methods
- JDK 17: UnitTestBot Java tries to mock unexported packages and creates uncompilable tests
Problem details:
The symbolic execution engine in UnitTestBot Java may generate tests that should pass, but they fail.
The reason is that sometimes UnitTestBot Java cannot build an Object assemble model without using Reflection.
Reflection methods using setAccessible
are forbidden in JDK 17 or later, so the UtUtils
methods using
setAccessible
do not work, and successful executions fail.
See an example in the issue.
Solution:
Add the following keys to the test run configuration:
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
Problem details:
Using JDK 17, UnitTestBot Java tries to create mockStatic(sun.net.util.IPAddressUtil.class)
for the code working
with network. IPAddressUtill
is not exported from JDK module, so the resulting tests are not compilable.
See an example in the issue.
Solution:
Add the following key to the test run configuration:
--add-exports java.base/sun.net.util=ALL-UNNAMED
- Check system requirements
- Install or update plugin
- Generate tests with default configuration
- Fine-tune test generation
- Get use of test results
(redirect to /docs in main repo)
- Contributing guide
- Developer guide
- Naming and labeling conventions
- Interprocess debugging
- Interprocess logging
- UnitTestBot overall architecture
- Android Studio support
- Assumption mechanism
- Choosing language-specific IDE
- Code generation and rendering
- Fuzzing Platform (FP) Design
- Instrumented process API: handling errors and results
- UnitTestBot JavaScript plugin setup
- Night statistics monitoring
- RD for UnitTestBot
- Sandboxing
- UnitTestBot settings
- Speculative field non-nullability assumptions
- Symbolic analysis of static initializers
- Summarization module
- Taint analysis
- UnitTestBot decomposition
- UtUtils class
- UnitTestBot Family changes