SlideShare a Scribd company logo
Introduction to good practices in
software development
Testing &
Continuous Delivery 101
Nelson Melina
What is Unit Testing ?
● An Unit is smallest testable part of source
code.
● It Can be an entire interface or just a method
(OOP).
● Unit Testing isolates parts of a software and
verify that each parts behave as intended.
What are the benefits of Unit Testing
?
● You will find potential problems at the earliest
time possible.
● You can refactor code without the fear or
regression issues.
● The tests serve as a design documentation
of how a unit is supposed to work.
What are the limits of Unit Testing ?
● They only show the presence or absence of
particular errors
● For every line of code written, programmers
often need 3 to 5 lines of test code.
● Nondeterministic and multiple threads
algorithms can not be easily tested.
● Rigorous discipline is needed throughout the
software development process.
What are the most common tools of
Unit Testing ?
● JUnit (framework)
● DBUnit (extension of JUnit)
● Mock objects frameworks
Mock Objects
● They are simulated objects that mimic the behavior of
real objects in controlled ways
● We need to use them when an object :
– returns non-deterministic results.
– has states that are difficult to reproduce (e.g., a network
error).
– is slow (e.g., a database).
– does not yet exist or may change behavior.
– would have to include information or methods only for
testing.
What is Integration Testing ?
● Occurs after Unit Testing and before
validation testing.
● Combination of individual software modules
that will be tested as a group.
The next step towards complete
efficiency is Continuous Integration
Repository
Unit tests A
Code A
Code B
Code C
Unit tests B
Unit tests C
Unit Tests A, B, C
& Integration Tests
(A + B + C)
Module A (Wallet)
Module B (Widget)
Module C (MAV)
Feedbacks (Alerts,
Information, Errors or
Statuses) via email to
whom is concerned.
Continuous Integration Server
(Hudson)
Is the aggregate
behaving well ?
Here are the key principles of CI
● Maintain a code repository.
●
Automate the build.
●
Make the build self-testing.
●
Everyone commits every day.
● Every commit should be built.
●
Keep the build fast.
●
Test in a clone of the production environment.
●
Make it easy to get the latest deliverables.
● Everyone can see the results of the latest build.
●
Automate deployment.
Advantages of Continuous
Integration
● When unit tests fail, developers can revert to a bug
free state.
● Integration problems and problematic changes are
continuously detected and fixed.
● Immediate feedback to developers.
● Frequent code commits pushes developers to create
modular and less complex code.
● Metrics generated from automated testing and CI.
The final goal is to achieve
Continuous Delivery
What is Continuous Delivery ?
Why would we change our way of
working ?
● Reduce current and future costs
– Without an automated process, developers lose a great amount
of time testing manually the features they program.
– The latter we find a bug, the more expensive it is to fix.
*
● Reduce risks
– It is impossible to guaranty that all manually executed test will
always be thorough and accurate.
Go further
● http://www.citconf.com/
● http://www.martinfowler.com/articles/continuousIntegration.html
● http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix
● http://www.thoughtworks.com/continuous-delivery
● http://www.thoughtworks-studios.com/content/introduction-continuous-delivery
● http://stackoverflow.com
● http://continuousdelivery.com/
● http://www.thoughtworks-studios.com/content/introduction-continuous-delivery
● http://programmers.stackexchange.com/questions/140156/is-unit-testing-or-test-driven-d
● http://elegantcode.com/2012/01/06/you-are-responsible-for-making-that-feature-work-wr
● http://www.scrumalliance.org/articles/486-unit-testing-ignored-and-
misunderstood

More Related Content

PPTX
Python: Object-oriented Testing
PPTX
Software Testing & Debugging
PPTX
Unit testing
PDF
TDD and Unit Testing in Golang
PPTX
Types of testing
PPTX
PPT
PPTX
White box testing
Python: Object-oriented Testing
Software Testing & Debugging
Unit testing
TDD and Unit Testing in Golang
Types of testing
White box testing

What's hot (20)

PPTX
Software testing ppt
PPT
Testing concepts ppt
PPT
Software testing
PPT
Software Testing Tecniques
PPTX
Python: Design Patterns
ODP
Testing Philosphies
PPT
6 Weeks Industrial Training in Testing
PDF
Learn Bug Reporting Techniques
PDF
Test-Driven Development Reference Card
PPT
Software testing strategies
PPSX
Manual testing
PPTX
Testing and types of Testing
PPTX
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
PDF
Testing on frontend
PDF
Agile QA Automation process
PPT
documentation-testing.ppt
PPTX
Pair programming and introduction to TDD
PPTX
PPTX
Intro to Manual Testing
PDF
What is objectives of software testing
Software testing ppt
Testing concepts ppt
Software testing
Software Testing Tecniques
Python: Design Patterns
Testing Philosphies
6 Weeks Industrial Training in Testing
Learn Bug Reporting Techniques
Test-Driven Development Reference Card
Software testing strategies
Manual testing
Testing and types of Testing
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Testing on frontend
Agile QA Automation process
documentation-testing.ppt
Pair programming and introduction to TDD
Intro to Manual Testing
What is objectives of software testing
Ad

Viewers also liked (9)

PPT
Jacket bag
PDF
Psy 652 symboyleytikh_omhlikon
ODP
δυσκολιεσ μαθησησ συμβουλευτικο κεντρο αθηνων
ODP
διδακτικη του σεπ
ODP
δυσκολιεσ μαθησησ συμβουλευτικο κεντρο αθηνων
PPTX
Educational Approaches to Emotionally and Behaviorally Disturbed Children
ODP
συμβουλευτικη και νεεσ τεχνολογιεσ
PDF
παρουσίαση1 1
PPTX
Risk reduction in emergency dep 1 (2)
Jacket bag
Psy 652 symboyleytikh_omhlikon
δυσκολιεσ μαθησησ συμβουλευτικο κεντρο αθηνων
διδακτικη του σεπ
δυσκολιεσ μαθησησ συμβουλευτικο κεντρο αθηνων
Educational Approaches to Emotionally and Behaviorally Disturbed Children
συμβουλευτικη και νεεσ τεχνολογιεσ
παρουσίαση1 1
Risk reduction in emergency dep 1 (2)
Ad

Similar to Testing & continuous delivery (20)

PDF
Continuous Integration
PDF
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOps
PPTX
Continuos Delivery
PDF
Continuous testing in agile projects 2015
PDF
How Continuous Testing Improves Software Quality.pdf
PPTX
Continuous Testing & Agile QA practices .pptx
PDF
Continuous Delivery Testing @HiQ
PDF
Continuous, continuous, continuous
PDF
Introduction to Continuous Delivery
PPTX
Test Driven Development & CI/CD
PDF
What is Unit Testing_ - A Complete Guide.pdf
PPTX
Introduction to Continuous Delivery (BBWorld/DevCon 2013)
PDF
Continuous Testing
PDF
What is Continuous Integration Testing.pdf
PDF
Enabling Agile Testing Through Continuous Integration Agile2009
PDF
What Is Unit Testing A Complete Guide With Examples.pdf
PPTX
Project Onion unit test environment
PDF
An Ultimate Guide to Continuous Testing in Agile Projects.pdf
PPS
Unit Testing
PPTX
What is Continuous Integration and Continuous Delivery
Continuous Integration
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOps
Continuos Delivery
Continuous testing in agile projects 2015
How Continuous Testing Improves Software Quality.pdf
Continuous Testing & Agile QA practices .pptx
Continuous Delivery Testing @HiQ
Continuous, continuous, continuous
Introduction to Continuous Delivery
Test Driven Development & CI/CD
What is Unit Testing_ - A Complete Guide.pdf
Introduction to Continuous Delivery (BBWorld/DevCon 2013)
Continuous Testing
What is Continuous Integration Testing.pdf
Enabling Agile Testing Through Continuous Integration Agile2009
What Is Unit Testing A Complete Guide With Examples.pdf
Project Onion unit test environment
An Ultimate Guide to Continuous Testing in Agile Projects.pdf
Unit Testing
What is Continuous Integration and Continuous Delivery

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
cuic standard and advanced reporting.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Machine Learning_overview_presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Dropbox Q2 2025 Financial Results & Investor Presentation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
cuic standard and advanced reporting.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine Learning_overview_presentation.pptx
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars

Testing & continuous delivery

  • 1. Introduction to good practices in software development Testing & Continuous Delivery 101 Nelson Melina
  • 2. What is Unit Testing ? ● An Unit is smallest testable part of source code. ● It Can be an entire interface or just a method (OOP). ● Unit Testing isolates parts of a software and verify that each parts behave as intended.
  • 3. What are the benefits of Unit Testing ? ● You will find potential problems at the earliest time possible. ● You can refactor code without the fear or regression issues. ● The tests serve as a design documentation of how a unit is supposed to work.
  • 4. What are the limits of Unit Testing ? ● They only show the presence or absence of particular errors ● For every line of code written, programmers often need 3 to 5 lines of test code. ● Nondeterministic and multiple threads algorithms can not be easily tested. ● Rigorous discipline is needed throughout the software development process.
  • 5. What are the most common tools of Unit Testing ? ● JUnit (framework) ● DBUnit (extension of JUnit) ● Mock objects frameworks
  • 6. Mock Objects ● They are simulated objects that mimic the behavior of real objects in controlled ways ● We need to use them when an object : – returns non-deterministic results. – has states that are difficult to reproduce (e.g., a network error). – is slow (e.g., a database). – does not yet exist or may change behavior. – would have to include information or methods only for testing.
  • 7. What is Integration Testing ? ● Occurs after Unit Testing and before validation testing. ● Combination of individual software modules that will be tested as a group.
  • 8. The next step towards complete efficiency is Continuous Integration
  • 9. Repository Unit tests A Code A Code B Code C Unit tests B Unit tests C Unit Tests A, B, C & Integration Tests (A + B + C) Module A (Wallet) Module B (Widget) Module C (MAV) Feedbacks (Alerts, Information, Errors or Statuses) via email to whom is concerned. Continuous Integration Server (Hudson) Is the aggregate behaving well ?
  • 10. Here are the key principles of CI ● Maintain a code repository. ● Automate the build. ● Make the build self-testing. ● Everyone commits every day. ● Every commit should be built. ● Keep the build fast. ● Test in a clone of the production environment. ● Make it easy to get the latest deliverables. ● Everyone can see the results of the latest build. ● Automate deployment.
  • 11. Advantages of Continuous Integration ● When unit tests fail, developers can revert to a bug free state. ● Integration problems and problematic changes are continuously detected and fixed. ● Immediate feedback to developers. ● Frequent code commits pushes developers to create modular and less complex code. ● Metrics generated from automated testing and CI.
  • 12. The final goal is to achieve Continuous Delivery
  • 13. What is Continuous Delivery ?
  • 14. Why would we change our way of working ? ● Reduce current and future costs – Without an automated process, developers lose a great amount of time testing manually the features they program. – The latter we find a bug, the more expensive it is to fix. * ● Reduce risks – It is impossible to guaranty that all manually executed test will always be thorough and accurate.
  • 15. Go further ● http://www.citconf.com/ ● http://www.martinfowler.com/articles/continuousIntegration.html ● http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix ● http://www.thoughtworks.com/continuous-delivery ● http://www.thoughtworks-studios.com/content/introduction-continuous-delivery ● http://stackoverflow.com ● http://continuousdelivery.com/ ● http://www.thoughtworks-studios.com/content/introduction-continuous-delivery ● http://programmers.stackexchange.com/questions/140156/is-unit-testing-or-test-driven-d ● http://elegantcode.com/2012/01/06/you-are-responsible-for-making-that-feature-work-wr ● http://www.scrumalliance.org/articles/486-unit-testing-ignored-and- misunderstood

Editor's Notes

  • #5: Achieving a 100% code coverage isn't necessarily the victory objective here, for two reasons, first testing one case of each methods does not permit us to say that we are potentially bug free. At the same time, testing all cases of a method can be quite time consuming, rendering the tests too expensive for the company. So what we need to do is fine the right amount or amounts (depending on the project) of tests that we need to improve our quality of work while staying cost-efficient.
  • #8: In addition to the unit tests it is necessary to regularly test the whole of an application with integration tests.
  • #10: To do this, there are specialized products of continuous integration which will : retrieve the source code of a component which was just commited on a repository recompile that source code relaunch unit tests package the compile code of the component in an archive deploye it on a specific test environment launch integration tests of the aggregate of the components pass on messages and statistics to the developer concerned (and other people indicated in settings) generate and stock a new version of the whole application if the tests went well. Most of the continuous integration environments use MAVEN or ANT as fundamental technologies
  • #12: Examples of Metrics : - Test Code coverage - Successful Build Rate - Build Repair Rate (It indicates the time taken to repair a failed build) - % of code duplicated - Lint checks - Coding standards violations - Build compilation time - Cyclic Complexity Number (CCN measures how many paths there are through a particular piece of code) - Dead code
  • #13: What we want to achieve with Continuous Delivery is, as soon as some code is ready, to automatically put it through Unit Tests then integration and acceptance tests, so that at any moment we want to, we can deploy to production and issue a release of the application.
  • #14: As we see it on this UML diagram, the key is to implement in our workflow an automated loop that causes us to correct our code the sooner possible until it is ready to put directly to production, thus increasing our speed to produce a qualitative product to our customers.
  • #15: Now we spend a lot of time testing manually after programming a feature, which cost the company money, and demotivate the developers. There is another factor that arise with this method of working, the risk, because as humans we can not guaranty that the tests will always be 100% thorough and accurate. Risks of what exactly ? Imagine a case where we discover one bug at the last stages of the process, it'll surely be much more complicated to fix than at the moment it was introduced. What we need is to speed up the whole process while improving the quality, and I believe we can do it with the concepts I introduced to you today. * Study made in 2002 by the National Institute of Standards and Technology (NIST).