spring-webflow icon indicating copy to clipboard operation
spring-webflow copied to clipboard

Add a Flow Definition Execution Test Coverage Tool [SWF-316]

Open spring-operator opened this issue 17 years ago • 10 comments

Keith Donald opened SWF-316* and commented

Currently there is no way to measure the quality of a FlowExecution test. It is thought a listener that could track the paths exercised by a test and compare that to the total possible paths would provide good insight into test coverae and quality.


Affects: 1.0.3

Attachments:

6 votes, 7 watchers

spring-operator avatar May 25 '07 05:05 spring-operator

Kris Ramanah commented

This is a first draft and much remains to do. But the basic is being done, i.e, the states traversed are displayed in green and those not traversed are displayed in red.

Ps. I have started web flow only 2 weeks ago and far from being an expert and I would really appreciate all the advice anybody could give me on this.

spring-operator avatar Aug 05 '07 04:08 spring-operator

Kris Ramanah commented

Made some refactoring in the code and and some changes in the documentation. Some of the states were displayed without syling and I am looking into the matter.

I am still waiting for some guidance or feedback.

spring-operator avatar Aug 06 '07 04:08 spring-operator

Kris Ramanah commented

The latest application contains a sample application, created in eclipse, which you guys can test to see if you are getting the desired results. Give me some feedback as well. Much still remains to be done about the display however and I will be working on it from now onwards.

spring-operator avatar Aug 07 '07 06:08 spring-operator

Kris Ramanah commented

I forgot to mention that the jars that will be required to run the sample project are: 1.) spring-webflow 1.0.1 2.) spring-beans 2.0 3.)spring-context 2.0 4.) spring-web 2.0 5.) spring-support 2.0 6.) junit 7.) commons-logging 8.) ognl

spring-operator avatar Aug 07 '07 06:08 spring-operator

Keith Donald commented

We are aware of your contribution and will definitely integrate it. We're busy working on Web Flow M2 right now, currently support for Web Flow Test coverage is scheduled later in the 2.0 release train. We aren't ignoring tihs issue, we just haven't yet budgeted time to look at this given other pre-requisite and high priority features.

spring-operator avatar Sep 04 '07 14:09 spring-operator

Kris Ramanah commented

unzip the file, place it as a package in your src/main/java folder, and use it in your tests or in on your -servlet.xml file.

In your tests, use the method setFowExecutionListener to inject it. In the -servlet file, create the bean

<bean id="coverageListener" class="org.springframework.webflow.test.coverage.CoverageFlowListener"> <constructor-arg index="0" value="c:/applicationName/coverageLogs/" /> <constructor-arg index="1" value="current-flow" /> </bean>

Then inject this listener in flow executor

<flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation">
    <flow:execution-listeners>
        <flow:listener ref="coverageListener" criteria="*"/>
    </flow:execution-listeners>

</flow:executor>

Let me know if you guys are able to use it or not

spring-operator avatar Sep 06 '07 03:09 spring-operator

Kris Ramanah commented

The coverage tool is starting to look like the user clover reports for Java files. I have to mention that I have used the css file and Img folder that clover usually generates. Maybe you guys could ask permission to use this.

the code will be published in the coming 2 weeks after some refatcoring and testing

spring-operator avatar Sep 25 '07 05:09 spring-operator

Kris Ramanah commented

The flow-coverage attachment contains the latest changes that were made. It has a pom.xml which you can use to build the project and then import in your IDE.

1.) Create the directory 'C:\Projects\Research\coverage\logs' 2.) extract the attachment 'clover_stuff' and place the contents(an img folder and a css file) in the directory above 3.) run the tests from the project from your IDE.

You should see the path traversed and the coverage at the bottom of the HTML file. It also contains the tracer listener, issue #196, and a test to show how it should work.

Let me know what you think of it.

spring-operator avatar Oct 26 '07 16:10 spring-operator

Kris Ramanah commented

There will be a slight change to the way the reporting is done now. I will try to log the coverage in an XML file. The path where these XML files should be created will be stored in a flow.properties file. In that way, the data will be available for other coverage tools such as, EMMA and CLOVER, to pick up and aggregate to the overall coverage. If they want to display the path coverage in their own way they can have their own XSL file for that purpose. This new version will be posted soon enough.

spring-operator avatar Dec 21 '07 02:12 spring-operator

Kris Ramanah commented

The new version of the coverage logger is in the atachment named 05_01_08. It constains 1.) documentation about the logger 2.) a maven 2 project (flow-coverage) Setup the project mvn clean install eclipse:eclipse You can run the MauritiusXMLFlowCoverageTest and see how it works.

spring-operator avatar Jan 05 '08 05:01 spring-operator