• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Tech talks #1- Unit testing and TDD
 

Tech talks #1- Unit testing and TDD

on

  • 2,169 views

Presentation at FPT Aptech's TechTalks series

Presentation at FPT Aptech's TechTalks series

Statistics

Views

Total Views
2,169
Views on SlideShare
2,155
Embed Views
14

Actions

Likes
2
Downloads
88
Comments
0

2 Embeds 14

http://aptech.ac.vn 12
http://www.slashdocs.com 2

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • I don’t want to frustrate you by bunch of testing terms. Just focus on thinking, process and how-tos.
  • Global: 4.4 million cars recalled (http://wsws.org/articles/2010/feb2010/toyo-f12.shtml ) In the first quarter of 2009, the company posted a $7.7 billion loss. The estimated loss for Toyota in the current financial year, calculated before the expansion of the recall process in January, is $5.5 billion. http://parttimembadegree.com/business-school-cases/toyota-recalls-pr-management-crisis/ http://en.wikipedia.org/wiki/2009%E2%80%932011_Toyota_vehicle_recalls VN: “mua toy cho nó lành” – lost
  • For ROI optimization, see the analysis of Rex Black on Managing the Testing Process: Practical Tools and Techniques for Managing Hardware and Software Testing
  • In conclusion: Test a.s.a.p Testing is responsibilities of all including developers.
  • Introduced in XP
  • Design (simple) first => draft solution => Design criteria: testable
  • Refactor, clean code frequently
  • What is acceptance test? fist

Tech talks #1- Unit testing and TDD Tech talks #1- Unit testing and TDD Presentation Transcript

  • TechTalks #1 Unit Testing and Test-Driven Development Duong Trong Tan [email_address] Hanoi, 9- 2011
  • Objectives
    • Why testing?
    • Introduction to unit testing
    • Unit testing in Java with JUnit
    • What is Test-Driven Development?
    • How can TDD improve quality?
    • TDD practices and guidelines.
    Unit Testing and Test-Driven Development
  • Unit Testing and Test-Driven Development CRISIS Numbers: 4.4 million cars recalled Billions of $ loss. Damage the brand
  • Desire vs. Reality Unit Testing and Test-Driven Development gap Requirement Design Desired Implementation Reality testing
  • Why testing?
    • Ensuring QUALITY
    • Managing RISKS
    • Optimizing Return-On-Investment (ROI)
    • Professionalism
    Unit Testing and Test-Driven Development
  • Typical Production model Unit Testing and Test-Driven Development
  • Bug cost Unit Testing and Test-Driven Development
  • Balancing Unit Testing and Test-Driven Development GOOD FAST CHEAP
  • Testing level
    • Unit testing
      • On individual unit of source code (function, class, etc.)
      • Smallest testable part
      • Developer testing
    • Integration testing
      • On groups of modules
    • System testing
      • On complete integrated system
    Unit Testing and Test-Driven Development
  • JUnit
    • Unit testing automation framework for Java
    • Can do integration test
    • Integrated in IDEs (Eclipse, NetBeans, IntelliJ, etc.)
    • Must have tool for Java developers
    Unit Testing and Test-Driven Development http://www.junit.org/
  • Test-Driven Development
    • You don’t start programming until you have designed your tests!
    • Strategy
      • Make it Fail
        • No code without a failing test
      • Make it Work
        • As simply as possible
      • Make it Better
        • Refactor(code, design, test, documentation)
      • Believe in testing
    Unit Testing and Test-Driven Development
  • Suggested TDD Unit Testing and Test-Driven Development
  • Thinking changed
    • Design or code must be TESTABLE
    • “ Error Message ” is a good news
    • Courage
    • Simple
    • Agile
    Unit Testing and Test-Driven Development
  • How to do TDD
    • Design
      • Use [simple] design , figure out what to do
      • [Then .. create the skeleton first]
    • Test
      • Write test that reflect the design
      • All tests should FAIL
    • Implement
      • Write the code
    • Test
      • All tests should PASS
    Unit Testing and Test-Driven Development
  • TDD live demo
    • Application: simplified Calculator
    • Language: Java
    • Tools used:
      • NetBeans 7
      • JUnit
      • Task board (Excel)
      • Whiteboard (for simple design)
    Unit Testing and Test-Driven Development
  • Red-Green-Blue model Unit Testing and Test-Driven Development
  • Refactor to Clean Code
    • Readable
    • Maintainable
    • Changeable
    Unit Testing and Test-Driven Development
  • Acceptance Test-Driven Development Unit Testing and Test-Driven Development ATDD: team collaboration, a kind of cross-functionality Requirement Automated Acceptance Tests TDD Definition Of Done
  • Acceptance TDD (ATDD)
    • 3D strategy
    • D iscuss in requirement workshop
      • To make tests library
    • D evelop in concurrence
      • To create more Passed features
    • D eliver for acceptance
      • To meet DONE definition, accepted by users
    Unit Testing and Test-Driven Development
  • Supporting system: CI Unit Testing and Test-Driven Development
  • Q&A Unit Testing and Test-Driven Development
  • Further reading Unit Testing and Test-Driven Development
  • Tools
    • JUnit : http://junit.org
    • FitNesse : http://fitnesse.org /
    • RoBotFramework: http ://code.google.com/p/robotframework /
    • Hudson CI : http://hudson-ci.org /
    • SVN : http://subversion.tigris.org /
    Unit Testing and Test-Driven Development
  • Unit Testing and Test-Driven Development Thank you!
    • Meet Tấn DT:
    • TechTalks
    • HanoiScrum.net
    • Slideshare.net/duongtrongtan
    • Facebook: Duong Trong Tan
    • [email_address]