SlideShare a Scribd company logo
1 of 17
Download to read offline
Testing Basic
Concepts
by Iván Corrales Solera, @wesovi
Index
● Code with tests vs code w/o tests
● Tests oriented development
● Types of testing
● Frameworks and tools (Java apps)
● Tests automation and CI
● Testing examples
Code with tests or w/o tests
● Do you think is better to do tests in your developments?
○ I supposed your answer would be YES
● Do you think development process take longer if we do tests?
○ YES? Why?
○ No, You are right, but why?
● What are the benefits of doing testing?
○ ….
Brief questions
Code with or w/o tests
Code with TestsCode w/o Tests
Refactor is so
risky!
Just necessary code
Software
with unused
code
Tests are our best documentation
We need to
get in the code
Developers Spending time
on understanding what code
does
Life is easier for new developers
Quick bug-fixing
Quality Software
Spending
long time on
bug-fixing
compiled
code but
NOT
software..
Re-factor is safe
Tests oriented development
Start writing tests
See the tests fail
Write code to make the tests pass
Pass the tests
TDD
● We will write code to make tests work
instead of writing some tests to check part of
our code.
● High test coberture levels.
● If we need to do bug-fixing we will start
writing some tests before making changes in
the code.
● Developers with experience in that
programming language.
BDD
● No technical people can define our tests
or help us to write them at least.
● Both technical and non technical people
speak the same language.
● BDD doesn’t mean not to do unit
testing.
● Our user stories will be completed when
acceptance criterias are satisfied.
● User stories can be tracked in the code.
Comparison
Steps
1. We have the software requirements
2. We think about what we need to test
3. We write some tests
4. Tests will fail
5. We write code to pass the tests
6. We can do some re-factor
Pros
● Code with quality
● We do not have unnecessary code
● We ensure our software works as expected.
● High test coberture level
● Low Bug-fixing time
Steps
1. We have the software requirements
2. We write code for the requirements
3. We write some tests to check our software
work
4. Run the tests
5. We’ll be happy when we have a test that
pass (probably because we know the
result before writing it)
Pros
● We have code with some tests
● Some coberture level
● Highly probably software with no high
quality
Writing code before tests Test before coding
Types of testing
Unit Testing
Integration Testing
Acceptance Testing
Stress Testing
UI Testing
Monkey Testing
Load Testing ….. Testing, Testing, Testing
Plenty types of testing… BUT we only need to do those testings that contribute to ensure the
quality of our application
Tests oriented development
People not used to
do test
Just code but NOT Software
Maybe Over tested
applications...
Software with QA and correct tests
No tests
We do not apply the correct
testing
Identify which testing are
suitable for our application
Code with lack of Testing
Tips on Testing
Do tests but just those ones that have sense for your code
Identify what kind of testing should we do depending on the application
Practicing TDD or NOT is up to the developers. They should never be forced to do it
Enforce developers to do tests but do NOT establish a minimum test coberture
Unit Testing
What are the unit testing for?
● Ensure a piece of code or method works as expected
● Make us achieve high test coberture levels
● Easy for developers but not understable by non-technical people.
● Tests must be run without application deployments
● Mocks are required
When do not we have to do unit testing?
● Front end applications
● We use MDA
● We use kind of code generation
frameworks.
When should we do unit testing?
● Complexed methods
● Algorithms and mathematics calculus
Integration Testing
When do not we have to do integration
testing?
● Our application does only one basic thing
such as a math operation or display hello
world in the screen.
When should we do integration testing?
● Most of architectures: WS, Batch,
microservices ,...
● Backend developed in Javascript (e2e)
● User interfaces
What are the integration testing for?
● Ensure our system works as expected.
● Does not really guarantee a high test coberture level.
● They must be run in environment similar to the production one.
● We could be forced to use mocks in case of we interact with third-party systems.
Acceptance Testing
What are the acceptance testing for?
● Make technical and non technical people speak the same language
● In scrum these tests would be the acceptance criterias defined for the user stories.
● If these are not defined by the Product Owner, we need his/her validation at least.Some people
think these tests are unnecessary since integration testing could be enough. (And they could be
right indeed)
● Natural language syntax (When, Then, And…. ) See below an example:
Given 10 can of beers
When I drink 2 of them
Then I should have 8 in my fridge.
Frameworks and tools (Java apps)
Tests automation and CI
Compile & Build Unit Tests Integration Tests Acceptance Tests
● The above flow represents the steps in the ci process.
● Each step above would be a different job in Jenkins (or whichever other CI tool)
● Each step will generate a report with the results
● We should not move to the next step in the flow in case of there were tests failing
● Developers must be able to run the tests from their local environment.
Sample - e2e for nodejs REST API
Code: https://github.com/wesovi/nodejs-authentication-api
Technologies: Nodejs, mocha, supertest
Snippet:
it('should response BAD REQUEST & the error details when password is empty ', function (done) {
var credentials = {username:"email@mail.com"};
request(app)
.post('/accounts/authenticate')
.send(credentials)
.set('Content-Type', 'application/json')
.expect('Content-Type', 'application/json; charset=utf-8')
.expect(400)
.expect({errors:[{ param: 'password', msg: 'required' }]})
.end(done);
});

