Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing in Agile Software Development

Testing in Agile Software Development

Slide deck prepared for an internal training program on Agile software development in late 2010.

This deck covers the concepts and application of testing and test automation in agile project deliveries using storytelling and hands-on exercises.

Avatar for Unmesh Gundecha

Unmesh Gundecha

October 11, 2010

More Decks by Unmesh Gundecha

Other Decks in Technology

Transcript

  1. Learning Objectives • Explain Software test automation and application in

    Agile software development • Recognize the benefits of test automation • Identify various testing tools and select a testing tool for test automation • Explain test driven development & acceptance testing, create unit & acceptance tests
  2. Meet Rajesh & Pooja…. Rajesh and Pooja are working together

    in a team, building a revolutionary new online sales- frontend for a Petshop using agile software development method "Scrum"
  3. Rajesh is working on the Shopping Cart Page and Pooja

    is helping him in testing these features… To Do WIP Done
  4. These are the user stories Rajesh & Pooja are working

    on for Shopping Cart Page features in current Sprint:
  5. Rajesh already stressed with sprint backlog, spends most of his

    night fixing defects. He gives a new build for testing to Pooja next morning…
  6. While Pooja is retesting earlier bugs, she finds that functionality

    working earlier is broken. This happened after changes made by the user interface team did not go well with Rajesh’s change… …now Pooja needs to test everything again while they are about to finish the sprint leaving other important features untested…..
  7. Finally sprint is over, features are demoed to the Customer.

    As release date is nearing, the Product Owner and customer is disappointed about the defects and quality of the system and the lost customer value…
  8. In Sprint Retrospective meeting Rajesh and Pooja discuss the problems

    they are facing with other members of the Scrum team and the Scrum master
  9. A Quick Check • What problems Rajesh and Pooja are

    facing? • What can be improved here, and how?
  10. They do some research, consult friends & colleagues in other

    teams and suddenly find an idea... Using software test automation!! the Scrum master suggests Rajesh and Pooja to find whether automation can help….
  11. Wait a minute, What’s all about automation? An Industrial Robot

    in a car production line A bomb disposal robot, saving innocent lives An iRobot cleaning your home
  12. “Test automation is the use of software to control the

    execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process” {Wikipedia} Software Test Automation
  13. The Agile Testing Pyramid The top tier will the least

    automated tests because this level is usually composed of UI tests that are expensive to write or maintain and that often require human control (over visual aspects for instance) The bottom tier has to be automated the most: it gives the best ROI as unit tests can be easily written by developers and gives them an immediate feedback. The more automated unit tests, the stronger will be the foundation The middle tier is more difficult to automate than the foundation and tests at this level will be focused on business-facing tests. These functional tests will give an answer to the question “are we building the right thing”. It will ensure functionalities match the requirements Manual Tests
  14. Implementing Test Automation • Get the Management Support • Define

    Goals for Test Automation • Track the Progress using Goals and metrics • Choose right tools!!
  15. Personal Story When I was kid, I had a dream

    to build my own Robot...but I don't know electronics or mechanics!!
  16. MINDSTROM NXT 2.0 Pros: Gives you many features out of

    the box Highly Flexible with other LEGO Parts You can build many models from same set Cons: Very costly (including operating cost) Additional features not available easily and they cost a lot Limited help/user Community Proprietary programming language and limited sense of achievement 
  17. ARDUINO Pros: Cheap Supports 100s third party components Endless possibilities

    Help/User Community Gives great sense of achievement ☺ Cons: Does not give out of the box features, you need to build.. Sometimes time consuming and need greater understanding of electronics and mechanics
  18. Tool Name Area Description Scripting/Programming Languages HP QuickTest Pro Functional

    Testing Market leading functional testing tool. Supports various technologies including Web, Java, .NET, Standard Windows, Silverlight, Oracle, Mainframe etc. VBScript IBM Rational Functional Tester Functional Testing Supports Standard Windows, Java, .NET and Mainframe Applications Java, VB.NET SmartBear TestComplete Unit, Functional Testing, Load & Performance Testing Second largest selling tool. Supports Standard Windows, Java, .NET Applications VBScript, C# Microsoft Visual Studio Test Professional Unit, Functional & Load Testing, Test Management Recently launched tool from Microsoft. Supports complete testing life cycle for Standard Windows, Web & .NET Applications C#, VB.NET Major commercial testing tools
  19. Tool Name Area Description Scripting/Programming Languages xUnit (JUnit, NUnit. dbUnit)

    Unit Testing, API Testing Supports major development platforms Java, C# etc. (planform specific variants available) Selenium Functional Testing Supports Web Applications Java, C#, Python, Perl, Ruby WATIR Functional Testing Supports Web Application Ruby SoapUI Web Services Testing Supports Testing of Web Services Java, XML Major free & open source testing tools
  20. Test Driven Development • Test-Driven Development (TDD) is the practice

    of writing a unit test before writing any code • This can be done relatively quickly, with the developer writing the test, then writing the code, and then running the test in small increments • Tools like xUnit Frameworks are used in TDD
  21. Test Driven Development TDD ensures the code is consistently refactored

    for a better design. TDD has the following distinct benefits: • It contributes to better overall system design by reducing code duplication and other anomalies • It forces programmers to think about end results first, which increases the likelihood that the code will meet customer needs • It increases test coverage for the system under development, which uncovers more defects and reduces what Kent Beck, author of Test Driven Development by Example, calls defect density
  22. package com.tests; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import

    org.junit.Test; public class CalcDiscountTests { @Before public void setUp() throws Exception { } @Test public void testGetDiscount() { fail("Not yet implemented"); } @After public void tearDown() throws Exception { } }
  23. package com.shoppingcart; public class CalcDiscount { public CalcDiscount() { }

    public double getDiscount(double total, int discount_level) { } }
  24. package com.tests; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test;

    import com.shoppingcart.CalcDiscount; public class CalcDiscountTests { CalcDiscount cd = new CalcDiscount(); @Before public void setUp() throws Exception { } @Test public void testGetDiscount() { Assert.assertEquals(10, cd.getDiscount(100.00,10),0); } @After public void tearDown() throws Exception { } }
  25. package com.shoppingcart; public class CalcDiscount { public CalcDiscount() { }

    public double getDiscount(double total, int discount_level) { double discount; discount = total * discount_level / 100; return discount; } }
  26. package com.tests; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test;

    import com.shoppingcart.CalcDiscount; public class CalcDiscountTests { CalcDiscount cd = new CalcDiscount(); @Before public void setUp() throws Exception { } @Test public void testGetDiscount() { Assert.assertEquals(10, cd.getDiscount(100.00,10),0); } @After public void tearDown() throws Exception { } }
  27. What's Selenium? • Selenium is most famous open source tool

    for functional system & acceptance testing for web applications • Selenium supports tests on multiple browsers including FireFox, Internet Explorer, Chrome, Safari etc. on Windows, Linux & Mac • Selenium provides a rich set of testing features
  28. with the power of test automation you deliver on time,

    within budgets and with highest quality levels...
  29. What’s in Video? • What challenges for QA & testing

    in Agile? • Goals for using test automation? • Levels of test automation applied? • Benefits realized? • Measure of success?
  30. Quiz In Agile testing pyramid which layer gives best value

    for money for implementing test automation? ❑Acceptance Tests ❑Unit Tests ❑Beta Tests ❑Performance Tests
  31. Quiz The refactor part in Red-Green-Refactor signifies what? ❑Removing the

    Unit Tests ❑Completion of the Feature ❑Further optimizing the code implemented for the feature ❑None of the above
  32. Quiz You can use Selenium to automate which types of

    tests? (select all that apply) ❑Functional Tests ❑Unit Tests ❑Acceptance Tests ❑System Tests
  33. Q&A