SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit testEugenio Lentini
 
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...Thomas Weller
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionAlex Su
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And MockingJoe Wilson
 
NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features PresentationShir Brass
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingJoe Tremblay
 
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 2012Jacinto Limjap
 
Intro To Unit and integration Testing
Intro To Unit and integration TestingIntro To Unit and integration Testing
Intro To Unit and integration TestingPaul Churchward
 
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 WorldDror Helper
 
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 NUnitweili_at_slideshare
 
Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnitkleinron
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated TestingLee Englestone
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesDerek Smith
 
Embrace Unit Testing
Embrace Unit TestingEmbrace Unit Testing
Embrace Unit Testingalessiopace
 

Was ist angesagt? (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
 

Ähnlich wie What's software testing

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 VSTSSanil Mhatre
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Javaguy_davis
 
Mutation Testing and MuJava
Mutation Testing and MuJavaMutation Testing and MuJava
Mutation Testing and MuJavaKrunal Parmar
 
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 ProjectsEliane Collins
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017Software testing: an introduction - 2017
Software testing: an introduction - 2017XavierDevroey
 
Testing review-3
Testing review-3Testing review-3
Testing review-3Kathy_Zhir
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testingSyed Usman Ahmed
 
Learn Software Testing in 6 Lessons
Learn Software Testing in 6 LessonsLearn Software Testing in 6 Lessons
Learn Software Testing in 6 LessonsSyed Ahmed
 
淺談 iOS Unit test
淺談 iOS Unit test淺談 iOS Unit test
淺談 iOS Unit testJason Huang
 
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 - KenyaErick M'bwana
 
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
 

Ähnlich wie 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
 

Mehr von Li-Wei Cheng

Mehr von 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
 

Kürzlich hochgeladen

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 WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 2024Rafal Los
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 organizationRadu Cotescu
 
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 productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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