Skip to content

Instantly share code, notes, and snippets.

@clintonyeb
Created December 22, 2019 02:31
Show Gist options
  • Save clintonyeb/51931736c4def485927934d50e146ab5 to your computer and use it in GitHub Desktop.
Save clintonyeb/51931736c4def485927934d50e146ab5 to your computer and use it in GitHub Desktop.
How to Setup MuJava on Windows 10

CSI 3373 Assignment 13 (A13)

Due: December 9, Monday, 11:55pm

Objective: Using muJava for Java Mutation Testing

Tasks

  1. Tool Review: Read the tool overview on muJava Version 4 home page - a hardcopy of the page will also be provided. Note: Do not start downloading or running the tool yet.
  2. Create a sub-folder mujava on C: drive.
  3. Download the following files to your mujava folder:
  1. Complete the following three steps as instructed in the 1. Environment Settings section on muJava home page:

  2. CLASSPATH, slight difference from the instructions:

    1. Hit the windows button on your keyboard
    
    2. type "Edit environment variables for your account".
    
    3. add a new User variable, called CLASSPATH. Set the value of this variable to C:\mujava\mujava.jar;C:\mujava\openjava.jar;C:\Program Files\Java\jdk1.8\lib\tools.jar.
    
  3. setting the config file

  4. creating subdirectories

Note: Cal.java should be moved to Mujava_Home\src and all commands should be run in the directory that contains "mujava.config".

  1. To test a method cal(...) using muJava, complete the following step:
  2. Enclose the method *cal() *from *Cal.java *in src folder and its complied class file in class folder respectively. Note that you should work with four subdirectories as listed below:
MuJava_HOME\src directory for Java files under test
MuJava_HOME\classes directory for compiled classes of Java files from MuJava_HOME\src
MuJava_HOME\testset directory for test sets
MuJava_HOME\result directory for generated mutants
  1. Generate mutants with muJava (Refer to* *2. Generating Mutants with muJava section on muJava home page).
    1. First, generate all traditional mutants.
    2. Compare the provided types of traditional mutants with the list given in the textbook. Summarize the differences in two lists and your mutants generation results (i.e., # mutants generated for each operator, etc.) in YourLastNames_A13.docx.
    3. Regenerate mutants only for the following operators: AOR, ROR, COR, UOI and SVR.
    4. Summarize your new mutants generation result in YourLastNames_A13.docx.

Note: When you try to run the GUI from command line with:

"java mujava.gui.GenMutantsMain", you might get an error saying “could not find or load main class mujava.gui.GenMutantsMain”. It means that your class path does not contain the mujava.jar. Set the CLASSPATH carefully.

  1. Make a test set. (refer to* 3. Making a test set *section on muJava home page). Make sure to add the JUnit library to the CLASSPATH.
  2. Run mutants. (refer to* 4. Running mutants *section on muJava home page)
  3. Summarize your mutation testing result. (Include multiple screen captures, as needed, in your summary)
  4. Submit the following files to Canvas via Assignment 13 submission link on Assignments page.
  • YourLastName_A13.docx
  • YourLastName_A13.zip: the compressed file of your *muJava *system home directory

Last revised on November 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment