SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
What's software
             testing

Li-Wei Cheng
Outline
•   What's software testing

•   Testing Level

•   Unit Testing
    o What
    o Why
    o Where
    o Who
    o When
What's software testing
•   Software testing is operating the software under
    controlled conditions,
    o   To verify that it behaves "as specified"
           Works as expected.


    o   To detect errors


    o   To validate that what has been specified is what the
        user actually wanted
           Satisfied the needs of stakeholders.
           Meets the requirements that guided its design and
           development.
Testing Levels
              Verification          White Box   RD
 Unit Test    Are we building the
                system right ?       Testing

Integration
    Test

 System
  Test

Acceptance
              Validation            Black Box   SQA
   Test       Are we building the
                                     Testing
                right system ?
Unit Testing (1/8)
•   What
           一個測試
           案例只測          最小的測
           試一件事          試單位
           情




                  Unit
                  Test

           測試案例
                         外部相依
           之間相依
                         性為零
           性為零
Unit Testing (2/8)
•   Why
          如何讓各
                         要到真實
          個相依層
                         環境才能
          能夠平行
                         驗證程式
          開發


                    開發
                    常見
                    問題
          改了程式           Submit 的
          會不會造           程式碼到
          成系統            底做過哪
          Crash ?        些測試?
Unit Testing (3/8)
•   Why
    遵循介面   利用 Mock           使用 Mock
           Object 達                     模擬真實環境
                             Object 來
           到相依層              模擬外部回
           獨立開發              傳的資料




                      Unit
                      Test

                             Submit 的
回歸測試保護     改完成式                         驗證提交代碼
                             程式碼包
           就跑一次
                             括 UT
           UT 吧!
                             Code
Unit Testing (4/9)
    •   Where (Test Scope)
1
                 1. invoke the method



    Test Program                       Tested Object
                 2. verify the return value


2
                 1. invoke the method



    Test Program                       Tested Object   2. status changed


                 3. verify the changed status
Unit Testing (5/9)
    •   Where (Test Scope)
3
                 1. invoke the method

                                                                      Dependent
    Test Program                       Tested Object                    Object
                                                                       (Mock)

                 2. verify the return value


4
                 1. invoke the method

                                                                      Dependent
    Test Program                       Tested Object                    Object
                                                                       (Mock)

                 3. verify the changed status
                                                  2. status changed
Unit Testing (6/9)
    •   Where (Test Scope)
5       1. notify to change the status (from external)




    Test Program                                  Tested Object
                            2. verify the changed status


6       1. notify to change the status (from external)


                                                                  Dependent
    Test Program                                  Tested Object     Object
                                                                   (Mock)

                            2. verify the changed status
Unit Testing (7/9)
•   Who
    o   Writing UT is the responsibility of RD not QA/QE.
           設計物件的人員,才能知道物件該怎麼給外面使用
           由外部使用物件的角度來設計測試案例
            •   Help to review the APIs
            •   Defining the APIs prototype is important. (Only one chance)
           想要達到什麼需求,就是測試案例。
           而物件的設計,只是為了滿足需求,需求即測試案例。
           即 Production Code 只為了滿足測試程式上的測試案例。
Unit Testing (8/9)
•   When
    o   Developing
           外部需要使用物件,並對其執行結果有所預期時
    o   Modifying
           Modified code due to bug fixed
           Modified code due to refactor
    o   Bug fixing
           Unexpected situation occurs
Unit Testing (9/9)
•   Unit Testing should be "FIRST"


                    Repeatable
                                        Self
      Independent
                                     Validation




      FAST           FIRST               Timely

Más contenido relacionado

La actualidad más candente

Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
Alex Su
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Jacinto Limjap
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
Dror Helper
 

La actualidad más candente (20)

How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
 
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features Presentation
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
Intro To Unit and integration Testing
Intro To Unit and integration TestingIntro To Unit and integration Testing
Intro To Unit and integration Testing
 
N Unit Presentation
N Unit PresentationN Unit Presentation
N Unit Presentation
 
UNIT TESTING
UNIT TESTINGUNIT TESTING
UNIT TESTING
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
An Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnitAn Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnit
 
Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnit
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Nunit
NunitNunit
Nunit
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Embrace Unit Testing
Embrace Unit TestingEmbrace Unit Testing
Embrace Unit Testing
 
Junit
JunitJunit
Junit
 
Unit test
Unit testUnit test
Unit test
 

Similar a What's software testing

Learn Software Testing in 6 Lessons
Learn Software Testing in 6 LessonsLearn Software Testing in 6 Lessons
Learn Software Testing in 6 Lessons
Syed Ahmed
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
TO THE NEW | Technology
 
Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)
Will Shen
 

