SlideShare uma empresa Scribd logo
1 de 52
Š Integrated Computer Solutions, Inc. All Rights Reserved
Qt Test-Driven Development
Using Google Test and
Google Mock
Justin Noel, Senior Consulting Engineer
1
Š Integrated Computer Solutions, Inc. All Rights Reserved
Webinar Contents
• Light introduction to Google Test / Google Mock
• See bibliography for more information
• Light introduction to TDD
• See bibliography for more information
• Designing applications for testability
• Isolation of units
• How to test with classes that use Qt
• Using Google Test with Qt Creator
• QObject, Qt Data types, Signals, Events
2
Š Integrated Computer Solutions, Inc. All Rights Reserved
Types of Testing
• Unit Testing
• Test one discrete area of the software
• Usually on a class basis. Think “Test Piston Rod”
• Tests can be written and performed as code is developed
• White box tests. Often written by developers
• “Does the software perform as the developer intended?”
• Functional Testing
• Tests subsystems of the whole software system
• Usually a group of classes. Think “Test Engine”
• Tests can be preformed once subsystem is wired together
• Tests interaction between specific groups of units
• “Does the software work together?”
3
Š Integrated Computer Solutions, Inc. All Rights Reserved
Types of Testing
• System Testing
• End to end testing of the whole software system
• Sometimes includes actual hardware. Think “Test Car”
• Tests are written late in project
• Because of the end to end nature
• Black box tests. Often written by separate SQA team
• “Does the software do the right thing?”
4
Š Integrated Computer Solutions, Inc. All Rights Reserved
Google Test Creator Integration
• Unified AutoTest Plugin (Qt Creator 4.0+)
• QTest
• QTest-QML
• GoogleTest
• Provides new Test Results output pane
• Tree of Test Fixtures and Test Functions
• Color codes success vs failure
• Contains failure messages from Google Test
• Provide Tests project view
• Select which tests to run
5
Š Integrated Computer Solutions, Inc. All Rights Reserved
Google Test Creator Plugin
6
Š Integrated Computer Solutions, Inc. All Rights Reserved
Enabling Auto Test Plugin
• Start Qt Creator and enable the Auto Test plugin
• Help -> About Plugins
• Check Load for AutoTest under Utilities
• Restart Qt Creator
• You now have the following available
• Test Results Output Pane
• Tests Project View
• Test Settings Pane under Tools -> Options
• Show/Hide debug/warning console output
• GoogleTest specific settings are here
7
Š Integrated Computer Solutions, Inc. All Rights Reserved
Design for Testability
• Your code must be testable!
• There are design techniques to help make your code more testable
• Try not to add functions to production code just for tests
• Sub classing for tests is acceptable (access designer UI members)
• Isolation of units is your primary goal
• Can I just test this class?
• Without re-testing lower level classes?
• Also think about error conditions
• Some may be hard to produce in production environments
• Can I stimulate a bad MD5 error?
• Socket disconnects?
• Default switch cases?
8
Š Integrated Computer Solutions, Inc. All Rights Reserved
Build Application as Libraries
Building the bulk of your application as a set of libraries increases
testability
9
Š Integrated Computer Solutions, Inc. All Rights Reserved
Layered Design
• A layered design is more testable
• Easy to isolate lower layers for testing
• Test Communications without Data, Presentation or Visualization
• No upwards dependencies
• Hard downward dependencies
10
Š Integrated Computer Solutions, Inc. All Rights Reserved
Break Downward Dependencies
• Dependency injection works well
• An Inversion of Control Pattern
• Classes take their dependencies as constructor arguments
• Classes do not construct any members themselves
• Loose coupling with signals and slots also works well
• Classes interface to each other via signals and slots only
• 3rd class wires say the UI classes to the Backend classes
• Lets you substitute a test fixture object for a dependency object
• Instead of an actual production object
11
Š Integrated Computer Solutions, Inc. All Rights Reserved
Why is isolation important?
• Avoids testing the same code over and over
• You have already tested the data model
• Why do the UI tests need to also test the model?
• This will make your tests run very quickly
• If there is a failure in a low level class it won’t trigger errors in higher level tests
• Avoid testing side effects
• Tests can be implementation agnostic
• DB, Files, Cloud. Shouldn’t matter for UI tests.
• Tests should only depend on interfaces, not behavior
12
Š Integrated Computer Solutions, Inc. All Rights Reserved
EE Analogy: Motor Controller Test
13
Š Integrated Computer Solutions, Inc. All Rights Reserved
Google Test/Mock Libraries
• Google Test and Google Mock are C++ libraries
• New version (1.8) combines gtest and gmock in one project
• Called “googletest”
• Link to them as you would any other C++ library
• Only your test executables should need gtest and gmock libs
• g[test|mock]_main and libraries offer a prebuilt main function
• Build googletest using Cmake. make && make install
• Use from a known location like Qt
• Build GoogleTest inside your project using short .pro/.pri
• I prefer this to avoid compiler flag incompatibilities
• Windows is famous for mix/match incompatibilities
• Qt’s GoogleTest project template does this method
14
Š Integrated Computer Solutions, Inc. All Rights Reserved
Google Test/Mock In Project
Build Google Test and Google Mock with this short .pro
15
TEMPLATE = lib
CONFIG += static exceptions
CONFIG -= debug_and_release
TARGET = GoogleTest
INCLUDEPATH += 
googletest/googletest/include 
googletest/googlemock/include 
googletest/googletest 
googletest/googlemock
SOURCES = 
googletest/googletest/src/gtest-all.cc 
googletest/googlemock/src/gmock-all.cc
Š Integrated Computer Solutions, Inc. All Rights Reserved
GTest is a unit testing framework
• Prepare
• Create dependencies
• Create object under test
• Setup expectations
• Mock Expectations, QSignalSpy, etc
• Stimulate
• Call a 1 function or emit a signal
• Verify
• Check that expectations occurred
• And/or check return value
16
Š Integrated Computer Solutions, Inc. All Rights Reserved
GTest Verifications
• ASSERT_EQ(a, b) – Equality Operator
• Works for QString, std::string, etc
• QString needs a “Pretty Printer” to be truly integrated
• ASSERT_TRUE(exp) – Boolean Expression
• ASSERT_DOUBLE_EQ(a, b) – Fuzzy Compare
• ASSERT_FLOAT_EQ(a, b) – Fuzzy Compare
• ASSERT_STREQ(a, b) – char* comparison
17
Š Integrated Computer Solutions, Inc. All Rights Reserved
Expection, Assert, Abort, Exit
• EXPECT_THROW(foo(), execptionType)
• EXPECT_NO_THROW(foo(), exceptionType)
• ASSERT_DEATH(foo())
• Fails if program did not exit() or abort()
• assert(), Q_ASSERT(), etc will abort()
• Very useful for testing “Does CTRL-C exit my program”
• These types of tests can pass on unhandled exceptions and
exiting. Tests will continue on as usual.
• This is something that is hard to do in QtTest.
18
Š Integrated Computer Solutions, Inc. All Rights Reserved
Qt Specific Things
• Not supplied by Google Test
• QtTest does supply these. Link to QtTest and use them.
• QSignalSpy
• Test for signal emits
• QTest::mouseClick, QTest::keyClicks, etc
• Stimulate Qt events
19
Š Integrated Computer Solutions, Inc. All Rights Reserved
Print Qt Data Types in Output
• Google Test would like to print text for objects using ASSERT_EQ
• std::ostream << operators work
• Or implement a PrintTo function
• Put this in a header file and include it in your test files
20
QT_BEGIN_NAMESPACE
inline void PrintTo(const QString &qString,
::std::ostream *os)
{
*os << qPrintable(qString);
}
QT_END_NAMESPACE
Š Integrated Computer Solutions, Inc. All Rights Reserved
Creating a Test Fixture
21
#include <gtest/gtest.h>
using namespace ::testing;
// Fixture
class ExampleTest : public Test
{
protected:
Example m_example; // Object Under Test
};
// Test Function
TEST_F(ExampleTest, ThisShouldFail)
{
ASSERT_TRUE(false);
}
Š Integrated Computer Solutions, Inc. All Rights Reserved
New Objects For Every Test Function
• A new Fixture is created for every test function
• All new objects are created for each test
• Helps ensure that tests do no depend on each other
• Or pollute the environment for future tests
• Can use constructor and destructor to setup tests
• Unless there may be exceptions thrown
• Fixtures have Setup() and TearDown() functions to handle that case
• Some projects have policy to only use Setup() and TearDown() with empty
constructor and destructor
22
Š Integrated Computer Solutions, Inc. All Rights Reserved
Test Fixture Project
23
QT += test # QtTest includes QSignalSpy, event stimulators, etc
CONFIG += console # Create an stdout window on Windows
CONFIG += testcase # Creates make check target
INCLUDEPATH += ../GoogleTest/include
LIBS += -L../GoogleTest/lib –lGoogleTest # Lib name(s) depends on
build
SOURCES += TestQString.cpp
qmake
make
LD_LIBRARY_PATH=<paths> make check
Š Integrated Computer Solutions, Inc. All Rights Reserved
Running Selected Test Fixtures
• Google test supplies a very intelligent main helpers
• Defaults to running all the tests
• Command line options can run any subset of tests
• By fixture name or test name
24
#include <gmock/gmock.h>
int main(int argc, char *argv[])
{
testing::InitGoogleTest(&argc, argv);
testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
Š Integrated Computer Solutions, Inc. All Rights Reserved
Running Selected Test Fixtures
• Test Project View can select tests
25
Š Integrated Computer Solutions, Inc. All Rights Reserved
Running Tests Within Creator
• Tests must be executed from the Test Results Pane
• Run All
• Run Selected
• Filter Results
• Show failures only
• Double clicking a failure navigates to the test code
26
Š Integrated Computer Solutions, Inc. All Rights Reserved
Writing Good Tests
• Test one thing at a time
• It’s tempting to get as much done in one function as you can.
• This makes one verification depend on another verification
• Tests will be brittle and changes to code could break lots of verifications
• Do not have your tests depend on each other
• Order should not matter!
• Not depending on other tests will help you when you remove functionality.
• You do not want to have to fix a cascading waterfall of tests!
• Google Test has a shuffle mode command line parameter
• Keeps you from depending on previous tests
27
Š Integrated Computer Solutions, Inc. All Rights Reserved
Test Driven Development (TDD)
• An entirely new way of writing code
• Mind bending at first. Hard to re-train your brain
• 1 Test is written before ~1 code is written
• Test must fail before the line of code is written
• Write the minimum code necessary to pass the test
• Often the WRONG code to pass the first couple tests
• Write another test
28
Š Integrated Computer Solutions, Inc. All Rights Reserved
Benefits of TDD
• Every line of code is well tested
• Tests are written as code is written
• High code coverage
• Obscure conditions are tested along with normal paths
• No unused code paths
• Paths are used as test are written
• Awkward APIs are found by class developers. Not class users!
• Tests are known to fail when expected code is not correct
• Because the test failed without that line of code present
• Tests did not pass by “coincidence”
29
Š Integrated Computer Solutions, Inc. All Rights Reserved
Drawbacks of TDD
• Larger developed code size. More code more time.
• Possibly > 10 SLOC of Tests for ~1 SLOC of Code
• Re-working behavior can be difficult without re-writing many tests
• Re-factor is easier as code is usually more modular
• For example: Move tests with code to another class.
• Hard part is still hard.
• Design is still the hardest part to coding.
• Increased testing of the implementation will not fix design issues
• Code that isn’t written still isn’t tested
• i.e. A function can be passed bad data.
• If there is no test there is no guard for bounds... Boom!
• Code still needs to be reviewed and corner cases caught.
30
Š Integrated Computer Solutions, Inc. All Rights Reserved
TDD a Division Function Demo
31
Š Integrated Computer Solutions, Inc. All Rights Reserved
Google Mock is a Dependency
Replacement Framework
• Mock allows you to easily replace production class dependencies
with testing alternatives
• Provides the ability to hi-jack return variables and error conditions
• Provides ability to “expect calls” to be made
• Check the parameters of those calls
• Mock allows us to test against the interface of the dependency
• Not the behavior or implementation
• No reason to actually write to a database or files
• Simply verify that object calls Logger log() function satisfies test
32
Š Integrated Computer Solutions, Inc. All Rights Reserved
Production Implementations
33
Š Integrated Computer Solutions, Inc. All Rights Reserved
Battery Test Implementation
Battery has been isolated from the rest of the system
34
Š Integrated Computer Solutions, Inc. All Rights Reserved
Dependency Injection
• Constructors to classes take references to dependencies
• Rather than having self created members
• Sometimes setters are used rather than constructors
• Either way makes it easy to swap out dependencies
• Dependency Injection can help isolate units
• Each class has a base class interface with pure virtuals
• IBatteryCell
• Inherited by BatteryCell and MockBatteryCell
• Interface has to inherit QObject to use signals and Q_PROPERTY
• Properties can be declared with pure virtual READ and WRITE
35
Š Integrated Computer Solutions, Inc. All Rights Reserved
IBatteryCell
36
#include "ApplicationLibDecl.h"
#include <QObject>
class APPLICATIONLIB_EXPORT IBatteryCell : public QObject
{
Q_OBJECT
Q_PROPERTY(double chargePercent READ chargePercent
WRITE chargePercentChanged)
public:
virtual double chargePercent() const = 0;
signals:
void chargePercentChanged();
};
Š Integrated Computer Solutions, Inc. All Rights Reserved
MockBatteryCell
37
#include "IBatteryCell.h"
#include <gmock/gmock.h>
class MockBatteryCell : public IBatteryCell
{
Q_OBJECT
public:
MOCK_CONST_METHOD0(chargePercent, double());
};
Š Integrated Computer Solutions, Inc. All Rights Reserved
Using Mock in a Fixture
38
class BatteryTest : public Test
{
public:
BatteryTest() :
m_battery(m_batteryCellOne, m_batteryCellTwo)
{
}
protected:
//Dependencies
NiceMock<MockBatteryCell> m_batteryCellOne;
NiceMock<MockBatteryCell> m_batteryCellTwo;
//Class Under Test
Battery m_battery;
};
Š Integrated Computer Solutions, Inc. All Rights Reserved
Mock Expectations
• EXPECT_CALL
• Verifies that a function was called
• How many times? With what parameters?
39
TEST_F(SomeTest, SetValueCalledWithCorrectParameter)
{
EXPECT_CALL(m_mockDep, setValue(1)).Times(AtLeast(1));
m_underTest.setAllValues();
}
Š Integrated Computer Solutions, Inc. All Rights Reserved
Mock Return Value
• ON_CALL or EXPECT_CALL can make the mocked function return
arbitrary values
• Even return different values based on parameters
• Or return different values based on how many times it was called
40
TEST_F(SomeTest, CalculateReturnsDepFooPlusBar)
{
ON_CALL(m_mockDep, getValue(“Foo”)).WillByDefault(Return(5.0));
ON_CALL(m_mockDep, getValue(“Bar”)).WillByDefault(Return(55.0));
ASSERT_DOUBLE_EQ(60.0, m_underTest.calculate());
}
Š Integrated Computer Solutions, Inc. All Rights Reserved
Turning Mock Implicit Failure
• Regular MockType instance
• Warns on uninteresting calls
• Functions called without explicit EXPECT_CALL or ON_CALL
• Test passes with warnings printed to console
• StrictMock<MockType>
• Fails on any uninteresting call
• NiceMock<MockType>
• Fails only when explicit expectations are not met
• Suppresses uninteresting warnings
41
Š Integrated Computer Solutions, Inc. All Rights Reserved
Mock Has Many Features
• Far too many to list or describe in a 1 hour webinar
• There are entire books dedicated to Google Mock
• Tune Expectations
• Return(ByRef(val)), WillOnce, WillByDefault, Times(), GreaterThan()
• Custom Matchers
• Verify parameters by arbitrary means
• Compare based on members
• Id() function on a pointer type
• List goes on and on
42
Š Integrated Computer Solutions, Inc. All Rights Reserved
Testing a Signal
• QSignalSpy from QTest can test signals without a slot
• QTest also has functions for stimulating user events
43
TEST_F(SomeTest, MouseClickEmitsClickedSingal)
{
QSignalSpy spy(&m_button, SIGNAL(clicked()));
QTest::mouseClick(m_button);
ASSERT_EQ(1, spy.count());
}
Š Integrated Computer Solutions, Inc. All Rights Reserved
Stimulating a Signal
• signals is a #define public
• Emit dependent object signals directly!
• emit is a #define to nothing
44
TEST_F(SomeTest, DepUpdateSignalChangesValue)
{
m_underTest.setValue(5);
emit m_mockDep.update(10); // emit is actually optional
ASSERT_EQ(10, m_underTest.value());
}
Š Integrated Computer Solutions, Inc. All Rights Reserved
Q_PROPERTY Macro Testing
• Two options to test Q_PROPERTY via TDD
• 1) Use Private/Protected READ and WRITE methods
• Test the property like a public function using
• obj.property(“name”).to[Type]()
• obj.setProperty(“name”, variantValue)
• Only useful if class is only used via properties. Say for QML.
• 2) Test public getter and setter as usual
• Then test the Q_PROPERTY using dummy READ / WRITE methods
• You end up with the exact same tests as get/set methods
• Finally refactor the Q_PROPERTY to use regular get/set
• All tests should still pass
• However, you end up with 2x tests. Bulletproof tests.
45
Š Integrated Computer Solutions, Inc. All Rights Reserved
Q_PROPERTY NOTIFY / CONSTANT
• Check the name of the property's NOTIFY signal
• Use QMetaObject / QMetaProperty / QMetaMethod
46
• Check for property’s CONSTANT flag
• Use QMetaObject / QMetaProperty
int propertyIndex = m_battery.metaObject()->indexOfProperty("chargePercent");
QMetaProperty property = m_battery.metaObject()->property(propertyIndex);
ASSERT_STREQ("chargePercentChanged", property.notifySignal().name().data());
int propertyIndex = m_battery.metaObject()->indexOfProperty("chargePercent");
QMetaProperty property = m_battery.metaObject()->property(propertyIndex);
ASSERT_TRUE(property.isConstant());
Š Integrated Computer Solutions, Inc. All Rights Reserved
Battery Test Example
47
Š Integrated Computer Solutions, Inc. All Rights Reserved
Bibliography
Google Test
• Primer
• https://github.com/google/googletest/blob/master/googletest/docs/Primer.
md
• Cook Book
• https://github.com/google/googletest/blob/master/googlemock/docs/CookB
ook.md
48
Š Integrated Computer Solutions, Inc. All Rights Reserved
Bibliography
Google Mock
• Primer
• https://github.com/google/googletest/blob/master/googlemock/docs/ForDu
mmies.md
• Cook Book
• https://github.com/google/googletest/blob/master/googlemock/docs/CookB
ook.md
• Cheat Sheet
• https://github.com/google/googletest/blob/master/googlemock/docs/CheatS
heet.md
49
Š Integrated Computer Solutions, Inc. All Rights Reserved
Bibliography
TDD
• http://www.agiledata.org/essays/tdd.html
• http://www.jamesshore.com/Agile-Book/test_driven_development.html
• http://www.amazon.com/Modern-Programming-Test-Driven-Development-
Better/dp/1937785483/ref=sr_1_1?ie=UTF8&qid=1455140098&sr=8-
1&keywords=TDD+C%2B%2B
• http://www.amazon.com/Test-Driven-Development-Kent-
Beck/dp/0321146530/ref=sr_1_fkmr0_1?ie=UTF8&qid=1455140098&sr=8-1-
fkmr0&keywords=TDD+C%2B%2B
50
Š Integrated Computer Solutions, Inc. All Rights Reserved
Bibliography
• SOLID Object Oriented Design Principles
• https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
• http://www.codemag.com/article/1001061
• https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-
design
51
Š Integrated Computer Solutions, Inc. All Rights Reserved
Thank You!
52

Mais conteĂşdo relacionado

Mais procurados

An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test frameworkAbner Chih Yi Huang
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design PatternsYnon Perek
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QMLICS
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Indonesia
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Languageintelliyole
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'tsPekka Klärck
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first stepsRenato Primavera
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub ActionsNilesh Gule
 
Unit testing with Qt test
Unit testing with Qt testUnit testing with Qt test
Unit testing with Qt testDavide Coppola
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersRudy De Busscher
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot FrameworkSomkiat Puisungnoen
 
Google test training
Google test trainingGoogle test training
Google test trainingThierry Gayet
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github ActionsKnoldus Inc.
 

Mais procurados (20)

An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design Patterns
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QML
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
Golang
GolangGolang
Golang
 
Unit testing with Qt test
Unit testing with Qt testUnit testing with Qt test
Unit testing with Qt test
 
Github in Action
Github in ActionGithub in Action
Github in Action
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with Testcontainers
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Google test training
Google test trainingGoogle test training
Google test training
 
Qt programming-using-cpp
Qt programming-using-cppQt programming-using-cpp
Qt programming-using-cpp
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
Junit
JunitJunit
Junit
 

Semelhante a [Webinar] Qt Test-Driven Development Using Google Test and Google Mock

A la dĂŠcouverte des google/test (aka gtest)
A la dĂŠcouverte des google/test (aka gtest)A la dĂŠcouverte des google/test (aka gtest)
A la dĂŠcouverte des google/test (aka gtest)Thierry Gayet
 
Agile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayAgile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayJordi Pradel
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScriptRob Scaduto
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBaskar K
 
Testlink Test Management with Teamforge
Testlink Test Management with TeamforgeTestlink Test Management with Teamforge
Testlink Test Management with TeamforgeCollabNet
 
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Applitools
 
Unit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGUnit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGegoodwintx
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesTao Xie
 
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform  Suryakiran Kasturi & Akhil KumarAdopting agile in an embedded platform  Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil KumarXP Conference India
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...BizTalk360
 
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt ProjectICS
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build testLen Bass
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Shelley Lambert
 

Semelhante a [Webinar] Qt Test-Driven Development Using Google Test and Google Mock (20)

A la dĂŠcouverte des google/test (aka gtest)
A la dĂŠcouverte des google/test (aka gtest)A la dĂŠcouverte des google/test (aka gtest)
A la dĂŠcouverte des google/test (aka gtest)
 
Agile Software Testing the Agilogy Way
Agile Software Testing the Agilogy WayAgile Software Testing the Agilogy Way
Agile Software Testing the Agilogy Way
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Quality for developers
Quality for developersQuality for developers
Quality for developers
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Testlink Test Management with Teamforge
Testlink Test Management with TeamforgeTestlink Test Management with Teamforge
Testlink Test Management with Teamforge
 
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
 
