SlideShare a Scribd company logo
1 of 20
Download to read offline
Visual Testing
Using PhantomCss
Vishnu Narang
@vishnu_narang
Shridhar Deshmukh
@_shree33
Why did we use it?
What was our use case?
Our use case.
● We are on a project, working on a multi-national,
multi locale marketing website. Each page of the
website is made up of modules. Each module can be
used on many pages with different content.
● Recently, we got a unique requirement. We needed to
go live in middle-east countries for which we needed
to support Right-to-Left (RTL) languages like Arabic.
Our use case. ..cont
● Not only does the content flow from right to left,
even the layout and the interactions needed to flow
from right to left.
● Obviously, we needed to change lots of CSS/HTML in
our common code to support this.
While implementing this, we realised one thing...
breaking CSS is easy, testing it is hard.
Breaking css is easy, testing it is hard...
● Every time you make a change in common css code for a
website, you always have the possibility that something else
breaks on some other page.
● In our case, changing css for RTL for some module sometimes
broke it’s LTR variation on some pages.
● We had to plan a CSS testing strategy.
CSS testing options..
● Jasmine:
We used jasmine for our javascript tests. But nothing stopped us from using it for CSS
“Unit” tests.
We would only test the following for elements:
○ Is it floated Left or Right
eg: expect($el).toHaveCss({float: right});
○ Does it have Left: auto or greater than zero.
eg: expect($el).toHaveCss({left: auto});
○ Is it on the left or right of another element.
eg: expect(rightElOffset).toBeGreaterThan(leftElOffset); right Element
(rightEl)
left Element
(leftEl)
$el(left: auto)
$el
What is PhantomCss?
● Tool for Automated Visual Testing.
● Used for Web Apps, Live style guides and
responsive layouts.
How it works?
● PhantomJs for headless webkit.
● CasperJs for screenshots.
● ResembleJs for image comparison.
Example
padding: 11px 19px; padding: 11px 20px;
Installation (based on Mac OS)
npm install phantomjs
...And start visual regression testing
git clone https://github.com/Huddle/PhantomCSS.git
brew install casperjs
● Layout related issues.
Demo
Demo
● Layout related issues.
● Selector based tests.
● Layout related issues.
● Selector based tests.
● Action based tests.
Demo
Best Practices
● Name your screenshots carefully
● Use same OS/Browser for both runs
● Test only when you need
● Don’t always take fullpage screenshots
When not to use it?
● Right at the start of your project when the
pages keep changing.
● On a small project with very few pages.
● When you have a better tool to do your
job.
Advanced Features
● Making it deterministic using network
monitoring and wait time. (github.gist)
● Parallel execution using multi-threading
(sbt) + PhantomCss
References & Resources
● Official Repo: https://github.com/Huddle/PhantomCSS
● Our Modified version:
https://github.com/vishnun/visual_testing_using_phantomcss
● github gist for network monitoring:
https://gist.github.com/vishnun/23c66b0bc6b6194cf5cc
● More tools and wrappers:
grunt-phantomcss, PhantomXHR, PhantomFlow and grunt-
phantomflow.
THANKS
Youtube Video of this talk.

More Related Content

Viewers also liked

Viewers also liked (8)

TDC 2014 SP - Visual Regression Testing com PhantomCSS
TDC 2014 SP - Visual Regression Testing com PhantomCSSTDC 2014 SP - Visual Regression Testing com PhantomCSS
TDC 2014 SP - Visual Regression Testing com PhantomCSS
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Kavya Prasad_Resume
Kavya Prasad_ResumeKavya Prasad_Resume
Kavya Prasad_Resume
 
PradeepKumar_Tableau Developer
PradeepKumar_Tableau DeveloperPradeepKumar_Tableau Developer
PradeepKumar_Tableau Developer
 
Naveen QlikView Developer
Naveen QlikView DeveloperNaveen QlikView Developer
Naveen QlikView Developer
 
Jagannath cv
Jagannath cvJagannath cv
Jagannath cv
 
Resume_Ganesh_updated
Resume_Ganesh_updatedResume_Ganesh_updated
Resume_Ganesh_updated
 
RESUME_TEJA
RESUME_TEJARESUME_TEJA
RESUME_TEJA
 

Similar to Visual testing using PhantomCss

"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...Fwdays
 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right wayYagiz Nizipli
 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application DevelopmentYagiz Nizipli
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentRandy Connolly
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular appsMartin Hochel
 
Xlab #2: wzorce projektowe
Xlab #2: wzorce projektoweXlab #2: wzorce projektowe
Xlab #2: wzorce projektoweXSolve
 
Intro to Flutter
Intro to FlutterIntro to Flutter
Intro to FlutterEason Pai
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
Javascript
JavascriptJavascript
JavascriptIblesoft
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteChristian Heilmann
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Atos_Worldline
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Devicefilirom1
 
Six reasons to learn JavaScript
Six reasons to learn JavaScriptSix reasons to learn JavaScript
Six reasons to learn JavaScriptOtto Kekäläinen
 
Beyond the Standards
Beyond the StandardsBeyond the Standards
Beyond the StandardsPaul Bakaus
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsMartin Hochel
 
Responsive, adaptive and responsible - keynote at NebraskaJS
Responsive, adaptive and responsible - keynote at NebraskaJSResponsive, adaptive and responsible - keynote at NebraskaJS
Responsive, adaptive and responsible - keynote at NebraskaJSChristian Heilmann
 
Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Matt Raible
 

Similar to Visual testing using PhantomCss (20)

"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
 
