SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
An open source library for better Unit Testing



         Woody Zuill & Lynn Langit




                                             Agile 2012 – August 2012
Llewellyn                              Dan




            Who wrote ApprovalTests?
Unit Tests             Unit Tests


        Integration
           Tests


       Function Tests

       Performance
           Tests

        Acceptance
           Tests

        Installation
           Tests
                             Approval Tests
                             and Test Types
DEMO
GETTING STARTED
Building your Testing Toolkit
Test Runner
Test Code
Libraries
Manual tests
Automated tests & tools
TDD - Red, Green, Refactor
Approval Tests make it EASY…
For Woody…                      For Lynn…
• … for human evaluation of     • … in multiple languages
  test results                  • … with visual results…
• … to set up Tests
• … to modify test output for
  readability                   Golden Master

• … to maintain tests
DEMO
EXPRESSIVENESS
Approving the Reported Result
•   Contents are serialized to a file as binary (to compare)
•   Rename *.received to *.approved
•   Right click ‘Use whole file’
•   Copy ‘Move’ statement from Test Results to command window.
More
  about
reporters…
A Little About Reporters
• Reporters provide a rich, expressive, human-friendly view of
  a failed test.
• Reporters usually hook into DiffTools (Text, Image, Sound…)
• Support for many diff tools included in Reporters
• Can add hooks to your favorite diff tool
Best test output has…?
Best test output has...?
Granularity
• What is the result of a break
• What is the specific cause of a break
Feedback
• Frequent (or even constant) feedback

Specification
• What is this code supposed to do?
• How do we use it?
Regression-Proofing
• Did what I just do break something?

Automatic Design Process
• TDD can be thought of as Test Driven Design
DEMO
ARRAYS
Approval Tests in Java…
DEMO
GUIS
Code must be Testable
Code must be Testable

Code must include Tests

Code should be written so that it is easy to write
its required tests

“Reduce to Functional”


Code Tests must be kept runnable
Unit Test Frameworks are Multi-Purpose

 New Code      • Application code (components)


               • Functionality
Testing APIs   • Edge cases

               • Locking tests
Legacy Code    • Characterization tests

Learning new   • Scope
    APIs       • Functionality
Legacy Code

How much of your code base is dead code?
Locking Tests (Characterization Tests)


                Ensures                     Quickly
  Test to                     Most often
              system still                 results in
  enable                      used with
               works the                   high test
refactoring                  Legacy Code
                 same                      coverage
Legacy Code – Chart Smart

DEMO
For More Information




 www.ApprovalTests.com

 Pick your language & download

 Pick your diff tool

 Reference, Approve & Enjoy

 Learn more – videos (.NET)

 Podcast - HerdingCode
@WoodyZuill         @LynnLangit




              Q&A

Mais conteúdo relacionado

Destaque

Agile 2012 the 0-page agile test plan - paul carvalho
Agile 2012   the 0-page agile test plan - paul carvalhoAgile 2012   the 0-page agile test plan - paul carvalho
Agile 2012 the 0-page agile test plan - paul carvalhodrewz lin
 
Agile2012 rev4.pptx
Agile2012 rev4.pptxAgile2012 rev4.pptx
Agile2012 rev4.pptxdrewz lin
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaoladrewz lin
 
Hadoop在反作弊中的应用 林述民
Hadoop在反作弊中的应用 林述民Hadoop在反作弊中的应用 林述民
Hadoop在反作弊中的应用 林述民drewz lin
 
Top100summit用友 池建强-构建企业级应用开发平台
Top100summit用友 池建强-构建企业级应用开发平台Top100summit用友 池建强-构建企业级应用开发平台
Top100summit用友 池建强-构建企业级应用开发平台drewz lin
 
Automated tests workshop
Automated tests workshopAutomated tests workshop
Automated tests workshopdrewz lin
 
Mobile app security
Mobile app securityMobile app security
Mobile app securitydrewz lin
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013drewz lin
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13drewz lin
 
阿里云技术实践
阿里云技术实践阿里云技术实践
阿里云技术实践drewz lin
 

Destaque (10)

Agile 2012 the 0-page agile test plan - paul carvalho
Agile 2012   the 0-page agile test plan - paul carvalhoAgile 2012   the 0-page agile test plan - paul carvalho
Agile 2012 the 0-page agile test plan - paul carvalho
 
Agile2012 rev4.pptx
Agile2012 rev4.pptxAgile2012 rev4.pptx
Agile2012 rev4.pptx
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
 
Hadoop在反作弊中的应用 林述民
Hadoop在反作弊中的应用 林述民Hadoop在反作弊中的应用 林述民
Hadoop在反作弊中的应用 林述民
 
Top100summit用友 池建强-构建企业级应用开发平台
Top100summit用友 池建强-构建企业级应用开发平台Top100summit用友 池建强-构建企业级应用开发平台
Top100summit用友 池建强-构建企业级应用开发平台
 
Automated tests workshop
Automated tests workshopAutomated tests workshop
Automated tests workshop
 
Mobile app security
Mobile app securityMobile app security
Mobile app security
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13
 
阿里云技术实践
阿里云技术实践阿里云技术实践
阿里云技术实践
 

Mais de drewz lin

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearydrewz lin
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrichdrewz lin
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2drewz lin
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2drewz lin
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfdrewz lin
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equaldrewz lin
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21drewz lin
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansendrewz lin
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsdrewz lin
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsdrewz lin
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martindrewz lin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowaspdrewz lin
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usadrewz lin
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013drewz lin
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈drewz lin
 
无线App的性能分析和监控实践 rickyqiu
无线App的性能分析和监控实践 rickyqiu无线App的性能分析和监控实践 rickyqiu
无线App的性能分析和监控实践 rickyqiudrewz lin
 
网易移动自动化测试实践(孔庆云)
网易移动自动化测试实践(孔庆云)网易移动自动化测试实践(孔庆云)
网易移动自动化测试实践(孔庆云)drewz lin
 
天猫后端技术架构优化实践
天猫后端技术架构优化实践天猫后端技术架构优化实践
天猫后端技术架构优化实践drewz lin
 
天猫大促性能测试实践 耿电
天猫大促性能测试实践 耿电天猫大促性能测试实践 耿电
天猫大促性能测试实践 耿电drewz lin
 
互联网海量运维 20130807
互联网海量运维 20130807互联网海量运维 20130807
互联网海量运维 20130807drewz lin
 

Mais de drewz lin (20)

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-keary
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrich
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equal
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansen
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_edits
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowasp
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usa
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈
 
无线App的性能分析和监控实践 rickyqiu
无线App的性能分析和监控实践 rickyqiu无线App的性能分析和监控实践 rickyqiu
无线App的性能分析和监控实践 rickyqiu
 
网易移动自动化测试实践(孔庆云)
网易移动自动化测试实践(孔庆云)网易移动自动化测试实践(孔庆云)
网易移动自动化测试实践(孔庆云)
 
天猫后端技术架构优化实践
天猫后端技术架构优化实践天猫后端技术架构优化实践
天猫后端技术架构优化实践
 
天猫大促性能测试实践 耿电
天猫大促性能测试实践 耿电天猫大促性能测试实践 耿电
天猫大促性能测试实践 耿电
 
互联网海量运维 20130807
互联网海量运维 20130807互联网海量运维 20130807
互联网海量运维 20130807
 

Approval tests agile_aug_2012

  • 1. An open source library for better Unit Testing Woody Zuill & Lynn Langit Agile 2012 – August 2012
  • 2. Llewellyn Dan Who wrote ApprovalTests?
  • 3. Unit Tests Unit Tests Integration Tests Function Tests Performance Tests Acceptance Tests Installation Tests Approval Tests and Test Types
  • 5. Building your Testing Toolkit Test Runner Test Code Libraries Manual tests Automated tests & tools
  • 6. TDD - Red, Green, Refactor
  • 7. Approval Tests make it EASY… For Woody… For Lynn… • … for human evaluation of • … in multiple languages test results • … with visual results… • … to set up Tests • … to modify test output for readability Golden Master • … to maintain tests
  • 9. Approving the Reported Result • Contents are serialized to a file as binary (to compare) • Rename *.received to *.approved • Right click ‘Use whole file’ • Copy ‘Move’ statement from Test Results to command window.
  • 11. A Little About Reporters • Reporters provide a rich, expressive, human-friendly view of a failed test. • Reporters usually hook into DiffTools (Text, Image, Sound…) • Support for many diff tools included in Reporters • Can add hooks to your favorite diff tool
  • 12. Best test output has…?
  • 13. Best test output has...? Granularity • What is the result of a break • What is the specific cause of a break Feedback • Frequent (or even constant) feedback Specification • What is this code supposed to do? • How do we use it? Regression-Proofing • Did what I just do break something? Automatic Design Process • TDD can be thought of as Test Driven Design
  • 15. Approval Tests in Java…
  • 17. Code must be Testable
  • 18. Code must be Testable Code must include Tests Code should be written so that it is easy to write its required tests “Reduce to Functional” Code Tests must be kept runnable
  • 19. Unit Test Frameworks are Multi-Purpose New Code • Application code (components) • Functionality Testing APIs • Edge cases • Locking tests Legacy Code • Characterization tests Learning new • Scope APIs • Functionality
  • 20. Legacy Code How much of your code base is dead code?
  • 21. Locking Tests (Characterization Tests) Ensures Quickly Test to Most often system still results in enable used with works the high test refactoring Legacy Code same coverage
  • 22. Legacy Code – Chart Smart DEMO
  • 23. For More Information www.ApprovalTests.com Pick your language & download Pick your diff tool Reference, Approve & Enjoy Learn more – videos (.NET) Podcast - HerdingCode
  • 24. @WoodyZuill @LynnLangit Q&A