1 / 13

Fitnesse (Lab)

Fitnesse (Lab). Alessandro Marchetto Fondazione Bruno Kessler - IRST. Outline. Fitnesse Installation Fitnesse: starting with a running example Exercises Try to install Try to run the running example Try to do the exercises. Install and run Fitnesse. Load http://fitnesse.org

beverly
Download Presentation

Fitnesse (Lab)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fitnesse (Lab) Alessandro Marchetto Fondazione Bruno Kessler - IRST

  2. Outline • Fitnesse Installation • Fitnesse: starting with a running example • Exercises • Try to install • Try to run the running example • Try to do the exercises

  3. Install and run Fitnesse • Load http://fitnesse.org • Click on “Download Fitnesse and Plugins” • Download “fitnesse.jar” • Lunch “java -jar fitnesse.jar” • …. Open a Browser and lunch “http://localhost:80” Please, see the documentation

  4. 2 1 3 Install Fitnesse in Eclipse (I) • Download the Eclipse plugin (in a local directory) • http://www.bandxi.com/fitnesse/com.bandxi.fitnesse_v1.0.2.zip • Install the plugin in your Eclipse • Lunch Eclipse • Select “Help  Software Update…” • Select “Available SoftwareAdd Site Archieve …”

  5. 5.2 6 Install Fitnesse in Eclipse (II) • Chooice the com.bandxi.fitnesse_v1.0.2.zip file and confirm • Click “Install” • (before lunching the installation) Check the correct package only • (during the installation) Read and accept the licence • When restarting Eclipse… the Fitnesse plugin will be installed • (Check the presence of the Fitnesse icons) 4 5.1

  6. Our running example: Sum Calculator public class MySum { public static int sum (int a, int b) { return a+b; } } public class MyFixture extendsColumnFixture { int a,b; public int sum () { return MySum.sum(a,b); } } A full demo: http://softeng.polito.it/courses/tutorial/FitnesseInEclipse.html

  7. Step-by-Step (I) 1. Create a new “Java Project” in Eclipse, called “MathOperators” 2. Write the class “Add” in the package “math” with a method “sum” that takes two integer and returns the sum package math; publicclass Add { publicstaticint sum (int a, int b){ return a+b; } }

  8. 3. In the Eclipse project create a new directory called “Fitnesse” and add the • Fitnesse library to the classpath • select the project  right botton of the mouse New  Folder … • select the project  right botton of the mouse  Fitnesse  Add Fitnesse libraries… • Select the new “Fitnesse” directory and start Fitnesse on it • select the directory  right botton of the mouse FitNesse • Lunch FitNesse runtime on this folder …  Confirm initialization … • … A new fitnesse wiki is starting for the current project 3 4

  9. 5 5. In the wiki click “Edit” to edit the table 6. Edit the table and save it 6

  10. 7. See the table and try to run it. To run: 1. In the wiki click “Properties” to make the page executable 2. Check “Test” and click “Save Properties” 8. In the wiki click “Test” to run the test …  7.1 7.2 8 We need the fixture!

  11. 9. In the Eclipse project create a new package “fitures” 10.In the “fixtures” package create the fixtures.MyFixture fixture extending the ColomnFixture … package fixtures; import math.Add; import fit.ColumnFixture; public class MyFixture1 extends ColumnFixture { public int a; public int b; public int sum(){ int result; return Add.sum(a,b); } }

  12. 11. Now, run again the Fitnesse test …  11

  13. Exercises… • Install Fitnesse • Run the running example • Download the exercise specifications • http://selab.fbk.eu/swat/exercises/fitneese-1.ppt • For each exercise: • Read its specification • Try to apply the black-box testing technique to identify test cases • Implement such test cases in Fitnesse • Run them

More Related