Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Model based testing and how to get more out of your automation framework

No description
by

Adrian R.

on 11 June 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Model based testing and how to get more out of your automation framework

About me
From the presentation
What do we mean by model based testing?
What do we mean by acceptance tests?
The journey
Where to start
MODEL
DSL
MODEL + DSL + GRAPHWALKER
What do we mean by model based testing?
model based testing = application of model-based design for designing and optionally also executing artifacts to perform software testing or system testing

...all you need is a MODEL
What do we mean
by acceptance tests?
acceptance test = an external client that
encompasses enough information on how
to drive the system under test in order
to bring it to the point of asserting something
The journey
Managing user authentication

Description:
So that I can manage the authentication on github, as a user I need to be able
to change my username and password

Acceptance Criteria:
Given I'm on my Profile page
When I change my password
Then the new password can be used

Given I'm on my Profile page
When I change my username
Then the new username can be used
Conclusions
testfeed.co.uk
@adyon2004
linkedin.com/in/testfeed
It all started with a story card
Identify the things we want to test...
Start creating ATs
@Test
public void shouldBeAbleToLoginWithNewPasswordWhenPasswordIsChanged()
{
loginUserWithPassword("userBob", "pass111.");
visitProfileForUser("userBob");
changePasswordForUser("userBob", "Password123.");

logout();
loginUserWithPassword("userBob", "Password123.");
}
@Test
public void shouldBeAbleToLoginWithNewUsernameWhenUsernameIsChanged()
{
loginUserWithPassword("userBob", "pass111.");
visitProfileForUser("userBob");
changeUsernameForUser("userBob", "userBobSquarePants");

logout();
loginUserWithPassword("userBobSquarePants", "pass111.");
}
shouldNotBeAbleToLoginWithNewPasswordWhenPasswordChangeFails()
shouldNotBeAbleToLoginWithNewUsernameWhenUsernameChangeFails()

shouldNotBeAbleToChangeUsernameWhenUsernameIsTaken()

shouldNotBeAbleToChangeUsernameWhenLoggedInAsADifferentUser()
shouldNotBeAbleToChangePasswordWhenLoggedInAsADifferentUser()

shouldBeAbleToRevertToMyOldUsernameWhenTheUsernameChangeWasUnintentional()
shouldBeAbleToRevertToMyOldPasswordWhenThePasswordChangeWasUnintentional()

shouldNotBeAbleToChangePasswordWhenPasswordIsInvalid()
shouldNotBeAbleToChangeUsernameWhenUsernameIsInvalid()

....to be continued
End result...
about 50 acceptance tests
The MODEL
Model based testing separates business logic from the implementation of the test code
Increases coverage and allows re-use of the model
Cuts down on test design time
testfeed.co.uk
@adyon2004
linkedin.com/in/testfeed
Developer in Test @ Test Feed

Speaker

Trainer
The DSL
@Test
public void shouldBeAbleToLoginWithNewPasswordWhenPasswordIsChanged()
{
signIn.loginUserWithPassword("userBob", "pass111.");
home.visitProfile();
accountSettings.changePasswordForUser("userBob", "Password123.");

accountSettings.logout();
signIn.loginUserWithPassword("userBob", "Password123.");
}
Connecting the DSL to GraphWalker
@Test
public void runModel() throws InterruptedException, StopConditionException, URISyntaxException
{
ModelHandler modelhandler = new ModelHandler();

File file = new File("AccountSettings.graphml");

modelhandler.add("Account Settings Model", new AccountSettings(file, true,
new RandomPathGenerator(new EdgeCoverage(1.0)), false));

modelhandler.execute("Account Settings Model");

Assert.assertTrue(modelhandler.isAllModelsDone(), "Not all models are done");
}
1. Prepare the model
2. Generate the stub model class
java -jar graphwalker.jar source -f AccountSettings.graphml -t ModelAPI.template
public class ModelAPI extends org.graphwalker.multipleModels.ModelAPI {
private static Logger logger = Util.setupLogger(ModelAPI.class);

public ModelAPI(File model, boolean efsm, PathGenerator generator, boolean weight) {
super(model, efsm, generator, weight);
}
public void e_changePasswordForUser() {
}
public void e_changeUsernameForUser() {
}
public void e_loginUserWithPassword() {
}
public void e_logout() {
}
public void e_visitProfileForUser() {
}
public void v_login() {
}
public void v_logout() {
}
public void v_passwordChanged() {
}
public void v_usernameChanged() {
}
public void v_yourProfile() {
}
}
3. Fill in the methods
4. Run the MODEL
Model based testing and how to get more out of your automation framework
Adrian Rapan
Full transcript