Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven plugin feature #4

Closed
xdevroey opened this issue Sep 13, 2018 · 7 comments
Closed

Maven plugin feature #4

xdevroey opened this issue Sep 13, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@xdevroey
Copy link
Member

Characteristics

  • Issue Type: feature

Description

Hi @luandrea @danzone !

Similar to dspot and descartes, I have created a maven sub-module dedicated to the botsing plugin. The main to call botsing is available here and the command line parameters are listed here. As you can see, we have drastically simplified the thing ;)

Please do a branch (or fork) and use a pull request for the Maven plugin. I will add a developer guide in the readme of the project. Please take a look at it.

Best,

Xavier

@xdevroey xdevroey added the enhancement New feature or request label Sep 13, 2018
@xdevroey
Copy link
Member Author

xdevroey commented Sep 13, 2018

The main change is: EvoSuite is now an external dependency we rely on in the botsing-reproduction module.

I do not know how logging works with Maven, but we use Slf4J for logging so any compatible logging implementation should work.

Here is an example of usage (I asked Pouria to remove that from the repo, so here is a copy just in case):

public class SimpleCrashReproductionTest {

    public static int target_frame_level = 3;

    public static String user_dir = System.getProperty("user.dir");
    public static String test_dir = Paths.get(user_dir,"src","test","java","eu","stamp","botsing").toString();
    public static String log_dir = Paths.get(test_dir, "sample.log").toString();
    public static String  bin_path = Paths.get(test_dir, "sample_dep").toString();
    private static String separator = System.getProperty("path.separator");

    @Test
    public void runtest(){
        setLoggingLevel(Level.INFO);

        BotSing botsing = new BotSing();
        String[] prop = {
                "-Dcrash_log="+log_dir,
                "-Dtarget_frame="+target_frame_level,
                "-projectCP",
                getListOfDeps(),
        };
        botsing.parseCommandLine(prop);
    }

    public static void setLoggingLevel(ch.qos.logback.classic.Level level) {
        ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
        root.setLevel(level);
    }

    public static String getListOfDeps(){
        String dependencies = "";
        File depFolder = new File(bin_path);
        File[] listOfFilesInSourceFolder = depFolder.listFiles();
        for(int i = 0; i < listOfFilesInSourceFolder.length; i++) {
            if (listOfFilesInSourceFolder[i].getName().charAt(0) != '.') {
                Path depPath = Paths.get(depFolder.getAbsolutePath(), listOfFilesInSourceFolder[i].getName());
                dependencies += (depPath.toString() + separator);
            }
        }
        return dependencies;
    }
}

@pderakhshanfar
Copy link
Collaborator

In addition to the information that Xavier provided, there is a config file in Botsing that you can use it to set the optional parameters of the search process. This config file is here.

@danzone
Copy link
Contributor

danzone commented Sep 17, 2018

Hi @xdevroey @pderakhshanfar , excellent!!! Today we'll start to inspect the code in order to schedule our development activity!

@luandrea
Copy link
Contributor

Hi @xdevroey @pderakhshanfar,
I took a look at the code and tried to configure Botsing through the Maven properties, but I saw that Botsing reads only crash_log and target_frame properties from command line, plus some other properties from ${"user.dir"}/src/main/java/eu/stamp/botsing/config.properties .
I need to configure all properties used by Botsing from my class, What do you suggest to do?

@luandrea
Copy link
Contributor

Hi @xdevroey @pderakhshanfar,
I pushed the first version of the maven plugin in my forked repository, but I cannot go on without resolving the problems that I pointed out in the previous comment. Could you take a look at them?

@luandrea
Copy link
Contributor

I will add them as separate feature to be implemented to better track their status.

@xdevroey
Copy link
Member Author

Merged pull request #17 in commit c123f11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants