SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
@GirlCodeNL
/GirlCodeNL
@GirlCodeNL
/GirlCodeNL
We are Girl Code
katja
ineke
@afkatja
@FYIneke
@GirlCodeNL
/GirlCodeNL
Jest
Easy setup
Snapshot testing
@GirlCodeNL
/GirlCodeNL
UI Testing & Libraries @ bloomon by Mariyana Nikolaeva
-- Break --
Unit testing using Mocha by Marie Treschow
Questions and discussion
Drinks
Program
1strictly confidential -
• tekst
• tekst
• tekst
Agenda
UI testing
and component libraries
bloomon & girl code 2018
2strictly confidential -
• bloomon - stack and applications
• problem - many variations of the same component across apps
• solutions - storybook vs component library (e.g. material UI)
• summary - why consistency is important
In today’s talk:
3strictly confidential -
stack
4strictly confidential -
applications
customer-
facing
backofficeAPI microservices
5strictly confidential -
Inconsistent UI elements
6strictly confidential -
the button(s)
7strictly confidential -
possible solutions
bloomon UI
8strictly confidential -
storybook
9strictly confidential -
10strictly confidential -
component library
11strictly confidential -
• fork material ui repository
• add bloomon components to as
submodule
• include material-ui as dependency in
package.json
• make imports from material-ui bloomon components
Approach
12strictly confidential -
13strictly confidential -
storybook
• quick to include in apps
• no build script required
• easy component preview
• no centralized components
• storybook addons not mature
enough
Pros and Cons
component library
• one repo for components
• easy to import in apps
• unified documentation
• overhead of build and run tools
• maintain repository or CDN
• complex task
14strictly confidential -
• visual vocabulary between designers, UX and developers
• faster designs and implementation
• unified UIs and brand trust
• users learn how to use the UI faster
• less style micro decision to be made by developers
• single source of truth without code repetition
Why consistency is important
15strictly confidential -
Learnings
16strictly confidential -
Do not fork big repositories
17strictly confidential -
Small, easy steps
• styles repository
• storybooks for components per app
• storybook repository (as submodules, npm package)
• UI tests - structural, interaction, style testing
• component library with unit, integration and visual regression
tests
• well documented and hosted styleguide website
18strictly confidential -
Thank you
Unit testing with
Mocha
npm install mocha -g
Marie Treschow
Tonight’s Agenda
➔ Why testing?
➔ Testing levels
➔ Impact of good testing
➔ Unit Testing
➔ TDD vs BDD
➔ Mocha Framework
➔ Chai Assertion Library
➔ Sinon.js
Why Unit Testing?
“Adding value, not just bugs”
- Improve software quality
- Find bugs early
- Makes process agile
- Provides documentation
- Simplify debugging process
- Architecture
- Reduces cost
Different levels of software testing
Regression testing => previously developed software still performs
Acceptance testing => testing with respect to users needs
System testing => testing integrated system
Integration testing => individual units are combined
Unit testing => testing individual components
Business value of testing
★ Reliability
★ Customer satisfaction
★ Profitability
★ Shorter time to market
UNIT TESTING … where it all begins
What it is?
● Lowest level of software testing
● Individual units and components are tested
● Validate that each unit of code performs as designed
What it does?
➔ increase confidence in changing/maintaining code
➔ makes your code more reusable
➔ makes debugging easier
➔ code more reliable
What’s a good unit test?
1. Fast
2. Small
3. Simple
4. Plentiful
5. Isolated
6. Readable
7. Clean
What not to do...
Simple unit test
Terminal output
Testing your JavaScript
with Mocha, Chai and Sinon
Setting up
Mocha|Chai|Sinon
npm install mocha -g (OR) --save-dev
update your package.json and customize
your scripts in order to run mocha on
your terms, then simply run npm test
npm install chai --save-dev
npm install sinon --save-dev
Why Mocha?
★ Well maintained
★ Well documented
★ Optional assertion library
★ Supports TDD & BDD
★ Simplifies async testing
Let’s look at the features!
The power of Mocha
Features & Options:
● Browser support
● Async support, including
promises
● Test coverage reporting
● Hooks
● Test-specific timeouts
● Report test duration
● Highlights slow tests in
red and yellow
Useful flags:
- File watcher support
- Babel-hook
- Node debugger support
- Timeout
Psst.. check out:
https://mochajs.org/
Simple async module
Asynchronous testing with Mocha
Terminal output
TDD (test driven) vs. BDD (behavior driven)
1. Write the test
2. Run the test and see
it fail
3. Write the code
4. Run the test again
(not failing anymore)
5. Refactor
- More focused on the
features, not results
- Important: the ability
to read your tests like
a sentence is a
cognitive shift in how
you will think about it
Let’s imagine this function:
function factorial(n){
if(n < 0) return NaN;
if(n === 0) return 1;
return n * factorial(n-1);
}
TDD style exampleBDD style example
Terminal output
HOOKS
before();
runs before any tests in each describe() block
after();
runs after all tests in each describe() block
beforeEach();
runs before every test in a describe block
afterEach();
runs after every test in a describe block
Good for: setting up preconditions and clean up after your tests
(database fixture, servers etc)
Pieces of code run either before or after certain tests
Hooks output example
Chai - should, expect, assert
● Pair with any JavaScript
testing framework
● Several interfaces that
allow you to choose
between whatever is
comfortable
Should (BDD)
Expect (BDD)
Assert (TDD)
expect('test').to.be.a('string');
[1,2,3].indexOf(4).should.equal(-1);
assert.strictEqual(true, true, ‘booleans are strictly equal’);
Assertion Methods
● equal
● strictEqual (===)
● deepEqual
● isNull
● include
● property
assert.deepEqual({ tea: 'green' }, { tea: 'green' });
assert.isNull(error, 'there was no error');
assert.include([1,2,3], 2, 'array contains value 2');
assert.property({ tea: { green: 'matcha' }}, 'property tea');
And some negative ones
● notEqual
● isNotOk
● notDeepEqual
● isNotNull
● notStrictEqual
assert.notEqual(3, 4, 'these numbers are not equal');
assert.isNotOk(false, 'this will pass');
assert.notDeepEqual({ tea: 'green'}, { tea: 'red'});
Sinon - spies, stubs, mocks
Things that makes testing hard:
➢ Databases
➢ Network
➢ File access
Spies/Stubs/Mocks: Test Doubles
➢ Replacements for pieces of code used in
your test
Different kinds of Test Doubles:
● Spies -> offer information about
function calls without affecting
their behavior
● Stubs -> are like spies, but
completely replace the function
(make it do whatever you like!)
● Mocks -> makes replacing whole
objects easy by combining both spies
and stubs (fake servers, timers,
xmlhttprequest)
http://sinonjs.org/
Testing TIPS:
➔ Keep your modules small
➔ Be sure to test success AND error
cases
➔ Test expected AND unexpected data
Thanks for listening!

