lms24 / jsr Goto Github PK
View Code? Open in Web Editor NEWJSR - The Java Test Suite Reduction Framework
License: MIT License
JSR - The Java Test Suite Reduction Framework
License: MIT License
Just the basic functionality:
Very handy to check and read checked coverage results
To avoid endlessly growing output files
Everything related to logic, behaviour, interactin w/ tools etc.
Afterr the involuntary downgrade to JDK11, I really want to get this project up to date to JDK17. Main Problem: SL4J compatibility.
After the last meeting, a request was made to slightly change the FSL export behaviour:
Tasks:
As discussed, another greedy algorithm should be added for better comparability, since the genetic algorithm isn't working particularily well. The decision was made to implement the delayed greedy algorithm heuristic as described by Tallaman and Gupta 2005.
Simple CLI to interact w/ the core library
For computing checked coverage, we have to create a dynamic slice using the tool Slicer4J.
After hours of figuring out how to work with this tool, we finally figured out how to compute the dynamic slice of a test case's statement.
We used the python script for it, as it provides a nice facade to hide the slicer's complexity. Especially for TC dynamic slicing this is extremely helpful.
main
and test
classes plus additional libraries has to be created before calling the slicer. Since fat jars usually only contain main
classes and their libraries, I shall therefore call this type of jar "extra fat jar" or for shits and giggles "Alfred Gusenbauer Jar" (AG-Jar).To create such a jar, we used gradle for our projects. However, this is a cumbersome task, considering that gradle syntax seems to change weekly and almost no Stackoverflow et al. answers are usable without modifications. Therefore, we find our first challenge:
Now that we have our AG-jar, we need to call the slicer. Slicer4J works in three steps:
As already stated, it's best to use the python script. It is called in the following way:
python3 slicer4j.py
-j <path-to-AG-jar>
-o <output-directory>
-b <slicing-criterion>
-tc <full test class name>
-tm <test method name>
An example call from the Slicer4J/scripts
directory:
python3 slicer4j.py
-j ../../../../master-utils/build/libs/testJar.jar
-o utils-out/
-b "at.tugraz.ist.stracke.jsr.CalculatorTest:39"
-tc "at.tugraz.ist.stracke.jsr.CalculatorTest"
-tm "divideZeroByNotZero"
During compilation we observed some JDK level problems:
The slicer and the slicing core have to be compiled with JDK-8 (at least on my system, else I get JAVA_HOME not set
errors)
The provided JUnit runner's and the test classes' JDK levels have to match and the SUT's syntax has to be <=JDK-9.
Challenge 2: Ensure JDK compatibility levels
The provided JUnit runner is a problem in itself, as it only supports JUnit 4 (which is ancient IMO).
The results from the slicer should be pretty straight forward to work with:
slice.log
is a log file containing the java statements that are in the slice. They are ordered by execution, not by backward slice order.slice-graph.pdf
gives us a nice dot graph to manually inspect the slicetrace.log_icdg.log
contains the intermediate statements from the trace which is used for slicingDebug log files:
instr-debug.log
contains code instrumentation outputtrace_full.log
contains trace outputslice-file.log
contains slicing outputgraph-debug.log
contains graph creation outputWith a few challenges in mind, we can conclude that we can use Slicer4J for dynamic slicing. Thus, checked coverage can be computed. The main challenge will be to create a robust interaction between JSR and Slicer4J to ensure that the slicing is executed correctly and robustly against e.g. different JUnit versions, JDK versions, etc.
If possible, else resort to VSCode
The ultimate goal would be to improve JSR in terms of stability and usability to make it more comofortable to use it.
Perform Evaluation Benchmarks:
This could be done by implementing a context menu when right-clicking a TC item in the results list
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.