Web Development: Making it the right way
Web Development: Making it the right wayWeb Development: Making it the right way
Web Development: Making it the right way
 
Hybrid Application Development
Hybrid Application DevelopmentHybrid Application Development
Hybrid Application Development
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular apps
 
Xlab #2: wzorce projektowe
Xlab #2: wzorce projektoweXlab #2: wzorce projektowe
Xlab #2: wzorce projektowe
 
Intro to Flutter
Intro to FlutterIntro to Flutter
Intro to Flutter
 
React Workshop
React WorkshopReact Workshop
React Workshop
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
Javascript
JavascriptJavascript
Javascript
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynote
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Device
 
GWT Reloaded
GWT ReloadedGWT Reloaded
GWT Reloaded
 
Six reasons to learn JavaScript
Six reasons to learn JavaScriptSix reasons to learn JavaScript
Six reasons to learn JavaScript
 
Beyond the Standards
Beyond the StandardsBeyond the Standards
Beyond the Standards
 
Js basics
Js basicsJs basics
Js basics
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular apps
 
Responsive, adaptive and responsible - keynote at NebraskaJS
Responsive, adaptive and responsible - keynote at NebraskaJSResponsive, adaptive and responsible - keynote at NebraskaJS
Responsive, adaptive and responsible - keynote at NebraskaJS
 
Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016
 

Recently uploaded

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Visual testing using PhantomCss

  • 1. Visual Testing Using PhantomCss Vishnu Narang @vishnu_narang Shridhar Deshmukh @_shree33
  • 2. Why did we use it? What was our use case?
  • 3. Our use case. ● We are on a project, working on a multi-national, multi locale marketing website. Each page of the website is made up of modules. Each module can be used on many pages with different content. ● Recently, we got a unique requirement. We needed to go live in middle-east countries for which we needed to support Right-to-Left (RTL) languages like Arabic.
  • 4. Our use case. ..cont ● Not only does the content flow from right to left, even the layout and the interactions needed to flow from right to left. ● Obviously, we needed to change lots of CSS/HTML in our common code to support this. While implementing this, we realised one thing...
  • 5. breaking CSS is easy, testing it is hard.
  • 6. Breaking css is easy, testing it is hard... ● Every time you make a change in common css code for a website, you always have the possibility that something else breaks on some other page. ● In our case, changing css for RTL for some module sometimes broke it’s LTR variation on some pages. ● We had to plan a CSS testing strategy.
  • 7. CSS testing options.. ● Jasmine: We used jasmine for our javascript tests. But nothing stopped us from using it for CSS “Unit” tests. We would only test the following for elements: ○ Is it floated Left or Right eg: expect($el).toHaveCss({float: right}); ○ Does it have Left: auto or greater than zero. eg: expect($el).toHaveCss({left: auto}); ○ Is it on the left or right of another element. eg: expect(rightElOffset).toBeGreaterThan(leftElOffset); right Element (rightEl) left Element (leftEl) $el(left: auto) $el
  • 8. What is PhantomCss? ● Tool for Automated Visual Testing. ● Used for Web Apps, Live style guides and responsive layouts.
  • 9. How it works? ● PhantomJs for headless webkit. ● CasperJs for screenshots. ● ResembleJs for image comparison.
  • 10. Example padding: 11px 19px; padding: 11px 20px;
  • 11. Installation (based on Mac OS) npm install phantomjs ...And start visual regression testing git clone https://github.com/Huddle/PhantomCSS.git brew install casperjs
  • 12. ● Layout related issues. Demo
  • 13. Demo ● Layout related issues. ● Selector based tests.
  • 14. ● Layout related issues. ● Selector based tests. ● Action based tests. Demo
  • 15. Best Practices ● Name your screenshots carefully ● Use same OS/Browser for both runs ● Test only when you need ● Don’t always take fullpage screenshots
  • 16. When not to use it? ● Right at the start of your project when the pages keep changing. ● On a small project with very few pages. ● When you have a better tool to do your job.
  • 17. Advanced Features ● Making it deterministic using network monitoring and wait time. (github.gist) ● Parallel execution using multi-threading (sbt) + PhantomCss
  • 18.
  • 19. References & Resources ● Official Repo: https://github.com/Huddle/PhantomCSS ● Our Modified version: https://github.com/vishnun/visual_testing_using_phantomcss ● github gist for network monitoring: https://gist.github.com/vishnun/23c66b0bc6b6194cf5cc ● More tools and wrappers: grunt-phantomcss, PhantomXHR, PhantomFlow and grunt- phantomflow.

Editor's Notes

  1. Talk about the two things to test: Unit tests using Jasmine and Regression testing using screenshot comparison.
  2. PhantomCss is command line tools that can be used to automate the visual regression testing. In this process PhantomCss visits the specified web pages and take snapshots of them, may be at different viewport sizes. And then It compares these images with your baseline images that were taken before you made any changes in CSS. The images are compared pixel by pixel to determine if their is any difference between baseline image and newly taken image. For failed comparison PhantomCss creates comparison image which highlights the portion of images which actually got changed in newer snapshot. You can use PhantomCss to test your web app, if you are making any major refactoring around your css. You can also use PhantomCss to make sure that the change that you made for desktop breakpoint is not breaking mobile or tablet layout. With phantomCss you compare whole page with another page, and you can also compare part/section of page.
  3. PhantomCss is a combination of 3 different tools Phantom Js - is a headless webkit browser that allows you to render web pages Casper Js - A Navigation and scripting tool that allows you to interact with the page rendered by phantomJs Resembe Js - compares two images pixel by pixel and determine the differences between them