Weitere ähnliche Inhalte

Was ist angesagt?

3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION APIGavin Pickin
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework OpenDaylight
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016Gavin Pickin
 
Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)Rainer Gerhards
 
C++ Testing Techniques Tips and Tricks - C++ London
C++ Testing Techniques Tips and Tricks - C++ LondonC++ Testing Techniques Tips and Tricks - C++ London
C++ Testing Techniques Tips and Tricks - C++ LondonClare Macrae
 
SQL or NoSQL - how to choose
SQL or NoSQL - how to chooseSQL or NoSQL - how to choose
SQL or NoSQL - how to chooseLars Thorup
 
Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseMichał Kordas
 
Make sure your code works
Make sure your code worksMake sure your code works
Make sure your code worksHenrik Skupin
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login applicationSomkiat Puisungnoen
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
Robot framework Gowthami Goli
Robot framework Gowthami GoliRobot framework Gowthami Goli
Robot framework Gowthami GoliGowthami Buddi
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectGlobalLogic Ukraine
 
Testing with laravel
Testing with laravelTesting with laravel
Testing with laravelDerek Binkley
 

Was ist angesagt? (20)

Report portal
Report portalReport portal
Report portal
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Scripting robot
Scripting robotScripting robot
Scripting robot
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)
 
C++ Testing Techniques Tips and Tricks - C++ London
C++ Testing Techniques Tips and Tricks - C++ LondonC++ Testing Techniques Tips and Tricks - C++ London
C++ Testing Techniques Tips and Tricks - C++ London
 
SQL or NoSQL - how to choose
SQL or NoSQL - how to chooseSQL or NoSQL - how to choose
SQL or NoSQL - how to choose
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java Universe
 
