AUTOMATIC
TEST
Drawbacks
● slow startup configuration
● it must be maintained
● hard to apply in legacy code
● hard to choose type of test
● the cost of change mindset
● request many refactoring
● you cannot test everything
Federico Guerinoni - guerinoni@micro-systems.it
● avoid regression of business/application logic
● verify single piece of code (algorithm, class…)
● make it simple to write structured and encapsulated code
● clarify customer requirements
● reduce development time of new features
● reduce maintenance old code
● because this is automatic
● safer refactoring
Why?
Federico Guerinoni - guerinoni@micro-systems.it
Federico Guerinoni - guerinoni@micro-systems.it
F.I.R.S.T.
● Fast: should be fast. They should run quickly
● Independent: should not depend on each other
● Repeatable: should be repeatable in every environment (QA,
production, laptop...)
● Self-validating: should have a boolean output. Should either
pass or fail
● Timely: should be written before production code
Federico Guerinoni - guerinoni@micro-systems.it
The Three rules of TDD
1. write production code only to make a failing unit test pass.
2. write only enough of a unit test to fail.
3. write only enough production code to make the failing unit test
pass.
Federico Guerinoni - guerinoni@micro-systems.it
TDD vs BDD (DDD and ATDD)
● focus on single unit
● probably change tests
when refactor
● no GUI support
● focus on output of function
● focus on requirements
● probably change tests
when customer request
changes
● GUI support
● check
● focus on integration
between class
Federico Guerinoni - guerinoni@micro-systems.it
Mock vs Stub vs Fake
Fakes: is an object that has some sort of actual working mechanism inside that returns a
predictable result, but doesn’t implement the actual production logic.
Stubs: is an object that will return a specific result based on a specific set of input. If I tell
my stub to return “John Doe” whenever I ask it for the person with ID number 42, than
that’s what it will do.
Mocks: is a much more sophisticated version of a Stub. It will still return values like a
stub, but it can also be programmed with expectations in terms of how many times each
method should be called, in which order and with what data. Mocks provide features that
ensure that our code under test is using it’s dependencies in a very specific way.
Federico Guerinoni - guerinoni@micro-systems.it
Qt Test
● very integrated with QtCreator
● support of Qt class
● support widgets test
● support qml test
● low mock support
● create many binaries
● benchmark integration
● difficult to integrate with CI/CD
Federico Guerinoni - guerinoni@micro-systems.it
Example
Federico Guerinoni - guerinoni@micro-systems.it
Google Test
● integration in many IDE
● no gui support
● build in one binary
● support mocking
● easy to integrate in CI/CD
Federico Guerinoni - guerinoni@micro-systems.it
Example
Federico Guerinoni - guerinoni@micro-systems.it
Squish
● BDD oriented
● not free
● recording and playback
● IDE to create and verify test
● support for GUI
● integrated with Qt
● cross-platform
Federico Guerinoni - guerinoni@micro-systems.it
Cucumber
● tool that support BDD
● request gherkin language
● agile oriented
● support many programming language
● report of test can be used with customers
Federico Guerinoni - guerinoni@micro-systems.it
Example
Federico Guerinoni - guerinoni@micro-systems.it
Continuous Integration
Federico Guerinoni - guerinoni@micro-systems.it
Thanks
Federico Guerinoni - guerinoni@micro-systems.it

More Related Content

PPTX
PDF
Testing Node.js.pdf
PDF
PHPUnit with Magento
PDF
Test Driven Development with PHP
PDF
Android Test Driven Development & Android Unit Testing
PDF
Developers on test
PPTX
AspectMock
PDF
Tdd 왜 배우기 어려운가
Testing Node.js.pdf
PHPUnit with Magento
Test Driven Development with PHP
Android Test Driven Development & Android Unit Testing
Developers on test
AspectMock
Tdd 왜 배우기 어려운가

What's hot (20)

PDF
Civilized Git Process
PPTX
Creating a reasonable project boilerplate
PPTX
Tdd com Java
PPTX
TDD with RSpec
PDF
Performance profiling and testing of symfony application 2
PPT
Code Quality
PPT
Test-Driven Development
PPT
Test Driven Development
PPT
Test-Driven Development
PDF
Android Devops : Master Continuous Integration and Delivery
KEY
TDD refresher
PDF
Test driven development - Zombie proof your code
PDF
How to quickly add a safety net to a legacy codebase
PPT
Unit testing
PPTX
Behaviour Driven Development with SpecFlow
PDF
Code Review
PPTX
21o. RubyFloripa - Maintaining legacy Rails app and introducing Elixir
PDF
TDD with Ruby
PPTX
How we tested our code "Google way"
Civilized Git Process
Creating a reasonable project boilerplate
Tdd com Java
TDD with RSpec
Performance profiling and testing of symfony application 2
Code Quality
Test-Driven Development
Test Driven Development
Test-Driven Development
Android Devops : Master Continuous Integration and Delivery
TDD refresher
Test driven development - Zombie proof your code
How to quickly add a safety net to a legacy codebase
Unit testing
Behaviour Driven Development with SpecFlow
Code Review
21o. RubyFloripa - Maintaining legacy Rails app and introducing Elixir
TDD with Ruby
How we tested our code "Google way"
Ad

Similar to Automatic Test 2019-07-25 (20)

PDF
Survival of the Continuist
PDF
Writing Tests with the Unity Test Framework
PDF
End-end tests as first class citizens - SeleniumConf 2020
PPTX
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
PDF
Clean code: understanding Boundaries and Unit Tests
PDF
Unit testing legacy code
PDF
Test driven development_continuous_integration
PPTX
Technical Practices for Agile Engineering - PNSQC 2019
PPTX
Unit Testing TypeScript
PPTX
Code quality
PDF
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
PDF
Keeping code clean
PDF
What is the best approach to tdd
PDF
Continuous integration and delivery for java based web applications
PDF
High Performance Software Engineering Teams
PDF
Test Driven Development Methodology and Philosophy
PPTX
Modern Testing Strategies for Evolving Ecosystems
PDF
Developers Testing - Girl Code at bloomon
ODP
xUnit and TDD: Why and How in Enterprise Software, August 2012
PPTX
The Test way
Survival of the Continuist
Writing Tests with the Unity Test Framework
End-end tests as first class citizens - SeleniumConf 2020
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
Clean code: understanding Boundaries and Unit Tests
Unit testing legacy code
Test driven development_continuous_integration
Technical Practices for Agile Engineering - PNSQC 2019
Unit Testing TypeScript
Code quality
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Keeping code clean
What is the best approach to tdd
Continuous integration and delivery for java based web applications
High Performance Software Engineering Teams
Test Driven Development Methodology and Philosophy
Modern Testing Strategies for Evolving Ecosystems
Developers Testing - Girl Code at bloomon
xUnit and TDD: Why and How in Enterprise Software, August 2012
The Test way
Ad

Recently uploaded (20)

PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
Topaz Photo AI Crack New Download (Latest 2025)
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PPTX
Airline CRS | Airline CRS Systems | CRS System
PPTX
Introduction to Windows Operating System
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Website Design Services for Small Businesses.pdf
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
GSA Content Generator Crack (2025 Latest)
Practical Indispensable Project Management Tips for Delivering Successful Exp...
iTop VPN Crack Latest Version Full Key 2025
Wondershare Recoverit Full Crack New Version (Latest 2025)
DNT Brochure 2025 – ISV Solutions @ D365
Topaz Photo AI Crack New Download (Latest 2025)
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Trending Python Topics for Data Visualization in 2025
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Airline CRS | Airline CRS Systems | CRS System
Introduction to Windows Operating System
Advanced SystemCare Ultimate Crack + Portable (2025)
"Secure File Sharing Solutions on AWS".pptx
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Cybersecurity: Protecting the Digital World
Full-Stack Developer Courses That Actually Land You Jobs
BoxLang Dynamic AWS Lambda - Japan Edition
Website Design Services for Small Businesses.pdf

Automatic Test 2019-07-25

  • 2. Drawbacks ● slow startup configuration ● it must be maintained ● hard to apply in legacy code ● hard to choose type of test ● the cost of change mindset ● request many refactoring ● you cannot test everything Federico Guerinoni - guerinoni@micro-systems.it
  • 3. ● avoid regression of business/application logic ● verify single piece of code (algorithm, class…) ● make it simple to write structured and encapsulated code ● clarify customer requirements ● reduce development time of new features ● reduce maintenance old code ● because this is automatic ● safer refactoring Why? Federico Guerinoni - guerinoni@micro-systems.it
  • 4. Federico Guerinoni - guerinoni@micro-systems.it
  • 5. F.I.R.S.T. ● Fast: should be fast. They should run quickly ● Independent: should not depend on each other ● Repeatable: should be repeatable in every environment (QA, production, laptop...) ● Self-validating: should have a boolean output. Should either pass or fail ● Timely: should be written before production code Federico Guerinoni - guerinoni@micro-systems.it
  • 6. The Three rules of TDD 1. write production code only to make a failing unit test pass. 2. write only enough of a unit test to fail. 3. write only enough production code to make the failing unit test pass. Federico Guerinoni - guerinoni@micro-systems.it
  • 7. TDD vs BDD (DDD and ATDD) ● focus on single unit ● probably change tests when refactor ● no GUI support ● focus on output of function ● focus on requirements ● probably change tests when customer request changes ● GUI support ● check ● focus on integration between class Federico Guerinoni - guerinoni@micro-systems.it
  • 8. Mock vs Stub vs Fake Fakes: is an object that has some sort of actual working mechanism inside that returns a predictable result, but doesn’t implement the actual production logic. Stubs: is an object that will return a specific result based on a specific set of input. If I tell my stub to return “John Doe” whenever I ask it for the person with ID number 42, than that’s what it will do. Mocks: is a much more sophisticated version of a Stub. It will still return values like a stub, but it can also be programmed with expectations in terms of how many times each method should be called, in which order and with what data. Mocks provide features that ensure that our code under test is using it’s dependencies in a very specific way. Federico Guerinoni - guerinoni@micro-systems.it
  • 9. Qt Test ● very integrated with QtCreator ● support of Qt class ● support widgets test ● support qml test ● low mock support ● create many binaries ● benchmark integration ● difficult to integrate with CI/CD Federico Guerinoni - guerinoni@micro-systems.it
  • 10. Example Federico Guerinoni - guerinoni@micro-systems.it
  • 11. Google Test ● integration in many IDE ● no gui support ● build in one binary ● support mocking ● easy to integrate in CI/CD Federico Guerinoni - guerinoni@micro-systems.it
  • 12. Example Federico Guerinoni - guerinoni@micro-systems.it
  • 13. Squish ● BDD oriented ● not free ● recording and playback ● IDE to create and verify test ● support for GUI ● integrated with Qt ● cross-platform Federico Guerinoni - guerinoni@micro-systems.it
  • 14. Cucumber ● tool that support BDD ● request gherkin language ● agile oriented ● support many programming language ● report of test can be used with customers Federico Guerinoni - guerinoni@micro-systems.it
  • 15. Example Federico Guerinoni - guerinoni@micro-systems.it
  • 16. Continuous Integration Federico Guerinoni - guerinoni@micro-systems.it
  • 17. Thanks Federico Guerinoni - guerinoni@micro-systems.it