Similar a What's software testing (20)

Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
 
Database Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSDatabase Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTS
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Application Testing
Application TestingApplication Testing
Application Testing
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJava
 
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall ProjectsICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
ICTSS 2010 - Iterative Software Testing Process for Scrum and Waterfall Projects
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017
 
Testing review-3
Testing review-3Testing review-3
Testing review-3
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
 
Learn Software Testing in 6 Lessons
Learn Software Testing in 6 LessonsLearn Software Testing in 6 Lessons
Learn Software Testing in 6 Lessons
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
Unit Testing in Swift
Unit Testing in SwiftUnit Testing in Swift
Unit Testing in Swift
 
淺談 iOS Unit test
淺談 iOS Unit test淺談 iOS Unit test
淺談 iOS Unit test
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
 
test
testtest
test
 
test
testtest
test
 
Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)
 
Unit Testing in Android
Unit Testing in AndroidUnit Testing in Android
Unit Testing in Android
 

Más de Li-Wei Cheng (6)

Introduction to AndroidMock
Introduction to AndroidMockIntroduction to AndroidMock
Introduction to AndroidMock
 
Make Your SW Component Testable
Make Your SW Component TestableMake Your SW Component Testable
Make Your SW Component Testable
 
Test doubles
Test doublesTest doubles
Test doubles
 
JUnit
JUnitJUnit
JUnit
 
OO design principle
OO design principleOO design principle
OO design principle
 
UML knowledge
UML knowledgeUML knowledge
UML knowledge
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

What's software testing

  • 1. What's software testing Li-Wei Cheng
  • 2. Outline • What's software testing • Testing Level • Unit Testing o What o Why o Where o Who o When
  • 3. What's software testing • Software testing is operating the software under controlled conditions, o To verify that it behaves "as specified" Works as expected. o To detect errors o To validate that what has been specified is what the user actually wanted Satisfied the needs of stakeholders. Meets the requirements that guided its design and development.
  • 4. Testing Levels Verification White Box RD Unit Test Are we building the system right ? Testing Integration Test System Test Acceptance Validation Black Box SQA Test Are we building the Testing right system ?
  • 5. Unit Testing (1/8) • What 一個測試 案例只測 最小的測 試一件事 試單位 情 Unit Test 測試案例 外部相依 之間相依 性為零 性為零
  • 6. Unit Testing (2/8) • Why 如何讓各 要到真實 個相依層 環境才能 能夠平行 驗證程式 開發 開發 常見 問題 改了程式 Submit 的 會不會造 程式碼到 成系統 底做過哪 Crash ? 些測試?
  • 7. Unit Testing (3/8) • Why 遵循介面 利用 Mock 使用 Mock Object 達 模擬真實環境 Object 來 到相依層 模擬外部回 獨立開發 傳的資料 Unit Test Submit 的 回歸測試保護 改完成式 驗證提交代碼 程式碼包 就跑一次 括 UT UT 吧! Code
  • 8. Unit Testing (4/9) • Where (Test Scope) 1 1. invoke the method Test Program Tested Object 2. verify the return value 2 1. invoke the method Test Program Tested Object 2. status changed 3. verify the changed status
  • 9. Unit Testing (5/9) • Where (Test Scope) 3 1. invoke the method Dependent Test Program Tested Object Object (Mock) 2. verify the return value 4 1. invoke the method Dependent Test Program Tested Object Object (Mock) 3. verify the changed status 2. status changed
  • 10. Unit Testing (6/9) • Where (Test Scope) 5 1. notify to change the status (from external) Test Program Tested Object 2. verify the changed status 6 1. notify to change the status (from external) Dependent Test Program Tested Object Object (Mock) 2. verify the changed status
  • 11. Unit Testing (7/9) • Who o Writing UT is the responsibility of RD not QA/QE. 設計物件的人員,才能知道物件該怎麼給外面使用 由外部使用物件的角度來設計測試案例 • Help to review the APIs • Defining the APIs prototype is important. (Only one chance) 想要達到什麼需求,就是測試案例。 而物件的設計,只是為了滿足需求,需求即測試案例。 即 Production Code 只為了滿足測試程式上的測試案例。
  • 12. Unit Testing (8/9) • When o Developing 外部需要使用物件,並對其執行結果有所預期時 o Modifying Modified code due to bug fixed Modified code due to refactor o Bug fixing Unexpected situation occurs
  • 13. Unit Testing (9/9) • Unit Testing should be "FIRST" Repeatable Self Independent Validation FAST FIRST Timely