More Related Content

What's hot

Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.pptKomal Garg
 
TESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPTTESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPTsuhasreddy1
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaEdureka!
 
Mobile application testing tutorial
Mobile application testing tutorialMobile application testing tutorial
Mobile application testing tutorialLokesh Agrawal
 
Mobile Application Testing Strategy
Mobile Application Testing StrategyMobile Application Testing Strategy
Mobile Application Testing StrategyankitQA
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application TestingNoor Orfahly
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test AutomationPekka Klärck
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobiGnosis
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual TestingAyah Soufan
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testingvodQA
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariJaved Ansari
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
Types of software testing
Types of software testingTypes of software testing
Types of software testingTestbytes
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with AppiumManoj Kumar Kumar
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notesdkns0906
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaEdureka!
 
ISTQB Foundation - Chapter 2
ISTQB Foundation - Chapter 2ISTQB Foundation - Chapter 2
ISTQB Foundation - Chapter 2Chandukar
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With AppiumKnoldus Inc.
 

What's hot (20)

Software testing.ppt
Software testing.pptSoftware testing.ppt
Software testing.ppt
 
TESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPTTESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPT
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | Edureka
 
Mobile application testing tutorial
Mobile application testing tutorialMobile application testing tutorial
Mobile application testing tutorial
 
Stlc ppt
Stlc pptStlc ppt
Stlc ppt
 
Mobile Application Testing Strategy
Mobile Application Testing StrategyMobile Application Testing Strategy
Mobile Application Testing Strategy
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
 
Intro to Manual Testing
Intro to Manual TestingIntro to Manual Testing
Intro to Manual Testing
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed Ansari
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notes
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
ISTQB Foundation - Chapter 2
ISTQB Foundation - Chapter 2ISTQB Foundation - Chapter 2
ISTQB Foundation - Chapter 2
 
Automation Testing With Appium
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With Appium
 

Similar to Testing Basic Concepts Explained

Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleikram_ahamed
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and AutomationMahesh Salaria
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering TeamsLars Thorup
 
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Abhijeet Vaikar
 
Should you be your own judge?
Should you be your own judge?Should you be your own judge?
Should you be your own judge?Achyut Pokhrel
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated TestingLars Thorup
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testingBestBrains
 
Software testing and software development process
Software testing and software development processSoftware testing and software development process
Software testing and software development processGen Aloys Ochola Badde
 
What is Unit Testing
What is Unit TestingWhat is Unit Testing
What is Unit TestingSadaaki Emura
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionJosh Gough
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptxAmalEldhose2
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1Blue Elephant Consulting
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When AutomatingAlan Richardson
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017Xavi Hidalgo
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testingmahmoud ramadan
 
Software testing enhance quality and performance of software
Software testing enhance quality and performance of softwareSoftware testing enhance quality and performance of software
Software testing enhance quality and performance of softwareEmipro Technologies Pvt. Ltd.
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testingcloud chen
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkPeter Kofler
 
PMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityPMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityThanh Nguyen
 

Similar to Testing Basic Concepts Explained (20)

Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-mule
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
 
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)
 
Should you be your own judge?
Should you be your own judge?Should you be your own judge?
Should you be your own judge?
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Software testing and software development process
Software testing and software development processSoftware testing and software development process
Software testing and software development process
 
What is Unit Testing
What is Unit TestingWhat is Unit Testing
What is Unit Testing
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous Inspection
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When Automating
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testing
 
Software testing enhance quality and performance of software
Software testing enhance quality and performance of softwareSoftware testing enhance quality and performance of software
Software testing enhance quality and performance of software
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testing
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
 
PMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 QualityPMI-ACP Lesson 06 Quality
PMI-ACP Lesson 06 Quality
 

