Giter VIP home page Giter VIP logo

a66as / statebasedtestcasegeneration Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 100.67 MB

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).

Java 100.00%
java emf mbt uml-state-machine state-based-testing testing-tools test-automation junit junit4 eclipse

statebasedtestcasegeneration's Introduction

StateBasedTestCaseGeneration

Limitations

  • 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

What is Implemented?

  • 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

a66as avatar mhwaqas7232 avatar

Watchers

 avatar  avatar

statebasedtestcasegeneration's Issues

Dockrized web version for teaching state-based testing

The application should be converted to a web-based application and dockerized. The idea is that the web application contains the following:

  1. A page motivating state-based testing
  2. SUT page displaying editable files for the SUT
  3. Unit Tests: A page displaying an empty unit test suite that the students can write an execute test on
  4. Modeling: A page displaying the SUT state machine
  5. Test Generation: A page for generating, editing, and executing all round trip paths tests and sneak paths tests
  6. Evaluation: A page that injects (state-level) mutants to the SUT and calculates mutation kill score for the unit tests and the generated tests.

Empty Test Methods

While generating test cases for All Transition coverage, the tool generates some extra empty Test methods (need to figure out why).

Solver for the guards

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.

Extract State-Machine object from class ownedBehaviour

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.