Unit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGUnit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUG
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform  Suryakiran Kasturi & Akhil KumarAdopting agile in an embedded platform  Suryakiran Kasturi & Akhil Kumar
Adopting agile in an embedded platform Suryakiran Kasturi & Akhil Kumar
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...
 
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build test
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014
 

Mais de ICS

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfICS
 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...ICS
 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarICS
 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfICS
 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfICS
 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfICS
 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfICS
 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up ICS
 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfICS
 
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesMDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesICS
 
How to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionHow to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionICS
 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsICS
 
IoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureIoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureICS
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt UsersICS
 
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...ICS
 
Qt Installer Framework
Qt Installer FrameworkQt Installer Framework
Qt Installer FrameworkICS
 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsICS
 
Overcome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyOvercome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyICS
 
User Experience Design for IoT
User Experience Design for IoTUser Experience Design for IoT
User Experience Design for IoTICS
 

Mais de ICS (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdf
 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues Webinar
 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdf
 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdf
 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up
 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdf
 
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesMDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
 
How to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionHow to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management Solution
 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory Teams
 
IoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureIoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with Azure
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt Users
 
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
 
Qt Installer Framework
Qt Installer FrameworkQt Installer Framework
Qt Installer Framework
 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory Teams
 
Overcome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyOvercome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case Study
 
User Experience Design for IoT
User Experience Design for IoTUser Experience Design for IoT
User Experience Design for IoT
 

Último

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 

Último (20)

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

[Webinar] Qt Test-Driven Development Using Google Test and Google Mock

  • 1. Š Integrated Computer Solutions, Inc. All Rights Reserved Qt Test-Driven Development Using Google Test and Google Mock Justin Noel, Senior Consulting Engineer 1
  • 2. Š Integrated Computer Solutions, Inc. All Rights Reserved Webinar Contents • Light introduction to Google Test / Google Mock • See bibliography for more information • Light introduction to TDD • See bibliography for more information • Designing applications for testability • Isolation of units • How to test with classes that use Qt • Using Google Test with Qt Creator • QObject, Qt Data types, Signals, Events 2
  • 3. Š Integrated Computer Solutions, Inc. All Rights Reserved Types of Testing • Unit Testing • Test one discrete area of the software • Usually on a class basis. Think “Test Piston Rod” • Tests can be written and performed as code is developed • White box tests. Often written by developers • “Does the software perform as the developer intended?” • Functional Testing • Tests subsystems of the whole software system • Usually a group of classes. Think “Test Engine” • Tests can be preformed once subsystem is wired together • Tests interaction between specific groups of units • “Does the software work together?” 3
  • 4. Š Integrated Computer Solutions, Inc. All Rights Reserved Types of Testing • System Testing • End to end testing of the whole software system • Sometimes includes actual hardware. Think “Test Car” • Tests are written late in project • Because of the end to end nature • Black box tests. Often written by separate SQA team • “Does the software do the right thing?” 4
  • 5. Š Integrated Computer Solutions, Inc. All Rights Reserved Google Test Creator Integration • Unified AutoTest Plugin (Qt Creator 4.0+) • QTest • QTest-QML • GoogleTest • Provides new Test Results output pane • Tree of Test Fixtures and Test Functions • Color codes success vs failure • Contains failure messages from Google Test • Provide Tests project view • Select which tests to run 5
  • 6. Š Integrated Computer Solutions, Inc. All Rights Reserved Google Test Creator Plugin 6
  • 7. Š Integrated Computer Solutions, Inc. All Rights Reserved Enabling Auto Test Plugin • Start Qt Creator and enable the Auto Test plugin • Help -> About Plugins • Check Load for AutoTest under Utilities • Restart Qt Creator • You now have the following available • Test Results Output Pane • Tests Project View • Test Settings Pane under Tools -> Options • Show/Hide debug/warning console output • GoogleTest specific settings are here 7
  • 8. Š Integrated Computer Solutions, Inc. All Rights Reserved Design for Testability • Your code must be testable! • There are design techniques to help make your code more testable • Try not to add functions to production code just for tests • Sub classing for tests is acceptable (access designer UI members) • Isolation of units is your primary goal • Can I just test this class? • Without re-testing lower level classes? • Also think about error conditions • Some may be hard to produce in production environments • Can I stimulate a bad MD5 error? • Socket disconnects? • Default switch cases? 8
  • 9. Š Integrated Computer Solutions, Inc. All Rights Reserved Build Application as Libraries Building the bulk of your application as a set of libraries increases testability 9
  • 10. Š Integrated Computer Solutions, Inc. All Rights Reserved Layered Design • A layered design is more testable • Easy to isolate lower layers for testing • Test Communications without Data, Presentation or Visualization • No upwards dependencies • Hard downward dependencies 10
  • 11. Š Integrated Computer Solutions, Inc. All Rights Reserved Break Downward Dependencies • Dependency injection works well • An Inversion of Control Pattern • Classes take their dependencies as constructor arguments • Classes do not construct any members themselves • Loose coupling with signals and slots also works well • Classes interface to each other via signals and slots only • 3rd class wires say the UI classes to the Backend classes • Lets you substitute a test fixture object for a dependency object • Instead of an actual production object 11
  • 12. Š Integrated Computer Solutions, Inc. All Rights Reserved Why is isolation important? • Avoids testing the same code over and over • You have already tested the data model • Why do the UI tests need to also test the model? • This will make your tests run very quickly • If there is a failure in a low level class it won’t trigger errors in higher level tests • Avoid testing side effects • Tests can be implementation agnostic • DB, Files, Cloud. Shouldn’t matter for UI tests. • Tests should only depend on interfaces, not behavior 12
  • 13. Š Integrated Computer Solutions, Inc. All Rights Reserved EE Analogy: Motor Controller Test 13
  • 14. Š Integrated Computer Solutions, Inc. All Rights Reserved Google Test/Mock Libraries • Google Test and Google Mock are C++ libraries • New version (1.8) combines gtest and gmock in one project • Called “googletest” • Link to them as you would any other C++ library • Only your test executables should need gtest and gmock libs • g[test|mock]_main and libraries offer a prebuilt main function • Build googletest using Cmake. make && make install • Use from a known location like Qt • Build GoogleTest inside your project using short .pro/.pri • I prefer this to avoid compiler flag incompatibilities • Windows is famous for mix/match incompatibilities • Qt’s GoogleTest project template does this method 14
  • 15. Š Integrated Computer Solutions, Inc. All Rights Reserved Google Test/Mock In Project Build Google Test and Google Mock with this short .pro 15 TEMPLATE = lib CONFIG += static exceptions CONFIG -= debug_and_release TARGET = GoogleTest INCLUDEPATH += googletest/googletest/include googletest/googlemock/include googletest/googletest googletest/googlemock SOURCES = googletest/googletest/src/gtest-all.cc googletest/googlemock/src/gmock-all.cc
  • 16. Š Integrated Computer Solutions, Inc. All Rights Reserved GTest is a unit testing framework • Prepare • Create dependencies • Create object under test • Setup expectations • Mock Expectations, QSignalSpy, etc • Stimulate • Call a 1 function or emit a signal • Verify • Check that expectations occurred • And/or check return value 16
  • 17. Š Integrated Computer Solutions, Inc. All Rights Reserved GTest Verifications • ASSERT_EQ(a, b) – Equality Operator • Works for QString, std::string, etc • QString needs a “Pretty Printer” to be truly integrated • ASSERT_TRUE(exp) – Boolean Expression • ASSERT_DOUBLE_EQ(a, b) – Fuzzy Compare • ASSERT_FLOAT_EQ(a, b) – Fuzzy Compare • ASSERT_STREQ(a, b) – char* comparison 17
  • 18. Š Integrated Computer Solutions, Inc. All Rights Reserved Expection, Assert, Abort, Exit • EXPECT_THROW(foo(), execptionType) • EXPECT_NO_THROW(foo(), exceptionType) • ASSERT_DEATH(foo()) • Fails if program did not exit() or abort() • assert(), Q_ASSERT(), etc will abort() • Very useful for testing “Does CTRL-C exit my program” • These types of tests can pass on unhandled exceptions and exiting. Tests will continue on as usual. • This is something that is hard to do in QtTest. 18
  • 19. Š Integrated Computer Solutions, Inc. All Rights Reserved Qt Specific Things • Not supplied by Google Test • QtTest does supply these. Link to QtTest and use them. • QSignalSpy • Test for signal emits • QTest::mouseClick, QTest::keyClicks, etc • Stimulate Qt events 19
  • 20. Š Integrated Computer Solutions, Inc. All Rights Reserved Print Qt Data Types in Output • Google Test would like to print text for objects using ASSERT_EQ • std::ostream << operators work • Or implement a PrintTo function • Put this in a header file and include it in your test files 20 QT_BEGIN_NAMESPACE inline void PrintTo(const QString &qString, ::std::ostream *os) { *os << qPrintable(qString); } QT_END_NAMESPACE
  • 21. Š Integrated Computer Solutions, Inc. All Rights Reserved Creating a Test Fixture 21 #include <gtest/gtest.h> using namespace ::testing; // Fixture class ExampleTest : public Test { protected: Example m_example; // Object Under Test }; // Test Function TEST_F(ExampleTest, ThisShouldFail) { ASSERT_TRUE(false); }
  • 22. Š Integrated Computer Solutions, Inc. All Rights Reserved New Objects For Every Test Function • A new Fixture is created for every test function • All new objects are created for each test • Helps ensure that tests do no depend on each other • Or pollute the environment for future tests • Can use constructor and destructor to setup tests • Unless there may be exceptions thrown • Fixtures have Setup() and TearDown() functions to handle that case • Some projects have policy to only use Setup() and TearDown() with empty constructor and destructor 22
  • 23. Š Integrated Computer Solutions, Inc. All Rights Reserved Test Fixture Project 23 QT += test # QtTest includes QSignalSpy, event stimulators, etc CONFIG += console # Create an stdout window on Windows CONFIG += testcase # Creates make check target INCLUDEPATH += ../GoogleTest/include LIBS += -L../GoogleTest/lib –lGoogleTest # Lib name(s) depends on build SOURCES += TestQString.cpp qmake make LD_LIBRARY_PATH=<paths> make check
  • 24. Š Integrated Computer Solutions, Inc. All Rights Reserved Running Selected Test Fixtures • Google test supplies a very intelligent main helpers • Defaults to running all the tests • Command line options can run any subset of tests • By fixture name or test name 24 #include <gmock/gmock.h> int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); testing::InitGoogleMock(&argc, argv); return RUN_ALL_TESTS();
  • 25. Š Integrated Computer Solutions, Inc. All Rights Reserved Running Selected Test Fixtures • Test Project View can select tests 25
  • 26. Š Integrated Computer Solutions, Inc. All Rights Reserved Running Tests Within Creator • Tests must be executed from the Test Results Pane • Run All • Run Selected • Filter Results • Show failures only • Double clicking a failure navigates to the test code 26
  • 27. Š Integrated Computer Solutions, Inc. All Rights Reserved Writing Good Tests • Test one thing at a time • It’s tempting to get as much done in one function as you can. • This makes one verification depend on another verification • Tests will be brittle and changes to code could break lots of verifications • Do not have your tests depend on each other • Order should not matter! • Not depending on other tests will help you when you remove functionality. • You do not want to have to fix a cascading waterfall of tests! • Google Test has a shuffle mode command line parameter • Keeps you from depending on previous tests 27
  • 28. Š Integrated Computer Solutions, Inc. All Rights Reserved Test Driven Development (TDD) • An entirely new way of writing code • Mind bending at first. Hard to re-train your brain • 1 Test is written before ~1 code is written • Test must fail before the line of code is written • Write the minimum code necessary to pass the test • Often the WRONG code to pass the first couple tests • Write another test 28
  • 29. Š Integrated Computer Solutions, Inc. All Rights Reserved Benefits of TDD • Every line of code is well tested • Tests are written as code is written • High code coverage • Obscure conditions are tested along with normal paths • No unused code paths • Paths are used as test are written • Awkward APIs are found by class developers. Not class users! • Tests are known to fail when expected code is not correct • Because the test failed without that line of code present • Tests did not pass by “coincidence” 29
  • 30. Š Integrated Computer Solutions, Inc. All Rights Reserved Drawbacks of TDD • Larger developed code size. More code more time. • Possibly > 10 SLOC of Tests for ~1 SLOC of Code • Re-working behavior can be difficult without re-writing many tests • Re-factor is easier as code is usually more modular • For example: Move tests with code to another class. • Hard part is still hard. • Design is still the hardest part to coding. • Increased testing of the implementation will not fix design issues • Code that isn’t written still isn’t tested • i.e. A function can be passed bad data. • If there is no test there is no guard for bounds... Boom! • Code still needs to be reviewed and corner cases caught. 30
  • 31. Š Integrated Computer Solutions, Inc. All Rights Reserved TDD a Division Function Demo 31
  • 32. Š Integrated Computer Solutions, Inc. All Rights Reserved Google Mock is a Dependency Replacement Framework • Mock allows you to easily replace production class dependencies with testing alternatives • Provides the ability to hi-jack return variables and error conditions • Provides ability to “expect calls” to be made • Check the parameters of those calls • Mock allows us to test against the interface of the dependency • Not the behavior or implementation • No reason to actually write to a database or files • Simply verify that object calls Logger log() function satisfies test 32
  • 33. Š Integrated Computer Solutions, Inc. All Rights Reserved Production Implementations 33
  • 34. Š Integrated Computer Solutions, Inc. All Rights Reserved Battery Test Implementation Battery has been isolated from the rest of the system 34
  • 35. Š Integrated Computer Solutions, Inc. All Rights Reserved Dependency Injection • Constructors to classes take references to dependencies • Rather than having self created members • Sometimes setters are used rather than constructors • Either way makes it easy to swap out dependencies • Dependency Injection can help isolate units • Each class has a base class interface with pure virtuals • IBatteryCell • Inherited by BatteryCell and MockBatteryCell • Interface has to inherit QObject to use signals and Q_PROPERTY • Properties can be declared with pure virtual READ and WRITE 35
  • 36. Š Integrated Computer Solutions, Inc. All Rights Reserved IBatteryCell 36 #include "ApplicationLibDecl.h" #include <QObject> class APPLICATIONLIB_EXPORT IBatteryCell : public QObject { Q_OBJECT Q_PROPERTY(double chargePercent READ chargePercent WRITE chargePercentChanged) public: virtual double chargePercent() const = 0; signals: void chargePercentChanged(); };
  • 37. Š Integrated Computer Solutions, Inc. All Rights Reserved MockBatteryCell 37 #include "IBatteryCell.h" #include <gmock/gmock.h> class MockBatteryCell : public IBatteryCell { Q_OBJECT public: MOCK_CONST_METHOD0(chargePercent, double()); };
  • 38. Š Integrated Computer Solutions, Inc. All Rights Reserved Using Mock in a Fixture 38 class BatteryTest : public Test { public: BatteryTest() : m_battery(m_batteryCellOne, m_batteryCellTwo) { } protected: //Dependencies NiceMock<MockBatteryCell> m_batteryCellOne; NiceMock<MockBatteryCell> m_batteryCellTwo; //Class Under Test Battery m_battery; };
  • 39. Š Integrated Computer Solutions, Inc. All Rights Reserved Mock Expectations • EXPECT_CALL • Verifies that a function was called • How many times? With what parameters? 39 TEST_F(SomeTest, SetValueCalledWithCorrectParameter) { EXPECT_CALL(m_mockDep, setValue(1)).Times(AtLeast(1)); m_underTest.setAllValues(); }
  • 40. Š Integrated Computer Solutions, Inc. All Rights Reserved Mock Return Value • ON_CALL or EXPECT_CALL can make the mocked function return arbitrary values • Even return different values based on parameters • Or return different values based on how many times it was called 40 TEST_F(SomeTest, CalculateReturnsDepFooPlusBar) { ON_CALL(m_mockDep, getValue(“Foo”)).WillByDefault(Return(5.0)); ON_CALL(m_mockDep, getValue(“Bar”)).WillByDefault(Return(55.0)); ASSERT_DOUBLE_EQ(60.0, m_underTest.calculate()); }
  • 41. Š Integrated Computer Solutions, Inc. All Rights Reserved Turning Mock Implicit Failure • Regular MockType instance • Warns on uninteresting calls • Functions called without explicit EXPECT_CALL or ON_CALL • Test passes with warnings printed to console • StrictMock<MockType> • Fails on any uninteresting call • NiceMock<MockType> • Fails only when explicit expectations are not met • Suppresses uninteresting warnings 41
  • 42. Š Integrated Computer Solutions, Inc. All Rights Reserved Mock Has Many Features • Far too many to list or describe in a 1 hour webinar • There are entire books dedicated to Google Mock • Tune Expectations • Return(ByRef(val)), WillOnce, WillByDefault, Times(), GreaterThan() • Custom Matchers • Verify parameters by arbitrary means • Compare based on members • Id() function on a pointer type • List goes on and on 42
  • 43. Š Integrated Computer Solutions, Inc. All Rights Reserved Testing a Signal • QSignalSpy from QTest can test signals without a slot • QTest also has functions for stimulating user events 43 TEST_F(SomeTest, MouseClickEmitsClickedSingal) { QSignalSpy spy(&m_button, SIGNAL(clicked())); QTest::mouseClick(m_button); ASSERT_EQ(1, spy.count()); }
  • 44. Š Integrated Computer Solutions, Inc. All Rights Reserved Stimulating a Signal • signals is a #define public • Emit dependent object signals directly! • emit is a #define to nothing 44 TEST_F(SomeTest, DepUpdateSignalChangesValue) { m_underTest.setValue(5); emit m_mockDep.update(10); // emit is actually optional ASSERT_EQ(10, m_underTest.value()); }
  • 45. Š Integrated Computer Solutions, Inc. All Rights Reserved Q_PROPERTY Macro Testing • Two options to test Q_PROPERTY via TDD • 1) Use Private/Protected READ and WRITE methods • Test the property like a public function using • obj.property(“name”).to[Type]() • obj.setProperty(“name”, variantValue) • Only useful if class is only used via properties. Say for QML. • 2) Test public getter and setter as usual • Then test the Q_PROPERTY using dummy READ / WRITE methods • You end up with the exact same tests as get/set methods • Finally refactor the Q_PROPERTY to use regular get/set • All tests should still pass • However, you end up with 2x tests. Bulletproof tests. 45
  • 46. Š Integrated Computer Solutions, Inc. All Rights Reserved Q_PROPERTY NOTIFY / CONSTANT • Check the name of the property's NOTIFY signal • Use QMetaObject / QMetaProperty / QMetaMethod 46 • Check for property’s CONSTANT flag • Use QMetaObject / QMetaProperty int propertyIndex = m_battery.metaObject()->indexOfProperty("chargePercent"); QMetaProperty property = m_battery.metaObject()->property(propertyIndex); ASSERT_STREQ("chargePercentChanged", property.notifySignal().name().data()); int propertyIndex = m_battery.metaObject()->indexOfProperty("chargePercent"); QMetaProperty property = m_battery.metaObject()->property(propertyIndex); ASSERT_TRUE(property.isConstant());
  • 47. Š Integrated Computer Solutions, Inc. All Rights Reserved Battery Test Example 47
  • 48. Š Integrated Computer Solutions, Inc. All Rights Reserved Bibliography Google Test • Primer • https://github.com/google/googletest/blob/master/googletest/docs/Primer. md • Cook Book • https://github.com/google/googletest/blob/master/googlemock/docs/CookB ook.md 48
  • 49. Š Integrated Computer Solutions, Inc. All Rights Reserved Bibliography Google Mock • Primer • https://github.com/google/googletest/blob/master/googlemock/docs/ForDu mmies.md • Cook Book • https://github.com/google/googletest/blob/master/googlemock/docs/CookB ook.md • Cheat Sheet • https://github.com/google/googletest/blob/master/googlemock/docs/CheatS heet.md 49
  • 50. Š Integrated Computer Solutions, Inc. All Rights Reserved Bibliography TDD • http://www.agiledata.org/essays/tdd.html • http://www.jamesshore.com/Agile-Book/test_driven_development.html • http://www.amazon.com/Modern-Programming-Test-Driven-Development- Better/dp/1937785483/ref=sr_1_1?ie=UTF8&qid=1455140098&sr=8- 1&keywords=TDD+C%2B%2B • http://www.amazon.com/Test-Driven-Development-Kent- Beck/dp/0321146530/ref=sr_1_fkmr0_1?ie=UTF8&qid=1455140098&sr=8-1- fkmr0&keywords=TDD+C%2B%2B 50
  • 51. Š Integrated Computer Solutions, Inc. All Rights Reserved Bibliography • SOLID Object Oriented Design Principles • https://en.wikipedia.org/wiki/SOLID_(object-oriented_design) • http://www.codemag.com/article/1001061 • https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented- design 51
  • 52. Š Integrated Computer Solutions, Inc. All Rights Reserved Thank You! 52