View Code? Open in Web Editor
NEW
This repository provides the accompanying dockerized code play ground for teaching state-based testing. The code utilizes a UML state-machine to generate JUnit test cases using the known N+ strategy (by Binder).
statebasedtestcasegeneration's Introduction
StateBasedTestCaseGeneration
Will deal with only first region of the state machine.
History, Deep History, Decision Pseudo States may cause an exceptions.
Assumes state observability and a flattened state-machine
Running manually written unit test
Transition Tree Generation from statemachine
Test case Generation for conformance and sneak paths
Ability to make edits to generated tests
Running generated and manual unit tests on mutants
How to Run the Code Play Ground?
Clone the master
branch
Install and open Docker Desktop (preferable version: 4.31.1), make sure that the engine is up and running.
Open /StateBasedTestCaseGeneration/demo/
in terminal
Run the following commands in terminal
docker build -t capsule .
(to build the image)
docker run -d -v my_src_volume:/src -v my_models_volume:/Models -v my_jarfile_lib_volume:/jarfile_lib -p 8080:8080 --name capsule_container capsule
(to run the container)
docker logs -f capsule_container
(to get logs of container)
The app should be up and running, navigate to http://localhost:8080/
in your browser
If you want to stop/start the app use docker stop/start capsule_container
statebasedtestcasegeneration's People
Contributors
Watchers
statebasedtestcasegeneration's Issues
Should handle all the Pseudo States.
The application should be converted to a web-based application and dockerized. The idea is that the web application contains the following:
A page motivating state-based testing
SUT page displaying editable files for the SUT
Unit Tests: A page displaying an empty unit test suite that the students can write an execute test on
Modeling: A page displaying the SUT state machine
Test Generation: A page for generating, editing, and executing all round trip paths tests and sneak paths tests
Evaluation: A page that injects (state-level) mutants to the SUT and calculates mutation kill score for the unit tests and the generated tests.
While generating test cases for All Transition coverage, the tool generates some extra empty Test methods (need to figure out why).
Sneaky paths to be tested with the automated suite. The idea is to generate tests that cover "hidden" paths in the state machine.
If in case an input of multi-region SM is received should flatten the SM first.
Now, in the generated tests, we ask (in generated comments) to satisfy the guards. This needs automation may be a SAT solver? We assume that the variables used within the guards' text are available in the class, and then all we need is to solve the inequalities/equalities.
Currently, the code relies on the input of a separate state machine model. It would be good to modify the code such that:
-It takes in UML class diagram and extracts all the state machines from it
-run the test generation code for each of the owned state machines