DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Demystifying SPF Record Limitations
  • Application Architecture Design Principles
  • Prompt Engineering: Unlocking the Power of Generative AI Models
  • Execution Type Models in Node.js

Trending

  • Demystifying SPF Record Limitations
  • Application Architecture Design Principles
  • Prompt Engineering: Unlocking the Power of Generative AI Models
  • Execution Type Models in Node.js
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. FitNesse to Perform UAT: Part I

FitNesse to Perform UAT: Part I

FitNesse, a UAT tool, allows users to add and edit test cases on a Wiki page without needing to know any of the technical details.

Arun Pandey user avatar by
Arun Pandey
·
Dec. 14, 16 · Tutorial
Like (6)
Save
Tweet
Share
31.84K Views

Join the DZone community and get the full member experience.

Join For Free

FitNesse is a Wiki web server and an automated user acceptance testing tool where tests can be written on Wiki web pages and can be executed from Wiki.

Users are not supposed to understand the complex software application; they need to simply edit and create new Wiki pages and write the test cases in readable format there itself.

The origin of FitNesse was to better support Agile methodology and to perform User Acceptance Testing. In short, it's a kind of black-box testing in which a System Under Test (SUT) is considered to be a black box and is tested in terms of the outputs generated in response to predetermined inputs.

A functional guy can add the tests as per business and express them within the FitNesse tool. On the other side, the developer's job is to write the code to connect the FitNesse tool to the system that's a candidate for testing so that FitNesse can execute the test and compare the actual output to the expected output.

FitNesse Components

FitNesse looks like this: Front-end (Wiki page) <----> Fixtures (Java or any supported Code) <----> System Under Test (SUT).

Front-End (Wiki Page)

This is basically test tables that invoke the methods in fixture classes and use outputs to determine test success or failure. It's generally written by QA or Business Users.

Fixture

Fixture is basically a Java (or other supported language) code that receieves input from test tables and invoke methods in System under test classes. It's written by developers.

System Under Test (SUT)

This is the actual application which is going to test. It's written by developers.

FitNesse tests may be run on top of either Fit (which is default), using additional fixtures in FitLibrary, or Slim.

The jar fitnesse-20121220-standalone.jar is required.

Running the Fitnesse Wiki Server

To run the Wiki server, make sure that you have Java installed and execute the below command from the directory where your FitNesse jar is present:

java -jar fitnesse-20121220-standalone.jar -p 8086 

(-p here indicates port, which is 8086.)

After the execution of the above command, the server will be started as you can see below:

Image title

Now, you can see the default wiki page in any browser as below:

Image title

After getting the page, click the Edit button, enter the below line as the second-to-last line to add your test suite named MytestSuite, and save.

| [[MyTestSuite][FitNesse.MyTestSuite]]|''MyTestSuite''| 

Now you can see the front page, which has an entry for your test suite as well, as shown below:

Image title

Now, click on the MyTestSuite hyperlink and you will get another page. Click the Edit button on that new page to add all essential one-time set-up data like Jar details, importing packages, etc., as seen below:

!contents -R2 -g -p -f -h
!|${calcTest}|
|val 1|val 2|multiply?|
|8|9|72.0|

Save the page. You can now add a child test suite or test page that actually contains test data. Here, I am adding one child test suite as below:

Image title

After adding the child test suite, it will look like this:

Image title

Add the test page under Child Test Suite and give the name as TestPage1, keeping the below contents:

!contents -R2 -g -p -f -h
!|${calcTest}|
|val 1|val 2|multiply?|
|8|9|72.0|

Now, save the page. It will look like this: 

Image title

In this example, my SUT is a Calculator program.

We are having the Fixture (Java program) take the responsibility of this test. Below, the Fixture is responsible for interacting with the Wiki page that is inside experiment.jar:

package exper.test.fitnesse;
public class SimpleCalculationTest {
  private double val1;
  private double val2;
  private SimpleCalculator calculator = new SimpleCalculator();

  public double multiply(){
    calculator.setVal1(val);
    calculator.setVal2(val2);
    return calculator.multiply();
  }
  public double getVal1() {
    return val1;
  }
  public void setVal1(double val1) {
    this.val1 = val1;
  }
  public double getVal2() {
    return val2;
  }
  public void setVal2(double val2) {
    this.val2 = val2;
  }
}

Now, let's see the SUT:

package exper.test.fitnesse;

public class SimpleCalculator {

  private double val1;
  private double val2;

  public double multiply(){
    return val1 * val2;
  }

  public double getVal1() {
    return val1;
  }

  public void setVal1(double val1) {
    this.val1 = val1;
  }

  public double getVal2() {
    return val2;
  }

  public void setVal2(double val2) {
    this.val2 = val2;
  }
}

Now run the Tests using the Test button. You can see the result on the Wiki page as below:

Image title

That's all. Now, users can add and edit the test cases on the Wiki page without worrying about any of the technical details. Enjoy!

FitNesse Testing System under test Test suite Fixture (tool) Black box Black-box testing Database IT

Opinions expressed by DZone contributors are their own.

Trending

  • Demystifying SPF Record Limitations
  • Application Architecture Design Principles
  • Prompt Engineering: Unlocking the Power of Generative AI Models
  • Execution Type Models in Node.js

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: