Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
337 commits
Select commit Hold shift + click to select a range
c43cc9d
[maven-release-plugin] prepare release botsing-1.0.0
Oct 19, 2018
dacc09f
[maven-release-plugin] prepare for next development iteration
Oct 19, 2018
86c414f
revert
Oct 19, 2018
e5b4c83
removing nexus config for now
Oct 19, 2018
75a09c7
[maven-release-plugin] prepare release botsing-1.0.0
Oct 19, 2018
0e4112d
[maven-release-plugin] prepare for next development iteration
Oct 19, 2018
ff2667a
restoring nexus deploy configuration
Oct 19, 2018
4985cd6
Update README.md
Oct 19, 2018
62e1bcb
Add changes from first release of Botsing
luandrea Oct 19, 2018
fc290b6
Fix parent version
luandrea Oct 19, 2018
1356c27
Excluded generated-sources from checkstyle
luandrea Oct 19, 2018
d6132ca
Fixed checkstyle errors
luandrea Oct 19, 2018
27fa842
Initialize botsing-model-generation
Oct 19, 2018
221bf55
Initialize BotsingDepedencyAnalysor
Oct 19, 2018
cb3e325
Initialize Model generation
Oct 19, 2018
3b32e6c
Remove unused imports
Oct 19, 2018
c775290
Setting random seed in operators test cases
Oct 19, 2018
fae3eb4
Merge remote-tracking branch 'upstream/master'
luandrea Oct 22, 2018
adee601
#17 Moved dependency versions in parent pom
luandrea Oct 22, 2018
6467de8
Initialize the first version of instrumentig classes in a customized …
Oct 25, 2018
78f1388
Update gitignore to ignore the local test package
Oct 25, 2018
521b40c
Adding log messages in tests
Oct 25, 2018
50e49f0
Merge branch 'master' into master
Oct 25, 2018
ef28bcb
Remove unused imports from BotsingTest.java
Oct 25, 2018
2fee1b5
remove redundant imports from StackTraceTest.java
Oct 25, 2018
c123f11
Merge pull request #17 from luandrea/master
Oct 25, 2018
05108af
Removing explicit dependency version
Oct 25, 2018
68d7dfd
Clean moder generation
Oct 25, 2018
523df3d
Add project prefix to the CL input options
Oct 25, 2018
01f06a2
Renaming targetFrameLevel in StackTrace class for consistency
Oct 25, 2018
1bb588d
Refactoring error handling in StackTrace class
Oct 25, 2018
da8e4f1
Refactoring error handling in CrashProperties class
Oct 25, 2018
3b49860
Updating checkstyle version to 3.0.0 - fixing #13
Oct 25, 2018
8682560
Adding extra integration tests
apanichella Oct 25, 2018
3f6615c
Adding missing file
apanichella Oct 25, 2018
ea7f4a2
Add call sequences pool.
Oct 29, 2018
203a358
Add Gson as the dependency of model generation
Oct 29, 2018
3831b7a
Add static analysis process
Oct 29, 2018
99af262
Clean ModelGeneration class
Oct 29, 2018
6e626e3
Fix the bug in the botsing class loader
Oct 29, 2018
f559e43
Add the process of checking the result of the test execution
Oct 29, 2018
dd8de33
Add customized test carver
Nov 1, 2018
ebad320
Some minor changes
Nov 1, 2018
f5973be
Add full dynamic analysis process to the model generation
Nov 1, 2018
f07c768
Fix the checkstyle errors
Nov 1, 2018
c5fd508
Refactor the classpaths
Nov 1, 2018
7832270
minor changes
Nov 1, 2018
27bc299
Handle exceptons in callSequencePoolManager
Nov 1, 2018
b4cb97a
Add tests
Nov 1, 2018
aa54a26
Fix some minor bugs in static analysis
Nov 1, 2018
22d2d4c
Update gitignore avoid ignoring projectA jar files
Nov 1, 2018
0b8da0f
Add projectA as a sample project for testing botsing
Nov 1, 2018
f70c9df
Refactor BotsingBytecodeinstrumentation
Nov 4, 2018
7ceb767
Refactor CaptureUtil
Nov 4, 2018
8752972
Refactor CPAnalysor
Nov 4, 2018
9343b48
Refactor InstrumentingClassLoader
Nov 4, 2018
8079215
Add YAMI model generator to the dependencies
Nov 4, 2018
5249e6e
Some minor changes
Nov 4, 2018
4b56427
Add the process of generating models from call sequences using YAMI
Nov 4, 2018
910ba64
Add output directory option to the commal line params
Nov 4, 2018
a4b8715
Remove unused imports
Nov 4, 2018
fa76efb
Delete LICENSE
Nov 5, 2018
431a500
Refactoring some classes and adding some comments
Nov 6, 2018
3d8640d
[maven-release-plugin] prepare release botsing-1.0.1
Nov 7, 2018
4cb47ea
[maven-release-plugin] prepare for next development iteration
Nov 7, 2018
61a4002
[maven-release-plugin] rollback the release of botsing-1.0.1
Nov 7, 2018
4fea709
Adding missing project URL
Nov 7, 2018
cf859ee
[maven-release-plugin] prepare release botsing-1.0.1
Nov 7, 2018
b3d65ea
[maven-release-plugin] prepare for next development iteration
Nov 7, 2018
8aca64f
Adding badge with latest version on Maven central
Nov 7, 2018
2b28f35
Update README.md
Nov 7, 2018
2c84f2b
Removing legacy architecture doc
Nov 7, 2018
a68ef4e
Update README.md
Nov 7, 2018
06c9333
Use EvoSuite test carver
Nov 7, 2018
77ac294
Update botsing version in the pom files
Nov 7, 2018
794beec
Update botsing version in the pom files
Nov 7, 2018
c3de3ff
Merge branch 'master' into behavioral-model-generation
Nov 7, 2018
1626d9c
Remove unused imports
Nov 7, 2018
a004f1b
Merge remote-tracking branch 'origin/behavioral-model-generation' int…
Nov 7, 2018
5ff2bdc
Make BotsingDependencyAnalysor in crash-reproduction empty
Nov 7, 2018
5a3b3c7
Merge pull request #25 from STAMP-project/behavioral-model-generation
Nov 7, 2018
152091e
Merge branch 'master' of https://github.com/STAMP-project/botsing
Nov 8, 2018
18f087a
Adding architecture diagrams
Nov 8, 2018
0c71597
Refactoring generateSolution and handling of best fitness for starvat…
Nov 8, 2018
53836f3
Remove empty unused method setFitnessFunction
Nov 8, 2018
309499a
Refactoring integration test of model generation to avoid polluting t…
Nov 8, 2018
2a83573
Merge pull request #26 from STAMP-project/bestfintess-refactoring-in-…
Nov 8, 2018
ebe60b8
Fix some minor bugs in the static analyzer
Nov 9, 2018
374cdc4
Use default evosuite DependencyAnalysis for now
Nov 13, 2018
77789f6
Add logback configuration file. EvoSuite logging is off. The log leve…
Nov 13, 2018
57c63b5
Add checking the is the search is finished after the first population…
Nov 13, 2018
7166275
Set global_timeout to 1800 in the default configuration
Nov 13, 2018
4ecc34d
Make output more representative
Nov 13, 2018
705353e
Make output more representative
Nov 13, 2018
9906fb7
Fix a minor error in the build process
Nov 13, 2018
3abcab5
Remove scope test for the helpful dependencies
Nov 14, 2018
63c7bf6
Renaming package to remove '_' from the names
Nov 20, 2018
60e34aa
Merge branch 'master' of https://github.com/STAMP-project/botsing
Nov 20, 2018
99293ee
Updating packages names to comply with Java best practices. Removing …
Nov 20, 2018
1678da4
Updating parameter names to have a consistent naming style
Nov 21, 2018
b97feb8
Update parameters values in tests
Nov 21, 2018
b5a57ca
Removing System.out.print calls from the code
Nov 21, 2018
ed5b0bd
Adding test logging configuration to reduce the logs
Nov 21, 2018
874f5c2
Describe background of Botsing
avandeursen Nov 25, 2018
afa1b26
Update logo and EU ack with STAMP nr.
avandeursen Nov 25, 2018
c4d7b6e
Explain the name 'botsing'.
avandeursen Nov 25, 2018
c355bea
Merge pull request #33 from STAMP-project/history
Nov 26, 2018
6933c55
Fix typo
mauricioaniche Nov 28, 2018
be6c318
Merge pull request #34 from mauricioaniche/patch-1
Nov 29, 2018
3baab3a
Increase the default value of max_target_injection_tries from 150 to …
Dec 10, 2018
ab90494
Fix the accessible method call detector bug.
Dec 10, 2018
c402a84
Change the accessible method call detector unit test according to the…
Dec 11, 2018
ca53ace
Print the non-minimized best generated test at the end of the search.
Dec 11, 2018
2ba926c
Merge remote-tracking branch 'origin/master'
Dec 11, 2018
82eab6b
Handle exceptions in model generation
Jan 8, 2019
368f557
The static analyzer continues its work even if it has problem with e …
Jan 8, 2019
816a485
Add a new proprties to the model generator: `projectPackage`
Jan 8, 2019
19a3be5
Saving tests usages after dynamic analysis
Jan 8, 2019
9041e27
Collecting the observed classes during the static analysis of tests.
Jan 8, 2019
90e3a82
Add addrgenerated testsess of existing crashes as a command line inpu…
Jan 8, 2019
c5b3033
Do not apply any limitation for carving tests when `crashes` command …
Jan 8, 2019
8d9ed45
Remove unused imports
Jan 8, 2019
12263a3
Using the customized carving run listener for botsing model generation
Jan 9, 2019
2d58764
Add proper indicators for dynamic analyser
Jan 9, 2019
79521d5
Add test usage pool for collecting the accessed objects by the test c…
Jan 9, 2019
528ac56
Store the test usage by the newly defined pool
Jan 9, 2019
28eda7f
Update .gitignore for ignoring model generation local tests
Jan 9, 2019
cce26b4
Remove unused imports
Jan 9, 2019
ffb8543
Add logback properties file to the botsing model generation
Jan 9, 2019
4a7bc15
Add assembly-plugin to the botsing model generation pom file
Jan 9, 2019
1cf6842
Remove all exception throwings in the Botsing source code
Jan 9, 2019
ab4a0a0
Remove pre CFG generation
Jan 11, 2019
90c7104
Fix a minor bug in logReader of model generator
Jan 11, 2019
c8ac538
Improve exception/Error handling in model generation
Jan 11, 2019
cc000ff
Add vibes as a dependency to the Botsing crash reproduction
Jan 13, 2019
6d435a3
Add 2 new parameters for model seeding
Jan 13, 2019
2dfeb8d
Add model seeding process
Jan 13, 2019
950edd4
Merge pull request #36 from STAMP-project/model-seeding
Jan 13, 2019
38a4714
Remove project package property
Jan 14, 2019
d758b99
Update model filtering
Jan 14, 2019
78c9eaa
Handle EvoSuite test generation assertion errors
Jan 14, 2019
43583e6
Increase the abstract test generation timeout from 2 to 5 seconds
Jan 14, 2019
b03a1b0
Merge pull request #37 from STAMP-project/model-seeding
Jan 14, 2019
792047e
Retry of one operator throws an exception
Jan 14, 2019
b2d83d7
Add the concretized test case to the object pool only if it is valid
Jan 14, 2019
ed7894e
Load target classes before starting the model seeding
Jan 22, 2019
de1f1b4
Update gitignore for adding the customized version of evosuite
Jan 22, 2019
a248d04
Update stack trace similarity calculator
Jan 22, 2019
5af659e
Update the fitness function calcuator test suite according to the rec…
Jan 22, 2019
f644fd9
Allw object pool usage after the abstract test case selection
Jan 22, 2019
fad0110
Update crashProperties according to the recent changes
Jan 22, 2019
3c58129
Add the customized version of Evosuite. Botsing uses this version as …
Jan 22, 2019
700c230
Update guided mutation
Jan 22, 2019
9999581
Only use the target classes for the abstract test selection.
Jan 22, 2019
38768e6
Cloning test cases only when test seeding generates the initial popul…
Jan 22, 2019
636be06
Update access level of methods is GuidedGeneticAlgorithm
Jan 22, 2019
f3cef6a
Add shading
Jan 22, 2019
e900001
Update travis before script
Jan 22, 2019
dbade53
Update travis
Jan 22, 2019
c0c82a6
ignoring generated dependency-reduced-pom.xml file
Jan 23, 2019
d437771
[maven-release-plugin] prepare release botsing-1.0.2
Jan 23, 2019
75d2795
[maven-release-plugin] prepare for next development iteration
Jan 23, 2019
909dfe9
Adding license file for botsing-mode-generation
Jan 23, 2019
19cde51
Fix a bug in BotsingMojo
Jan 23, 2019
47a3671
Exclude "org.apache.logging.log4j.core.config.plugins.processor.Plugi…
Jan 24, 2019
5e26469
[maven-release-plugin] prepare release botsing-1.0.3
Jan 24, 2019
ab090cf
[maven-release-plugin] prepare for next development iteration
Jan 24, 2019
dd27bce
Add Botsing demo note
Jan 24, 2019
cb786a4
Merge remote-tracking branch 'origin/master'
Jan 24, 2019
4c1e9b5
Add vibes version to the parent pom
Jan 27, 2019
b92d278
Update the test concretization process
Jan 27, 2019
7a1f2f9
[Misc] Link to the Maven plugin doc
vmassol Jan 28, 2019
c4184cc
First commit
Jan 31, 2019
143c556
Address issue #41 : Remove EvoSuite dependency from generated test
Jan 31, 2019
d4fbf3e
Merge remote-tracking branch 'origin/master'
Jan 31, 2019
bd4015b
Add some comments to the control dependencies detector method
Jan 31, 2019
105c126
Fix classpath option in help message and README
Feb 1, 2019
341072b
Add botsing-commons module
Feb 4, 2019
60d1122
Add integration testing option as one of the crash properties
Feb 4, 2019
d0b43cd
Add instrumenting classes to botsing-commons
Feb 4, 2019
cfe5f44
Add instrumenting classes to botsing-commons
Feb 4, 2019
847c323
Add botsing as one of the dependencies of botsing-reproduction
Feb 4, 2019
5620e00
Use customized evosuite in botsing-commons
Feb 4, 2019
ea618d3
Instrument multiple classes in integration testing mode
Feb 4, 2019
4527a6d
Fix a minor bug in initializing the target class
Feb 4, 2019
06ece5a
Add -integration_testing command line parameter
Feb 4, 2019
96cb8a6
Add botsing cfg
Feb 4, 2019
adf41df
Fix checkstyle issues
Feb 4, 2019
e1b2a5b
Define ClassInstrumentation in botsing commons
Feb 6, 2019
dce54c6
Initialize integration testing InterProcedural CFG.
Feb 6, 2019
1caa6fd
Change logging in some of the classes
Feb 6, 2019
b0d2a25
Complete the first version of InterProcedural CFG generator for integ…
Feb 6, 2019
f9bd430
Adding module botsing-parser
Feb 7, 2019
4870636
Adding parser and lexer
Feb 7, 2019
f9a09b0
Adding POJO classes for stack trace
Feb 7, 2019
69138c0
Adding parsing utilities
Feb 7, 2019
e813dec
Removing unfound module
Feb 7, 2019
7046bba
Removing trailing space
Feb 7, 2019
ed9b7b6
Merge pull request #43 from p-hamann/master
Feb 7, 2019
2f421d4
Merge pull request #44 from STAMP-project/botsing-parser
Feb 11, 2019
fb6e611
Add the building instruction to the README
Feb 15, 2019
fffcc8c
Ficing problem with default crash properties loading from configurati…
Mar 1, 2019
6547032
Removing unused imports
Mar 1, 2019
b08db98
Adding test for parser when constructor appears in the stack trace
Mar 1, 2019
6f0f5cc
Adding test for help and missing options in command line
Mar 1, 2019
708560a
Fixing failing test
Mar 1, 2019
f0892c9
Always using latests version of coverall plugin
Mar 1, 2019
bb3e5c1
Fix crossover operator
Mar 3, 2019
e7984ba
setting catch_undeclared_exceptions=FALSE by default to remove try/ca…
Mar 5, 2019
8ffc0ad
Merge pull request #53 from STAMP-project/issue#22
Mar 5, 2019
69b3dab
Add Botsing Actual InterProcedural cfg
Mar 7, 2019
f00dc62
Override determineBasicBock method in Rawcfg
Mar 7, 2019
063cce3
Add InterproceduralBasicBlock
Mar 7, 2019
abeb518
Update EvoSuite library
Mar 7, 2019
c4d1296
Update EvoSuite version in travis.yml
Mar 8, 2019
c411f79
Merge pull request #49 from p-hamann/opfix
Mar 8, 2019
db6c65d
Add incomplete control dependence graph generator
Mar 8, 2019
8bbcf81
Fix a bug in the guided operators
Mar 8, 2019
22a4b2b
Update test case of mutateOffspring method according to the recent de…
Mar 8, 2019
a84bb28
Add some comments to FrameControlFlowGraph class
Mar 10, 2019
c44f6b9
Fix a bug in edge registration during the class instrumentation.
Mar 10, 2019
fe45bb0
Fix a bug in inter-procedural raw cfg generation.
Mar 10, 2019
fdd16f4
Update evosuite library (changing the access level of various methods)
Mar 10, 2019
a9f9a75
Exclude throwing exit points from the returning ones in inter-procedu…
Mar 10, 2019
77151fa
Update model generation pom file
Mar 11, 2019
5b2c9f7
Clean code
Mar 11, 2019
2b8497b
Clean log outputs
Mar 11, 2019
9311ec5
Add irrelevant frame handler
Mar 11, 2019
646da9a
Add line estimation
Mar 11, 2019
6ed29d1
Handle the missing lines
Mar 11, 2019
e2909ef
Add BotsingRawControlFlowGraph test suite
Mar 12, 2019
07546b4
Fix some bugs which are detected by adding tests.
Mar 12, 2019
9159404
Remove unused Botsingcdg class
Mar 12, 2019
89e36e4
Improve the testability of CFGGenerator class
Mar 12, 2019
34c1a99
Put the common testing methods to a separate class
Mar 12, 2019
459e521
Add tests for BotsingActualControlFlowGraph
Mar 12, 2019
2f9b252
Add tests for InterproceduralBasicBlock
Mar 12, 2019
b2a2f87
Make CFGGenerator more testable
Mar 13, 2019
be0d489
Add tests for CFGGenerator
Mar 13, 2019
8658bb7
Merge branch 'master' into integration_testing
Mar 13, 2019
66ae245
Add the missing import
Mar 13, 2019
0de4780
Merge pull request #59 from STAMP-project/integration_testing
Mar 13, 2019
adce3a5
Update README.md
Mar 14, 2019
63ce408
Updated StackFlatten task and removed annotation test
Mar 14, 2019
416d188
Add new file for FlattenTest
Mar 14, 2019
c4d11d9
Update pom.xml
Mar 14, 2019
397dec0
Update code for (regexp) RegexpSingleline: Line has trailing spaces.
Mar 15, 2019
daab51d
Merge branch 'master' into stacktrace-processing
Mar 15, 2019
fc528cf
Remove trailing spaces
Mar 15, 2019
5a6808a
Remove system.exits
Mar 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Log file
*.log
!sample.log

