Presentation is loading. Please wait.

Presentation is loading. Please wait.

Www.synerzip.com Test Driven Development What Works & What Doesnt November 5, 2008.

Similar presentations


Presentation on theme: "Www.synerzip.com Test Driven Development What Works & What Doesnt November 5, 2008."— Presentation transcript:

1 www.synerzip.com Test Driven Development What Works & What Doesnt November 5, 2008

2 Confidential Todays Discussion Synerzip Introduction Agile Development Lifecycle Test Driven Development –Case for TDD & Continuous Integration –User Acceptance Testing –Functional Testing –Unit Testing –Regression Testing –Common Tools & Useful Resources Q & A

3 Confidential Synerzip in a Nut-shell 1.Software development partner for small/mid-sized technology companies Focus: small/mid-sized technology companies Deep experience in product development, testing, & deployment Handles full software development life cycle Technology and industry domain agnostic 2.Actually reduces risk of development/delivery Experienced software management team Brings in appropriate level of engineering discipline Practices Agile development – responsive & disciplined 3. Reduces cost – dual-shore team, 50% cost advantage 4.Offers long term flexibility – allows (facilitates) taking offshore team captive

4 Confidential Our Clients

5 Confidential Todays Discussion Synerzip Introduction Agile Development Lifecycle Test Driven Development –Case for TDD & Continuous Integration –User Acceptance Testing –Functional Testing –Unit Testing –Regression Testing –Common Tools & Useful Resources Q & A

6 Confidential Agile Development Why agile development? –Due to a dynamic, ever changing business environment; requirements change. –Innovation happens when requirements change. –Agile not only allows but encourages requirements to change. –Agile is an iterative show and build process. The customer gets to see some new functionality at the end of each short iteration. Ideas evolve and new requirements get generated when the customer sees something working. –Shorter the iteration closer the compliance with requirements. Challenges of agile development –In a short iteration of 3 weeks if 1 week is required for integration, testing and deployment then only 2 weeks are left for actual coding or development work. –There is an interdependence of TDD and automation.

7 Confidential Common Misconception

8 Confidential Agile Lifecycle – Iterations & QA Small Release Unit and Automated F & R/ UA Testing Iteration Release Planning User Stories Requirements User Acceptance Testing Test Scenarios Iteration Plan Confident Estimates Feedback /Functional Regression Testing Customer Approval

9 Confidential Testing Terminology Unit testing – testing a code component or class. –Coverage is measured against lines of code Functional testing - testing against required functionality by going through the same steps that an end-user will execute. –Coverage is measured against requirements Regression testing – when functional testing is carried out again after fixing defects to ensure that no new bugs get introduced. User acceptance testing – a subset of functional test cases that form the basis on which the release is accepted by the customer.

10 Confidential Agile Lifecycle - Roles Iteration zeroIteration nFinal Iteration Product Owner Requirements analysis Review of product demo and changes User acceptance testing and sign off. Project Manager Estimation and planning Monitoring and re- estimation Monitoring and release notes ArchitectPrototype or POC design Designing and code review Design documents DeveloperEstimation, understanding requirements and coding POC Writing unit tests and code. Writing build automation script Fixing bugs and documentation. QAWriting test casesTesting and some automation Filing bugs and regression testing

11 Confidential Todays Discussion Synerzip Introduction Agile Development Lifecycle Test Driven Development –Case for TDD & Continuous Integration –User Acceptance Testing –Functional Testing –Unit Testing –Regression Testing –Common Tools & Useful Resources Q & A

12 Confidential What is TDD? Test Driven Development (TDD) means capturing the intent of requirements in the form of a test case before starting to code Test case could be a manual test case or an automated test script Test case could be a functional or a user- acceptance or a unit test

13 Confidential TDD Means More Code? Use your judgement, e.g. dont write tests for every getter and setter

14 Confidential TDD in Practice Value of TDD – especially in Agile Tests are more explicit expression of requirements Earlier defect detection by frequent testing Ensures better coverage - dont end up having superfluous code, without tests Challenges – team resistance & reluctance? ROI is realized in the long term – in maint phase Extra coding effort seems unjustified in the beginning Easier said than done- difficult to implement Developer resistance

15 Confidential Role of Continuous Integration Agile development has its roots in lean manufacturing. Stop the line principle at Toyota is implemented in software development by making automated tests a part of the build process. The build fails if even one test fails. This reduces the time-lag between detection of defect and fixing of defect. Ensures timely corrective action. This also ensures that tests are updated to stay in sync with changing requirements.