Recently uploaded

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Testing Basic Concepts Explained

  • 1. Testing Basic Concepts by Iván Corrales Solera, @wesovi
  • 2. Index ● Code with tests vs code w/o tests ● Tests oriented development ● Types of testing ● Frameworks and tools (Java apps) ● Tests automation and CI ● Testing examples
  • 3. Code with tests or w/o tests ● Do you think is better to do tests in your developments? ○ I supposed your answer would be YES ● Do you think development process take longer if we do tests? ○ YES? Why? ○ No, You are right, but why? ● What are the benefits of doing testing? ○ …. Brief questions
  • 4. Code with or w/o tests Code with TestsCode w/o Tests Refactor is so risky! Just necessary code Software with unused code Tests are our best documentation We need to get in the code Developers Spending time on understanding what code does Life is easier for new developers Quick bug-fixing Quality Software Spending long time on bug-fixing compiled code but NOT software.. Re-factor is safe
  • 5. Tests oriented development Start writing tests See the tests fail Write code to make the tests pass Pass the tests
  • 6. TDD ● We will write code to make tests work instead of writing some tests to check part of our code. ● High test coberture levels. ● If we need to do bug-fixing we will start writing some tests before making changes in the code. ● Developers with experience in that programming language.
  • 7. BDD ● No technical people can define our tests or help us to write them at least. ● Both technical and non technical people speak the same language. ● BDD doesn’t mean not to do unit testing. ● Our user stories will be completed when acceptance criterias are satisfied. ● User stories can be tracked in the code.
  • 8. Comparison Steps 1. We have the software requirements 2. We think about what we need to test 3. We write some tests 4. Tests will fail 5. We write code to pass the tests 6. We can do some re-factor Pros ● Code with quality ● We do not have unnecessary code ● We ensure our software works as expected. ● High test coberture level ● Low Bug-fixing time Steps 1. We have the software requirements 2. We write code for the requirements 3. We write some tests to check our software work 4. Run the tests 5. We’ll be happy when we have a test that pass (probably because we know the result before writing it) Pros ● We have code with some tests ● Some coberture level ● Highly probably software with no high quality Writing code before tests Test before coding
  • 9. Types of testing Unit Testing Integration Testing Acceptance Testing Stress Testing UI Testing Monkey Testing Load Testing ….. Testing, Testing, Testing Plenty types of testing… BUT we only need to do those testings that contribute to ensure the quality of our application
  • 10. Tests oriented development People not used to do test Just code but NOT Software Maybe Over tested applications... Software with QA and correct tests No tests We do not apply the correct testing Identify which testing are suitable for our application Code with lack of Testing
  • 11. Tips on Testing Do tests but just those ones that have sense for your code Identify what kind of testing should we do depending on the application Practicing TDD or NOT is up to the developers. They should never be forced to do it Enforce developers to do tests but do NOT establish a minimum test coberture
  • 12. Unit Testing What are the unit testing for? ● Ensure a piece of code or method works as expected ● Make us achieve high test coberture levels ● Easy for developers but not understable by non-technical people. ● Tests must be run without application deployments ● Mocks are required When do not we have to do unit testing? ● Front end applications ● We use MDA ● We use kind of code generation frameworks. When should we do unit testing? ● Complexed methods ● Algorithms and mathematics calculus
  • 13. Integration Testing When do not we have to do integration testing? ● Our application does only one basic thing such as a math operation or display hello world in the screen. When should we do integration testing? ● Most of architectures: WS, Batch, microservices ,... ● Backend developed in Javascript (e2e) ● User interfaces What are the integration testing for? ● Ensure our system works as expected. ● Does not really guarantee a high test coberture level. ● They must be run in environment similar to the production one. ● We could be forced to use mocks in case of we interact with third-party systems.
  • 14. Acceptance Testing What are the acceptance testing for? ● Make technical and non technical people speak the same language ● In scrum these tests would be the acceptance criterias defined for the user stories. ● If these are not defined by the Product Owner, we need his/her validation at least.Some people think these tests are unnecessary since integration testing could be enough. (And they could be right indeed) ● Natural language syntax (When, Then, And…. ) See below an example: Given 10 can of beers When I drink 2 of them Then I should have 8 in my fridge.
  • 15. Frameworks and tools (Java apps)
  • 16. Tests automation and CI Compile & Build Unit Tests Integration Tests Acceptance Tests ● The above flow represents the steps in the ci process. ● Each step above would be a different job in Jenkins (or whichever other CI tool) ● Each step will generate a report with the results ● We should not move to the next step in the flow in case of there were tests failing ● Developers must be able to run the tests from their local environment.
  • 17. Sample - e2e for nodejs REST API Code: https://github.com/wesovi/nodejs-authentication-api Technologies: Nodejs, mocha, supertest Snippet: it('should response BAD REQUEST & the error details when password is empty ', function (done) { var credentials = {username:"email@mail.com"}; request(app) .post('/accounts/authenticate') .send(credentials) .set('Content-Type', 'application/json') .expect('Content-Type', 'application/json; charset=utf-8') .expect(400) .expect({errors:[{ param: 'password', msg: 'required' }]}) .end(done); });