HGustavs / LenaSYS

Code Viewer and Course Organization System used in some courses at University of Skövde
57 stars 31 forks source link

Research test-case generation with state chart models #13276

Closed b21oscpe closed 1 year ago

b21oscpe commented 1 year ago

We currently know very little about how this works and how it is done. Do some research on how test-cases are genereated with state chart models and leave your research as a comment to this issue.

b21oscpe commented 1 year ago

We spoke to @HGustavs yesterday and he said he didn't know either.

In order to elicit functional and non-functional requirements we need to understand what it is we are making.

HGustavs commented 1 year ago

There are articles such as

https://www.sciencedirect.com/science/article/pii/S1319157818311078

or

https://www.researchgate.net/publication/236124971_Automatic_Test_case_Generation_From_UML_State_Chart_Diagram/link/00b7d51638da9d52e8000000/download (but this second article seems to be of lower quality compared to the first article)

that give us complex approaches for this type of generation.

I suggest a much simpler approach. Instead of supporting general programming languages I suggest generating test cases for micro-servce based applications.

So in this case a test case would be url to microssrvice, input data, and expected output data.

The question is how much additional information we need to give the model to be able to give us a base to make this kind of microservice testing.

Just comments for a skeleton for this type of testing is a good first step....

a21aldsa commented 1 year ago

If I understand what you mean, the way about this is to have a user create a state diagram for a micro service and then choose to have tests generated for it:

Then the site will create a state chart intermediate tree graph, based on the users state diagram, using round trip path either via breadth first or depth first; whichever one proves to be more efficient. Then, the site outputs this to the user for academic purposes, so they can better understand whats happening. Then, using the round trip path state algorithm as described in the article you posted (Transition coverage based test case generation from state chart diagram), we generate the sequence of the transitions in the state chart intermediate tree graph. This, too, gets outputted to the user, preferably with some text accompanying it explaining what has happened. And then from here the site somehow creates test cases for these transitions? And then tests them itself?

Am I understanding this correctly?

I am also quite confused as to what you mean by "url to microssrvice". What microservice?

b21oscpe commented 1 year ago

I have created a document that concludes how far i came with my own research that the other participants of this issue can take part of / extend. https://docs.google.com/document/d/1M68ByYYYCR5snbiIuvaENWWGqpZOMr6ISvJOj9DM3LI/edit?usp=sharing

ghost commented 1 year ago

The info that is going to be needed in order to generate any test cases is edges and nodes. Predicates might also be needed depending on which requirements we want to cover. The full research can be found in the document.

b21oscpe commented 1 year ago

@HGustavs

We have concluded that as a first steppingstone we are going to generate a SCIG (State Chart Intermediate Graph) from the state chart model by reusing the ideas that come with ER-table generation. When the SCIG is generated we will apply the ATP algorithm (See article for further explanation: https://www.sciencedirect.com/science/article/pii/S1319157818311078). We came to the conclusion that this algorithm was the easiest to apply. When we have generated a Sequence of transitions from the given SCIG and applied ATP we thought that this could be displayed as output to the user. The next step would be to make it possible to compare algorithms for generating sequences of transition / test suites, for example with a dropdown. The final step, if we have enough time, would be to create test cases from our test suites although we do not have a general idea of how this should be automatically generated yet.

b21oscpe commented 1 year ago

This is made with the assumption of a "Lab" / "Experiment" kind of experience for the user as discussed on our weekly meeting. Rather than a highly functional model-to-code system

HGustavs commented 1 year ago

Sounds good. Be careful if suggested algorithm from research paper looks simple but in reality has a lot of hidden complexity.

Simplest possible test scripts generated form state transitions.