16 Confidential User Acceptance Testing (FIT) What Works –Wiki based tables are used to express and share requirements or user stories –Test fixtures are written only for significant and complex requirements. Ready made test fixtures are used for simple requirements –Subwikis are used to build test suites What Doesnt –Customer/ product owner doesnt spend enough time reviewing the test cases –Developers spend too much time writing test fixtures –FIT tables dont cover unhappy path. A use case can go wrong in many ways.

17 Confidential Manual Functional Testing What Works –Better expression of requirements by insisting on writing the test cases up front (Note: 70% of defects arise due to faulty requirements) –Better understanding of the requirements by the QA staff –Examples or test data –QA should be a part of the Product Management/BA team What Doesnt –No time allocated by the customer and product owner to review the test cases –Test cases arent updated as new requirements evolve. Need to make sure QA team and Product Mgmt/BAs are always in sync –Test cases are at a high level – but difficult to be useful for generating test data

18 Confidential Unit Testing What Works –Write tests first –Write tests only for the complex methods/units –No significant or complex code is written unless there is a unit test already written for it. What Doesnt –Writing tests later after the code is written. –Completing the formality of writing unit tests for each and every method including accessor methods. –Writing unit tests for legacy code Case Study: A customer started TDD practice by writing unit tests for all the legacy code and ended up testing the tests with the code.

19 Confidential Mechanics of Unit TDD Add some code

20 Confidential Functional/ Regression Testing What Works –Automating only that functionality which has stable manual test cases –Test suites that run as a part of the build process –Test reports automatically published on the wiki What Doesnt –Trying to automate everything. Coverage cant go beyond 70% –Tests scripts that are never integrated into a test suite –Tests are data specific and start breaking when the data changes

21 Confidential Continuous Integration What Works –Separate build tasks for unit, regression and UAT –Quick builds facilitate frequent (continuous) integration –Reports are a part of the build What Doesnt –No distinction in dev, prod and test builds. –Long and tedious builds. Developers attention gets diverted if it takes any longer than 30 secs. –Absence of teardowns to cancel all setup data –Tasks are dropped if the build fails –Untested dependencies

22 Confidential Common Tools Tools ManualJira, Bugzilla, Test Director UnitJunit, Nunit, HttpUnit, DbUnit, SpringUnit etc. Functional and regression Watir, Selenium, QTP, AutoIt, Winrunner, RSpec, Tkl/Tk PerformanceLoadrunner, OpenSta, jMeter, User AcceptanceFitnesse Continuous Integration Maven,Cruise Control, Luntbuild, PMD, FindBugs, Jalopy (automated code review), Clover (code coverage)

23 Confidential Useful Resources http://www.agiledata.org/essays/tdd.html http://www.methodsandtools.com/dynpoll/oldpoll.php?UnitTest2 http://www.testdriven.com/modules/news/ http://www.kevinwilliampang.com/post/Is-Code-Coverage-Really-All- That-Useful.aspxhttp://www.kevinwilliampang.com/post/Is-Code-Coverage-Really-All- That-Useful.aspx http://www.fitnesse.org http://www.rubyforge.org http://selenium.openqa.org http://maven.apache.org/ http://cruisecontrol.sourceforge.net/ http://luntbuild.javaforge.com/ http://pmd.sourceforge.net/ http://jalopy.sourceforge.net/ http://findbugs.sourceforge.net/ http://www.atlassian.com/software/clover/ http://www.developer.com/design/article.php/3700651

24 Confidential Todays Discussion Synerzip Introduction Agile Development Lifecycle Test Driven Development –Case for TDD & Continuous Integration –User Acceptance Testing –Functional Testing –Unit Testing –Regression Testing –Common Tools & Useful Resources Q & A

25 Confidential Contact Information Hemant Elhence (Dallas based) –hemant@synerzip.comhemant@synerzip.com –Cell Phone: 214.762.4873 www.synerzip.com HQ in Dallas, TX –14228 Midway Rd, #130, Dallas, TX 75244 –Office Tel: 469.322.0349 –Office Fax: 469.322.0490 Thanks!


Download ppt "Www.synerzip.com Test Driven Development What Works & What Doesnt November 5, 2008."

Similar presentations


Ads by Google