Make sure your code works
Make sure your code worksMake sure your code works
Make sure your code works
 
Robot Framework
Robot FrameworkRobot Framework
Robot Framework
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login application
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
Robot framework Gowthami Goli
Robot framework Gowthami GoliRobot framework Gowthami Goli
Robot framework Gowthami Goli
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java Project
 
Testing with laravel
Testing with laravelTesting with laravel
Testing with laravel
 

Ähnlich wie Developers Testing - Girl Code at bloomon

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
 
QA Meetup at Signavio (Berlin, 06.06.19)
QA Meetup at Signavio (Berlin, 06.06.19)QA Meetup at Signavio (Berlin, 06.06.19)
QA Meetup at Signavio (Berlin, 06.06.19)Anesthezia
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
StarWest 2019 - End to end testing: Stupid or Legit?
StarWest 2019 - End to end testing: Stupid or Legit?StarWest 2019 - End to end testing: Stupid or Legit?
StarWest 2019 - End to end testing: Stupid or Legit?mabl
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Malinda Kapuruge
 
DevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsDevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsFedir RYKHTIK
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Tzach Zohar
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Борис Зора
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed Moishin
 
Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018David Tan
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)CIVEL Benoit
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1CIVEL Benoit
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the CloudJim Driscoll
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Gabriel carabat a healthy approach for test automation
Gabriel carabat   a healthy approach for test automationGabriel carabat   a healthy approach for test automation
Gabriel carabat a healthy approach for test automationRomania Testing
 
Continuous Security Testing with Devops - OWASP EU 2014
Continuous Security Testing  with Devops - OWASP EU 2014Continuous Security Testing  with Devops - OWASP EU 2014
Continuous Security Testing with Devops - OWASP EU 2014Stephen de Vries
 

Ähnlich wie Developers Testing - Girl Code at bloomon (20)

Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
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)
 
QA Meetup at Signavio (Berlin, 06.06.19)
QA Meetup at Signavio (Berlin, 06.06.19)QA Meetup at Signavio (Berlin, 06.06.19)
QA Meetup at Signavio (Berlin, 06.06.19)
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
StarWest 2019 - End to end testing: Stupid or Legit?
StarWest 2019 - End to end testing: Stupid or Legit?StarWest 2019 - End to end testing: Stupid or Legit?
StarWest 2019 - End to end testing: Stupid or Legit?
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.
 
DevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsDevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and Projects
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)
 
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
 
NET Code Testing
NET Code TestingNET Code Testing
NET Code Testing
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018Deploying ML models to production (frequently and safely) - PYCON 2018
Deploying ML models to production (frequently and safely) - PYCON 2018
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Gabriel carabat a healthy approach for test automation
Gabriel carabat   a healthy approach for test automationGabriel carabat   a healthy approach for test automation
Gabriel carabat a healthy approach for test automation
 
Continuous Security Testing with Devops - OWASP EU 2014
Continuous Security Testing  with Devops - OWASP EU 2014Continuous Security Testing  with Devops - OWASP EU 2014
Continuous Security Testing with Devops - OWASP EU 2014
 

Mehr von Ineke Scheffers

Coding Accessibility - Girl Code at Incentro
Coding Accessibility - Girl Code at IncentroCoding Accessibility - Girl Code at Incentro
Coding Accessibility - Girl Code at IncentroIneke Scheffers
 
Back to the future - Girl Code talks AI @ ING
Back to the future - Girl Code talks AI @ INGBack to the future - Girl Code talks AI @ ING
Back to the future - Girl Code talks AI @ INGIneke Scheffers
 
All about Front End - Girl Code @ ANWB
All about Front End - Girl Code @ ANWBAll about Front End - Girl Code @ ANWB
All about Front End - Girl Code @ ANWBIneke Scheffers
 
Building Rock-Paper-Scissors: Girl Code meets Ruby at Codaisseur
Building Rock-Paper-Scissors: Girl Code meets Ruby at CodaisseurBuilding Rock-Paper-Scissors: Girl Code meets Ruby at Codaisseur
Building Rock-Paper-Scissors: Girl Code meets Ruby at CodaisseurIneke Scheffers
 
Challenges of a Girl Coder
Challenges of a Girl CoderChallenges of a Girl Coder
Challenges of a Girl CoderIneke Scheffers
 
How neural networks can make a drone your next best friend, by Tessie Hartjes...
How neural networks can make a drone your next best friend, by Tessie Hartjes...How neural networks can make a drone your next best friend, by Tessie Hartjes...
How neural networks can make a drone your next best friend, by Tessie Hartjes...Ineke Scheffers
 
Girl Code, Q42 at Nerds on Stage
Girl Code, Q42 at Nerds on StageGirl Code, Q42 at Nerds on Stage
Girl Code, Q42 at Nerds on StageIneke Scheffers
 

Mehr von Ineke Scheffers (8)

Coding Accessibility - Girl Code at Incentro
Coding Accessibility - Girl Code at IncentroCoding Accessibility - Girl Code at Incentro
Coding Accessibility - Girl Code at Incentro
 
Back to the future - Girl Code talks AI @ ING
Back to the future - Girl Code talks AI @ INGBack to the future - Girl Code talks AI @ ING
Back to the future - Girl Code talks AI @ ING
 
All about Front End - Girl Code @ ANWB
All about Front End - Girl Code @ ANWBAll about Front End - Girl Code @ ANWB
All about Front End - Girl Code @ ANWB
 
Building Rock-Paper-Scissors: Girl Code meets Ruby at Codaisseur
Building Rock-Paper-Scissors: Girl Code meets Ruby at CodaisseurBuilding Rock-Paper-Scissors: Girl Code meets Ruby at Codaisseur
Building Rock-Paper-Scissors: Girl Code meets Ruby at Codaisseur
 
Challenges of a Girl Coder
Challenges of a Girl CoderChallenges of a Girl Coder
Challenges of a Girl Coder
 
How neural networks can make a drone your next best friend, by Tessie Hartjes...
How neural networks can make a drone your next best friend, by Tessie Hartjes...How neural networks can make a drone your next best friend, by Tessie Hartjes...
How neural networks can make a drone your next best friend, by Tessie Hartjes...
 
Girl code meets IOT
Girl code meets IOTGirl code meets IOT
Girl code meets IOT
 
Girl Code, Q42 at Nerds on Stage
Girl Code, Q42 at Nerds on StageGirl Code, Q42 at Nerds on Stage
Girl Code, Q42 at Nerds on Stage
 

Kürzlich hochgeladen

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
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
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
%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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 

Kürzlich hochgeladen (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
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
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

Developers Testing - Girl Code at bloomon

  • 2. @GirlCodeNL /GirlCodeNL We are Girl Code katja ineke @afkatja @FYIneke
  • 4. @GirlCodeNL /GirlCodeNL UI Testing & Libraries @ bloomon by Mariyana Nikolaeva -- Break -- Unit testing using Mocha by Marie Treschow Questions and discussion Drinks Program
  • 5. 1strictly confidential - • tekst • tekst • tekst Agenda UI testing and component libraries bloomon & girl code 2018
  • 6. 2strictly confidential - • bloomon - stack and applications • problem - many variations of the same component across apps • solutions - storybook vs component library (e.g. material UI) • summary - why consistency is important In today’s talk:
  • 11. 7strictly confidential - possible solutions bloomon UI
  • 15. 11strictly confidential - • fork material ui repository • add bloomon components to as submodule • include material-ui as dependency in package.json • make imports from material-ui bloomon components Approach
  • 17. 13strictly confidential - storybook • quick to include in apps • no build script required • easy component preview • no centralized components • storybook addons not mature enough Pros and Cons component library • one repo for components • easy to import in apps • unified documentation • overhead of build and run tools • maintain repository or CDN • complex task
  • 18. 14strictly confidential - • visual vocabulary between designers, UX and developers • faster designs and implementation • unified UIs and brand trust • users learn how to use the UI faster • less style micro decision to be made by developers • single source of truth without code repetition Why consistency is important
  • 20. 16strictly confidential - Do not fork big repositories
  • 21. 17strictly confidential - Small, easy steps • styles repository • storybooks for components per app • storybook repository (as submodules, npm package) • UI tests - structural, interaction, style testing • component library with unit, integration and visual regression tests • well documented and hosted styleguide website
  • 23. Unit testing with Mocha npm install mocha -g Marie Treschow
  • 24. Tonight’s Agenda ➔ Why testing? ➔ Testing levels ➔ Impact of good testing ➔ Unit Testing ➔ TDD vs BDD ➔ Mocha Framework ➔ Chai Assertion Library ➔ Sinon.js
  • 25. Why Unit Testing? “Adding value, not just bugs” - Improve software quality - Find bugs early - Makes process agile - Provides documentation - Simplify debugging process - Architecture - Reduces cost
  • 26. Different levels of software testing Regression testing => previously developed software still performs Acceptance testing => testing with respect to users needs System testing => testing integrated system Integration testing => individual units are combined Unit testing => testing individual components
  • 27. Business value of testing ★ Reliability ★ Customer satisfaction ★ Profitability ★ Shorter time to market
  • 28. UNIT TESTING … where it all begins What it is? ● Lowest level of software testing ● Individual units and components are tested ● Validate that each unit of code performs as designed What it does? ➔ increase confidence in changing/maintaining code ➔ makes your code more reusable ➔ makes debugging easier ➔ code more reliable
  • 29. What’s a good unit test? 1. Fast 2. Small 3. Simple 4. Plentiful 5. Isolated 6. Readable 7. Clean What not to do...
  • 31. Testing your JavaScript with Mocha, Chai and Sinon
  • 32. Setting up Mocha|Chai|Sinon npm install mocha -g (OR) --save-dev update your package.json and customize your scripts in order to run mocha on your terms, then simply run npm test npm install chai --save-dev npm install sinon --save-dev
  • 33. Why Mocha? ★ Well maintained ★ Well documented ★ Optional assertion library ★ Supports TDD & BDD ★ Simplifies async testing Let’s look at the features!
  • 34. The power of Mocha Features & Options: ● Browser support ● Async support, including promises ● Test coverage reporting ● Hooks ● Test-specific timeouts ● Report test duration ● Highlights slow tests in red and yellow Useful flags: - File watcher support - Babel-hook - Node debugger support - Timeout Psst.. check out: https://mochajs.org/
  • 36. Asynchronous testing with Mocha Terminal output
  • 37. TDD (test driven) vs. BDD (behavior driven) 1. Write the test 2. Run the test and see it fail 3. Write the code 4. Run the test again (not failing anymore) 5. Refactor - More focused on the features, not results - Important: the ability to read your tests like a sentence is a cognitive shift in how you will think about it Let’s imagine this function: function factorial(n){ if(n < 0) return NaN; if(n === 0) return 1; return n * factorial(n-1); }
  • 38. TDD style exampleBDD style example
  • 40. HOOKS before(); runs before any tests in each describe() block after(); runs after all tests in each describe() block beforeEach(); runs before every test in a describe block afterEach(); runs after every test in a describe block Good for: setting up preconditions and clean up after your tests (database fixture, servers etc) Pieces of code run either before or after certain tests
  • 42. Chai - should, expect, assert ● Pair with any JavaScript testing framework ● Several interfaces that allow you to choose between whatever is comfortable Should (BDD) Expect (BDD) Assert (TDD) expect('test').to.be.a('string'); [1,2,3].indexOf(4).should.equal(-1); assert.strictEqual(true, true, ‘booleans are strictly equal’);
  • 43. Assertion Methods ● equal ● strictEqual (===) ● deepEqual ● isNull ● include ● property assert.deepEqual({ tea: 'green' }, { tea: 'green' }); assert.isNull(error, 'there was no error'); assert.include([1,2,3], 2, 'array contains value 2'); assert.property({ tea: { green: 'matcha' }}, 'property tea');
  • 44. And some negative ones ● notEqual ● isNotOk ● notDeepEqual ● isNotNull ● notStrictEqual assert.notEqual(3, 4, 'these numbers are not equal'); assert.isNotOk(false, 'this will pass'); assert.notDeepEqual({ tea: 'green'}, { tea: 'red'});
  • 45. Sinon - spies, stubs, mocks Things that makes testing hard: ➢ Databases ➢ Network ➢ File access Spies/Stubs/Mocks: Test Doubles ➢ Replacements for pieces of code used in your test
  • 46. Different kinds of Test Doubles: ● Spies -> offer information about function calls without affecting their behavior ● Stubs -> are like spies, but completely replace the function (make it do whatever you like!) ● Mocks -> makes replacing whole objects easy by combining both spies and stubs (fake servers, timers, xmlhttprequest) http://sinonjs.org/
  • 47. Testing TIPS: ➔ Keep your modules small ➔ Be sure to test success AND error cases ➔ Test expected AND unexpected data Thanks for listening!