SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective...

29
SOFTWARE TESTING PRACTICAL A WORKSHOP BY

Transcript of SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective...

Page 1: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

SOFTWARE TESTING

P R A C T I C A L

A W O R K S H O P B Y

Page 2: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

{ }3 Automated Testing

Page 3: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

BREAKING THE MISSION

1 Software Test Automation

2 How to Automate?

3 Hands-on maneuvering of x-unit tools

4 Implications of Automation

Page 4: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Test Automation

• Software Test Automation

• Controls test execution comparing actual and expected

outcomes

• Software Tester

• writes test scripts and executes with another

software to test the software

• Automated tests once developed, can be run repeatedly

http://www.tutorialspoint.com/software_testing/

Page 5: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Rationale for Test Automation • Manual execution of test plans for regression testing is laborious and time

consuming.

• Test automation is handy for products with long maintenance life

• It can test the application from performance, load and stress point of view.

• Saves time and money compared to error-prone manual testing.

• Improvises test accuracy, coverage and productivity.

• Continuous Integration Testing

Page 6: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

What to Automate???

Choosing an automation tool

Creating a testing infrastructure for automation

Designing of test cases

Development of scripts

Execution of Scripts

Analysis of Results

Sharing the results with team Maintenance of Scripts

Page 7: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Automation Tools• Different tools with respective features are there:

• API Testing

• Junit , Nunit

• GoogleTest

• Visual Studio Test Suite

• GUI Testing

• SilkTest

• TestComplete

• Performance Testing

• LoadRunner

• WebLoad

Page 8: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

NUnit

• NUnit is a unit testing framework for the .NET Language

• NUnit promotes the idea of "first testing then coding“

• NUnit is an open source framework which is used for

writing & running tests

• Provides annotations, assertions and test runners

Page 9: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Environment for NUnit• Microsoft Visual Studio 2010

• .NET 4.0

• NUnit 2.6.0

Page 10: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

xUnit Design

Code to Test

Test Code

Test Runner

Page 11: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Unit Tests in NUnit

• Unit Test is code that ensures another part of code (method) works as

expected.

• Unit tests can be written using a test framework such as Nunit.

• Unit test can be characterized with a known input and an expected output.

• Input corresponds to pre-condition and expected output corresponds to post-

condition.

• Each requirement may have two test cases: positive and negative ones.

Page 12: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Writing Tests using NUnit

• Let’s write our first test……..

Page 13: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Automating Adder Application

• Application: Adder application which takes

two 2-digit no.s and displays the sum.

? 2

? 3

5

Page 14: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Adder Application Test Scenarios -I

Page 15: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Adder Application Test Scenarios -II

Page 16: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

NUnit Features• Assertions

• Equal, Null, True [with respective vice versa]

• Annotations of Nunit• [Test]

• [Test Fixture]

• [SetUp] - before each test method is called

• [Teardown] - after each test method is run

• [TestFixtureSetUp] - performed once prior to executing all tests in fixture

• [TestFixtureTearDown] - performed once after all tests are completed

• [ExpectedException]

• [Ignore()]

Page 17: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Parameterized Tests

• Help in running the same tests over and over again

using different values

• Nunit offers the same feature via[TestCase(12,3,4)]

[TestCase(12,2,6)]

[TestCase(12,4,3)]

public void DivideTest(int n, int d, int q)

{

Assert.AreEqual( q, n / d );

}

Page 18: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Generating Test Documentation[TestFixture, Description("Fixture description")]

public class SomeTests

{

[Test, Description("Test description here")]

public void DocTest()

{

/* ... */

}

}

Page 19: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Do and Don’t of Test Automation• Smoke Testing

• Run with every build to make go/no-go decision on deeper testing.

• Regression Testing • Assures that a change, bug fixes or new functionality , did not introduce new bugs

• Data Driven Testing • Testing the operations with their related data sets in a framework

• Exception or Negative Testing • Forcing error conditions in the system.

• Functional Testing • Testing that operations perform as expected for relatively stable application

• Testing on different Operating Systems/Environments

• Repetitive tasks

Page 20: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Do and Don’t of Test Automation

• Exploratory testing

• Usability testing

• Documentation Testing

• Graphics Testing

• For Features which are under changes/unstable

Page 21: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Software Testing, A research Perspective

• Automated Tools for Reliability calculation of Critical system

• Test Case Generation for Regression testing

• Test Case prioritization technique

• Software testing in offshore culture with agile models

• Testing of e-Governance applications.

Page 22: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

END OF UNIT 3

Page 23: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

{ }4 Unit

Exploratory Testing

Page 24: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Learning

Find bugs

Find/Execute

Tests

Photo from: http://blog.kevineikenberry.com/leadership-supervisory-skills/leadership-and-juggling-the-unlikely-lessons/

Page 25: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

• Week 1: “We are learning the system”

• Week 2: “We are learning the system”

• Week 3: “We are designing test cases”

• Week 4: “We are finalizing test cases”

• Week 5: “We are running tests”

• Week 6: “We are finding bugs”

TYPICAL TESTING STATUS

Page 26: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Exploratory testing is

simultaneous learning, test

case design and execution.“ “

Page 27: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

Exploratory Testing

Charter

Page 28: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

{ }5 Exercise

Exploratory Testing in action!

Page 29: SOFTWARE TESTING - knowledgetester.files.wordpress.com · Software Testing, A research Perspective • Automated Tools for Reliability calculation of Critical system • Test Case

END OF UNIT 4