# BlueJ files
*.ctxt
Expand All @@ -13,7 +12,8 @@

# Package Files #
*.jar
!atos.jar
!evosuite-client-botsing-*.jar
!*projectA*.jar
*.war
*.nar
*.ear
Expand All @@ -30,6 +30,7 @@ hs_err_pid*
.Rapp.history

# Maven
dependency-reduced-pom.xml
target/

# OS generated files #
Expand All @@ -48,3 +49,7 @@ Thumbs.db
.project
.settings/

# local test directory
**/test/**/botsing/local/
**/test/**/botsing/model/generation/local/

7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ language: java
jdk:
- oraclejdk8

install: true

script: mvn package checkstyle:check

before_script:
- mvn clean

before_install:
- mvn install:install-file -Dfile=botsing-reproduction/evosuite-client-botsing-1.0.7.jar -DgroupId=org.evosuite -DartifactId=evosuite-client-botsing -Dversion=1.0.7 -Dpackaging=jar

after_success:
- mvn jacoco:report coveralls:report
- mvn jacoco:report coveralls:report
File renamed without changes.
104 changes: 102 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,54 @@

[![Build Status](https://travis-ci.org/STAMP-project/botsing.svg?branch=master)](https://travis-ci.org/STAMP-project/botsing)
[![Coverage Status](https://coveralls.io/repos/github/STAMP-project/botsing/badge.svg?branch=master)](https://coveralls.io/github/STAMP-project/botsing?branch=master)
[![Maven Central](https://img.shields.io/maven-central/v/eu.stamp-project/botsing-reproduction.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22eu.stamp-project%22%20AND%20a:%22botsing-reproduction%22)

Botsing is a Java framework for crash reproduction. It relies on [EvoSuite](http://www.evosuite.org) for code instrumentation.

## Usage

### From Maven

See the [documentation for the Maven Plugin](https://github.com/STAMP-project/botsing/tree/master/botsing-maven).

### Command line interface


#### botsing reproduction
The latest version of Botsing command line (botsing-reproduction-X-X-X.jar) is available at [https://github.com/STAMP-project/botsing/releases](https://github.com/STAMP-project/botsing/releases).

Botsing has three mandatory parameters:
- `-crash_log` the file with the stack trace. The stack trace should be clean (no error message) and cannot contain any nested exceptions.
- `-target_frame` the target frame to reproduce. This number should be between 1 and the number of frames in the stack trace.
- `-project_cp` the classpath of the project and all its dependencies. The classpath can be a folder containing all the `.jar` files required to run the software under test.


By default, Botsing uses the following parameter values:
- `-Dsearch_budget=1800`, a time budget of 30 min. This value can be modified by specifying an additional parameter in format `-Dsearch_budget=60` (here, for 60 seconds).
- `-Dpopulation=100`, a default population with 100 individuals. This value may be modified using `-Dpopulation=10` (here, for 10 individuals).
- `-Dtest_dir=crash-reproduction-tests`, the output directory where the tests will be created (if any test is generated). This value may be modified using `-Dtest_dir=newoutputdir`.

To check the list of options, use:

```sh
$ java -jar botsing-reproduction.jar -help
usage: java -jar botsing-reproduction.jar -crash_log stacktrace.log -target_frame 2

-project_cp dep1.jar;dep2.jar )
-crash_log <arg> File with the stack trace
-D <property=value> use value for given property
-help Prints this help message.
-project_cp <arg> classpath of the project under test and all its
dependencies
-target_frame <arg> Level of the target frame
```

#### Example

```
java -jar botsing-reproduction.jar -crash_log LANG-1b.log -target_frame 2 -project_cp ~/bin
```


## Contributing

Expand All @@ -14,6 +59,18 @@ Botsing is licensed under Apache-2.0, pull request as are welcome.

The coding style is described in [`checkstyle.xml`](checkstyle.xml). Please (successfully) run the command `mvn checkstyle:check` before submitting a pull request.

### Building Botsing

Currently, Botsing using a customized version of the EvoSuite-client. Hence, the building process contains two steps:
1- Installing the customized version of EvoSuite-client:
```
mvn install:install-file -Dfile=botsing-reproduction/evosuite-client-botsing-1.0.7.jar -DgroupId=org.evosuite -DartifactId=evosuite-client-botsing -Dversion=1.0.7 -Dpackaging=jar
```
2- Build the Botsing project:

```
mvn package
```

### Adding a dependency

Expand All @@ -40,7 +97,50 @@ And referenced in the dependencies of the module using the following syntax:
```
Please check in the list of properties that the dependency version is not already there before adding a new one.

#### botsing preprocessing

The latest version of Botsing command line (botsing-preprocessing-X-X-X.jar) is available at [https://github.com/STAMP-project/botsing/releases](https://github.com/STAMP-project/botsing/releases).

Botsing preprocessing has these mandatory parameters:
- `-i` represents the input file path (`crash_log`) with the stack trace to clean. For example `-i=path-name-of-crash-log`
- `-o` represents the output file path (`output_log`) cleaned of the error message and/or nested exceptions. For example `-o=path-name-of-output-log`

These parameters define actions to perform (clean) in the stack trace:
- `-f` to flatten the stack trace.
- `-e` to remove the error message.

- `-p` to set the regexp in the stack trace use case. For example `-p=my.package.*`

#### Example

To clean the nested stack trace

```
java -jar botsing-preprocessing.jar -i=crash_log.txt -o=output_log.log -f -p=com.example.*
```

or to remove the error message

```
java -jar botsing-preprocessing.jar -e -i=crash_log.txt -o==output_log.log
```

Note that you can use also both actions (`-f` and `-e`).

## Background

Botsing (Dutch for 'crash') is a complete re-implementation of the crash replication tool [EvoCrash](http://www.evocrash.org) ([github](https://github.com/STAMP-project/EvoCrash)).
Whereas EvoCrash was a full clone of EvoSuite (making it hard to update EvoCrash as EvoSuite evolves), Botsing relies on EvoSuite as a (maven) dependency only. Furthermore, it comes with an extensive test suite, making it easier to extend. The license adopted is Apache, in order to facilitate adoption in industry and academia.

The underlying evolutionary algorithm and fitness function are described in:

* Mozhan Soltani, Annibale Panichella, and Arie van Deursen. Search-Based Crash Reproduction and Its Impact on Debugging. _IEEE Transactions on Software Engineering_, 2018. ([DOI](http://dx.doi.org/10.1109/TSE.2018.2877664), [preprint](https://pure.tudelft.nl/portal/en/publications/searchbased-crash-reproduction-and-its-impact-on-debugging(1281ce36-7afc-43d9-ad83-b69c60fbd49a).html))

* Mozhan Soltani, Pouria Derakhshanfar, Annibale Panichella, Xavier Devroey, Andy Zaidman, and Arie van Deursen. Single-objective versus Multi-Objectivized Optimization for Evolutionary Crash Reproduction. In Colanzi and McMinn, editors, _Search-Based Software Engineering - 10th International Symposium, SSBSE 2018 - Proceedings_. Lecture Notes in Computer Science, Springer. 2018. p. 325-340. ([DOI](http://dx.doi.org/10.1007/978-3-319-99241-9_18), [preprint](https://pure.tudelft.nl/portal/en/publications/singleobjective-versus-multiobjectivized-optimization-for-evolutionary-crash-reproduction(ccece8a1-79cd-4303-adca-34a920bf7d14).html)).


## Funding

Botsing is partially funded by research project STAMP (European Commission - H2020)
![STAMP - European Commission - H2020](https://github.com/STAMP-project/docs-forum/blob/master/docs/images/logo_readme_md.png)
Botsing is partially funded by research project STAMP (European Commission - H2020) ICT-16-10 No.731529.

![STAMP - European Commission - H2020](docs/logo_readme_md.png)
22 changes: 22 additions & 0 deletions botsing-commons/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>botsing</artifactId>
<groupId>eu.stamp-project</groupId>
<version>1.0.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>botsing-commons</artifactId>
<dependencies>
<dependency>
<groupId>org.evosuite</groupId>
<artifactId>evosuite-client-botsing</artifactId>
<version>${evosuite-client.version}</version>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package eu.stamp.botsing.commons;

import eu.stamp.botsing.commons.instrumentation.InstrumentingClassLoader;


public class BotsingTestGenerationContext {

private static final BotsingTestGenerationContext instance = new BotsingTestGenerationContext();

private InstrumentingClassLoader classLoader;
private ClassLoader originalClassLoader;

private BotsingTestGenerationContext(){
originalClassLoader = this.getClass().getClassLoader();
classLoader = new InstrumentingClassLoader();
}


public static BotsingTestGenerationContext getInstance() {
return instance;
}

public void goingToExecuteSUTCode() {

Thread.currentThread().setContextClassLoader(classLoader);
}


public void doneWithExecutingSUTCode() {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}

public InstrumentingClassLoader getClassLoaderForSUT() {
return classLoader;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package eu.stamp.botsing.commons.instrumentation;

import org.evosuite.Properties;
import org.evosuite.assertion.CheapPurityAnalyzer;
import org.evosuite.graphs.cfg.CFGClassAdapter;
import org.evosuite.instrumentation.*;
import org.evosuite.runtime.RuntimeSettings;
import org.evosuite.runtime.instrumentation.*;
import org.evosuite.runtime.util.ComputeClassWriter;
import org.evosuite.seeding.PrimitiveClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.commons.SerialVersionUIDAdder;
import org.objectweb.asm.util.TraceClassVisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.PrintWriter;

public class BotsingBytecodeInstrumentation {

private static final Logger LOG = LoggerFactory.getLogger(BotsingBytecodeInstrumentation.class);
public byte[] transformBytes(ClassLoader classLoader, String className, ClassReader reader) {

TransformationStatistics.reset();

int asmFlags = ClassWriter.COMPUTE_FRAMES;
ClassWriter writer = new ComputeClassWriter(asmFlags);

ClassVisitor cv = writer;
if (LOG.isDebugEnabled()) {
cv = new TraceClassVisitor(cv, new PrintWriter(System.err));
}

if (Properties.RESET_STATIC_FIELDS) {
cv = new StaticAccessClassAdapter(cv, className);
}

if (Properties.PURE_INSPECTORS) {
CheapPurityAnalyzer purityAnalyzer = CheapPurityAnalyzer.getInstance();
cv = new PurityAnalysisClassVisitor(cv, className, purityAnalyzer);
}

if (Properties.MAX_LOOP_ITERATIONS >= 0) {
cv = new LoopCounterClassAdapter(cv);
}

cv = new RemoveFinalClassAdapter(cv);

cv = new ExecutionPathClassAdapter(cv, className);

cv = new CFGClassAdapter(classLoader, cv, className);

// Collect constant values for the value pool
cv = new PrimitiveClassAdapter(cv, className);

cv = handleStaticReset(className, cv);

cv = new MethodCallReplacementClassAdapter(cv, className);
if(RuntimeSettings.applyUIDTransformation){
cv = new SerialVersionUIDAdder(cv);
}

reader.accept(cv, ClassReader.SKIP_FRAMES);
try{
return writer.toByteArray();
}catch (RuntimeException e){
LOG.warn("Method code is too large");
return new byte[0];
}

}

private static ClassVisitor handleStaticReset(String className, ClassVisitor cv) {
cv = new CreateClassResetClassAdapter(cv, className, Properties.RESET_STATIC_FINAL_FIELDS);
// Adds a callback before leaving the <clinit> method
cv = new EndOfClassInitializerVisitor(cv, className);

return cv;
}


public static boolean checkIfCanInstrument(String className) {
return RuntimeInstrumentation.checkIfCanInstrument(className);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package eu.stamp.botsing.commons.instrumentation;

import eu.stamp.botsing.commons.BotsingTestGenerationContext;
import org.evosuite.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

public class ClassInstrumentation {
private static final Logger LOG = LoggerFactory.getLogger(ClassInstrumentation.class);
public List<Class> instrumentClasses(List<String> interestingClasses){
List<Class> instrumentedClasses = new ArrayList<>();
List<String> instrumentedClassesName = new ArrayList<>();

for(String clazz: interestingClasses){
if(instrumentedClassesName.contains(clazz)){
continue;
}
LOG.debug("Instrumenting class "+ clazz);
Class<?> cls;
try {
Properties.TARGET_CLASS=clazz;
cls = Class.forName(clazz,false, BotsingTestGenerationContext.getInstance().getClassLoaderForSUT());
instrumentedClasses.add(cls);
instrumentedClassesName.add(clazz);
} catch (ClassNotFoundException | NoClassDefFoundError e) {
LOG.warn("Error in loading {}",clazz);
}
}
return instrumentedClasses;
}
}
Loading