Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017Ortus Solutions, Corp
Testbox is a tool we all should be using to test our ColdFusion Applications which was created and is maintained by Ortus Solutions, the people that brought you ColdBox. We will have Gavin from Ortus in house on this day to go over some testbox examples, talk about its importance, and answer any questions you have.
SO --- if you have and high level questions for Gavin, reply to this post (or hit me up) so I can get the questions to Gavin a head of time just in case he needs to consult others at Ortus.
Gavin Pickin is a proud ColdFusion developer, starting with ColdFusion in the late 90s. Now working with Ortus Solutions, a leading force in CFML Development frameworks and tools, Gavin gets to work on a lot of great projects, for a big variety of clients. At Ortus Solutions, a big focus is on free and open source tools, on open source Fridays, Gavin spend most of his open source time working on ContentBox Content Management System.
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEGavin Pickin
We’ve all had those projects, the salvage project, the legacy project that we picked up, and wished we never had.
Was it written 5 years ago by that young dev with lots of passion but no big picture vision.
Was it written 6 months ago by another team, by a top gun developer who knows all the design patterns, and tried to future proof the app, only succeeding in making it impossible for anyone else to understand.
Or was it you, 2 years ago, before you joined the community and learned more about best (better) practices and you almost cannot comprehend how you used to code.
Long story short, we have all been there, but the past is history, how do we proceed from here, that’s the key. We’ll look at some of the ways you can clean up your code, and walk through some examples, and walk the journey to software craftsmanship
5 main points
What is clean code
Reading vs Writing Code
Don’t suffocate your code, let it breathe
Simple & Self Documenting Code
Lower the Cognitive Load
CommandBox is the ColdFusion (CFML) CLI and package manager for modern applications. In this session, we will show you how to create, find and even publish packages to our centralized cloud repository, ForgeBox.
Main Points
What is CommandBox + ForgeBox?
How to create packages
Understanding packages and dependencies
How to find packages
Publishing to ForgeBox
In this advanced session, we will investigate all the ways that you can automate your testing processes with TestBox and many CI and automation tools. From Jenkins integration, Travis CI, Node runners, Grunt watchers and much more. This session will show you the value of continuous integration and how to apply it with modern tools and technologies.
Main Points
Why we want to automate
Continuous Integration
ANT/CommandBox Test Runner
Setup of a Jenkins CI server
Travis CI integration
Pipelines CI integration
Node TestBox Runners
Grunt Watchers and Browser Live Reloads
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016Gavin Pickin
Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
That's great, but how do we test it? In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet).
So how do I write unit tests, what units are there, and how do I make my code look like that? JavaScript is a flexible language, and with great flexibility comes great complexity and responsibility. Take your JavaScript spaghetti and make it unit testable.
Attendees should have some exposure to JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.
How do I Write Testable Javascript so I can Test my CF API on Server and ClientColdFusionConference
The document provides an overview of testing APIs and web applications using various testing tools and frameworks like Jasmine and Testbox. It discusses different types of tests like unit tests, integration tests, end-to-end tests etc. and how to structure code to make it more testable. It also demonstrates how to set up testing environments using standalone Jasmine, Jasmine with Node.js, Grunt and Testbox and write tests with examples. The document emphasizes the importance of testing and provides tips to improve testing workflow.
Cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017Ortus Solutions, Corp
Testbox is a tool we all should be using to test our ColdFusion Applications which was created and is maintained by Ortus Solutions, the people that brought you ColdBox. We will have Gavin from Ortus in house on this day to go over some testbox examples, talk about its importance, and answer any questions you have.
SO --- if you have and high level questions for Gavin, reply to this post (or hit me up) so I can get the questions to Gavin a head of time just in case he needs to consult others at Ortus.
Gavin Pickin is a proud ColdFusion developer, starting with ColdFusion in the late 90s. Now working with Ortus Solutions, a leading force in CFML Development frameworks and tools, Gavin gets to work on a lot of great projects, for a big variety of clients. At Ortus Solutions, a big focus is on free and open source tools, on open source Fridays, Gavin spend most of his open source time working on ContentBox Content Management System.
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEGavin Pickin
We’ve all had those projects, the salvage project, the legacy project that we picked up, and wished we never had.
Was it written 5 years ago by that young dev with lots of passion but no big picture vision.
Was it written 6 months ago by another team, by a top gun developer who knows all the design patterns, and tried to future proof the app, only succeeding in making it impossible for anyone else to understand.
Or was it you, 2 years ago, before you joined the community and learned more about best (better) practices and you almost cannot comprehend how you used to code.
Long story short, we have all been there, but the past is history, how do we proceed from here, that’s the key. We’ll look at some of the ways you can clean up your code, and walk through some examples, and walk the journey to software craftsmanship
5 main points
What is clean code
Reading vs Writing Code
Don’t suffocate your code, let it breathe
Simple & Self Documenting Code
Lower the Cognitive Load
CommandBox is the ColdFusion (CFML) CLI and package manager for modern applications. In this session, we will show you how to create, find and even publish packages to our centralized cloud repository, ForgeBox.
Main Points
What is CommandBox + ForgeBox?
How to create packages
Understanding packages and dependencies
How to find packages
Publishing to ForgeBox
In this advanced session, we will investigate all the ways that you can automate your testing processes with TestBox and many CI and automation tools. From Jenkins integration, Travis CI, Node runners, Grunt watchers and much more. This session will show you the value of continuous integration and how to apply it with modern tools and technologies.
Main Points
Why we want to automate
Continuous Integration
ANT/CommandBox Test Runner
Setup of a Jenkins CI server
Travis CI integration
Pipelines CI integration
Node TestBox Runners
Grunt Watchers and Browser Live Reloads
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016Gavin Pickin
Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
That's great, but how do we test it? In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet).
So how do I write unit tests, what units are there, and how do I make my code look like that? JavaScript is a flexible language, and with great flexibility comes great complexity and responsibility. Take your JavaScript spaghetti and make it unit testable.
Attendees should have some exposure to JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.
How do I Write Testable Javascript so I can Test my CF API on Server and ClientColdFusionConference
The document provides an overview of testing APIs and web applications using various testing tools and frameworks like Jasmine and Testbox. It discusses different types of tests like unit tests, integration tests, end-to-end tests etc. and how to structure code to make it more testable. It also demonstrates how to set up testing environments using standalone Jasmine, Jasmine with Node.js, Grunt and Testbox and write tests with examples. The document emphasizes the importance of testing and provides tips to improve testing workflow.
Cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
The document discusses Behavior Driven Development (BDD) using Cucumber, Selenium, and PhantomJS. Cucumber uses a natural language syntax called Gherkin to write automated acceptance tests. Selenium is used to automate interactions with a web browser, while PhantomJS allows running those tests headlessly on a CI server without requiring a graphical browser. The example project demonstrates how Cucumber features written by PMs/BAs can be linked to Selenium step definitions to test a web application.
If you are like most CFML developers the application you work on has been around for a few years. The task of securing your legacy application code from vulnerabilities can be an overwhelming and time consuming task. Many developers don't know where to start, and never do.
This session will arm you with an approach slaying the legacy security vulnerabilities in your CFML code.
This document discusses automated testing with Codeception. It introduces test-driven development (TDD) and its benefits. Codeception allows running different types of tests (acceptance, functional, unit) from one place. Installing and using Codeception for testing Drupal is described, including generating tests, running tests, using Selenium WebDriver, cleaning up databases, and reusing test code with step objects and page objects.
This document discusses Capybara testing. It begins by explaining what Capybara is and why it is used for feature testing in Ruby on Rails applications. It then acknowledges common complaints about Capybara tests being slow, breakable, and hard to debug. The document provides tips on running JavaScript tests, using database cleaner, targeting elements wisely, and debugging Capybara tests. It also provides an example of testing a PayPal sandbox integration.
Can you contain the future - Docker, Container Technologies, The Future, and YouColdFusionConference
Linux containers and Docker have been all the rage in sysOps for quite some time now. Come to this session to learn about how you can or if you should be using them, and to learn about container technologies, how thy differ from VMs and if they truly are the future. Take a look at Docker basics and get an understanding of how it can be used as part of your workflow, not just for development, but for production deployments as well. We will also bust some Myths surrounding container technologies and Docker.
This document provides an agenda for a ColdFusion security training session presented by Pete Freitag and David Epler. It includes introductions to the presenters and their backgrounds in ColdFusion and security. The agenda covers common ColdFusion vulnerabilities like file uploads, SQL injection, path traversals, and cross-site scripting. It also demonstrates the OWASP ZAP security tool and provides a sneak peek at a new ColdFusion security analyzer called Raijin/Blizzard. Hands-on lessons are included to allow participants to try exploiting vulnerabilities.
Codeception is a PHP testing framework that allows developers to write different types of tests like unit tests, integration tests, and UI tests. It has good support for PHP frameworks and can be installed via composer. Tests should be written before code to ensure functionality and catch errors, with the goal being that tests are easy to write. Codeception tests can then be run locally or on a CI server.
Microsoft has traditionally been a laggard in the JavaScript space, making such developers question whether their war cries were being heard aloud. Fortunately, the situation is rapidly improving since the release of Visual Studio Code. Code is a free, lightweight, cross-platform code editor which is sure to change your perception of Microsoft.
This presentation will demonstrate how to utilize popular JavaScript tooling within the editor. The focus will be placed on the first-class support for debuggers, linters, transpilers, and task runners.
Testing with Codeception (Webelement #30)Adam Štipák
This document introduces Codeception, an open source PHP testing framework that aims to simplify the setup and writing of tests. It summarizes Codeception's main features like support for unit, functional, acceptance and API testing out of the box. It also highlights how Codeception provides modules for common testing needs like database, Selenium and REST testing. The document provides code examples of configuring and writing tests using Codeception and its modules.
One commit, one release. Continuously delivering a Symfony project.Javier López
For the last few months we've been implementing a Continuous Delivery pipeline for the redesign of Time Out. In this talk I will demonstrate a real life example of what our pipeline looks like, the different tools we've used to get it done (phing, github, jenkins, ansible, AWS S3, ...), and peculiarities for PHP and Symfony2 projects. Most importantly, I'll be looking at things we've struggled with along the way and the lessons we've learnt.
Continous Delivering a PHP applicationJavier López
The document discusses continuous delivery and building a continuous delivery pipeline. It begins with an overview of continuous delivery, describing the basic steps of commit, build, test, and deploy. It then covers the tools used to build the pipeline, including GitHub and Jenkins plugins. The document outlines the process for building the pipeline, including checking out code, installing dependencies, running tests, generating assets, and deploying artifacts. It also discusses splitting the process into separate jobs for testing deployment scripts and running automated tests. Finally, it covers benefits of continuous delivery such as increased release frequency, reduced risk, and releases becoming a non-event.
Continuous Integration (CI) is a software development practice where developers regularly merge their work into a central repository. This allows for automated builds and tests which catch errors early. CI helps reduce integration problems, improves code quality, and allows for more frequent deployments. The document discusses implementing CI with tools like Jenkins, build scripts, unit testing, code analysis, and notifications to improve the development process.
The document discusses continuous feature development. It defines a feature as a set of expected functional behaviors from a client. Continuous feature development involves incrementally building these expected behaviors. This approach is needed because clients' expectations, business needs, user perceptions, and competitive advantages are continually changing. Managing continuous feature development presents challenges like integrating new features, maintaining stability, seamless integration, and managing trust. The document recommends practices like acceptance test-driven development, test-driven development, behavior-driven development, continuous integration, coding in feature branches, code reviews, maintaining a production branch, using staging servers, and continuous integration to help address these challenges.
The document discusses various ColdFusion features for more modern coding, covering:
1. CFML history and top features introduced over different ColdFusion versions from CF1 to CF11.
2. CFScript support, including syntax examples for tags without bodies, tags with bodies, loops, if/else statements in both tag and script formats.
3. The queryExecute function, member functions, Elvis operator, closures, map and reduce functions, and first class functions/callbacks in ColdFusion.
This document introduces CommandBox, a ColdFusion command line interface (CLI) tool that provides features like a package manager, REPL environment, integrated server, and automation capabilities. It allows developers to install packages, run CFML code interactively, start ad-hoc servers, and automate tasks. CommandBox integrates with services like ForgeBox to provide a central repository of CFML packages that can be installed and managed.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
This document discusses building automated acceptance tests that are stable and maintainable for continuous delivery. It emphasizes that developers should own acceptance testing by writing tests in the same way they write production code. This includes writing many unit and regression tests, optimizing for test execution, using immutable environments like Docker for isolation, and leveraging techniques like parallelization and separation of concerns with domain-specific languages. The document also provides examples of testing strategies, tools, and processes that can help achieve this goal.
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
Description
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
## Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
How do I write Testable Javascript so I can Test my CF API on Server and ClientGavin Pickin
The document discusses various topics related to testing APIs and web applications including:
- Different types of tests like unit tests, integration tests, and end-to-end tests
- Popular testing frameworks like Jasmine, Mocha, and TestBox
- Using testing frameworks like Jasmine with Node.js, Grunt, and in the browser
- Examples of writing tests with Jasmine and TestBox for ColdFusion applications and APIs
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
The document discusses Behavior Driven Development (BDD) using Cucumber, Selenium, and PhantomJS. Cucumber uses a natural language syntax called Gherkin to write automated acceptance tests. Selenium is used to automate interactions with a web browser, while PhantomJS allows running those tests headlessly on a CI server without requiring a graphical browser. The example project demonstrates how Cucumber features written by PMs/BAs can be linked to Selenium step definitions to test a web application.
If you are like most CFML developers the application you work on has been around for a few years. The task of securing your legacy application code from vulnerabilities can be an overwhelming and time consuming task. Many developers don't know where to start, and never do.
This session will arm you with an approach slaying the legacy security vulnerabilities in your CFML code.
This document discusses automated testing with Codeception. It introduces test-driven development (TDD) and its benefits. Codeception allows running different types of tests (acceptance, functional, unit) from one place. Installing and using Codeception for testing Drupal is described, including generating tests, running tests, using Selenium WebDriver, cleaning up databases, and reusing test code with step objects and page objects.
This document discusses Capybara testing. It begins by explaining what Capybara is and why it is used for feature testing in Ruby on Rails applications. It then acknowledges common complaints about Capybara tests being slow, breakable, and hard to debug. The document provides tips on running JavaScript tests, using database cleaner, targeting elements wisely, and debugging Capybara tests. It also provides an example of testing a PayPal sandbox integration.
Can you contain the future - Docker, Container Technologies, The Future, and YouColdFusionConference
Linux containers and Docker have been all the rage in sysOps for quite some time now. Come to this session to learn about how you can or if you should be using them, and to learn about container technologies, how thy differ from VMs and if they truly are the future. Take a look at Docker basics and get an understanding of how it can be used as part of your workflow, not just for development, but for production deployments as well. We will also bust some Myths surrounding container technologies and Docker.
This document provides an agenda for a ColdFusion security training session presented by Pete Freitag and David Epler. It includes introductions to the presenters and their backgrounds in ColdFusion and security. The agenda covers common ColdFusion vulnerabilities like file uploads, SQL injection, path traversals, and cross-site scripting. It also demonstrates the OWASP ZAP security tool and provides a sneak peek at a new ColdFusion security analyzer called Raijin/Blizzard. Hands-on lessons are included to allow participants to try exploiting vulnerabilities.
Codeception is a PHP testing framework that allows developers to write different types of tests like unit tests, integration tests, and UI tests. It has good support for PHP frameworks and can be installed via composer. Tests should be written before code to ensure functionality and catch errors, with the goal being that tests are easy to write. Codeception tests can then be run locally or on a CI server.
Microsoft has traditionally been a laggard in the JavaScript space, making such developers question whether their war cries were being heard aloud. Fortunately, the situation is rapidly improving since the release of Visual Studio Code. Code is a free, lightweight, cross-platform code editor which is sure to change your perception of Microsoft.
This presentation will demonstrate how to utilize popular JavaScript tooling within the editor. The focus will be placed on the first-class support for debuggers, linters, transpilers, and task runners.
Testing with Codeception (Webelement #30)Adam Štipák
This document introduces Codeception, an open source PHP testing framework that aims to simplify the setup and writing of tests. It summarizes Codeception's main features like support for unit, functional, acceptance and API testing out of the box. It also highlights how Codeception provides modules for common testing needs like database, Selenium and REST testing. The document provides code examples of configuring and writing tests using Codeception and its modules.
One commit, one release. Continuously delivering a Symfony project.Javier López
For the last few months we've been implementing a Continuous Delivery pipeline for the redesign of Time Out. In this talk I will demonstrate a real life example of what our pipeline looks like, the different tools we've used to get it done (phing, github, jenkins, ansible, AWS S3, ...), and peculiarities for PHP and Symfony2 projects. Most importantly, I'll be looking at things we've struggled with along the way and the lessons we've learnt.
Continous Delivering a PHP applicationJavier López
The document discusses continuous delivery and building a continuous delivery pipeline. It begins with an overview of continuous delivery, describing the basic steps of commit, build, test, and deploy. It then covers the tools used to build the pipeline, including GitHub and Jenkins plugins. The document outlines the process for building the pipeline, including checking out code, installing dependencies, running tests, generating assets, and deploying artifacts. It also discusses splitting the process into separate jobs for testing deployment scripts and running automated tests. Finally, it covers benefits of continuous delivery such as increased release frequency, reduced risk, and releases becoming a non-event.
Continuous Integration (CI) is a software development practice where developers regularly merge their work into a central repository. This allows for automated builds and tests which catch errors early. CI helps reduce integration problems, improves code quality, and allows for more frequent deployments. The document discusses implementing CI with tools like Jenkins, build scripts, unit testing, code analysis, and notifications to improve the development process.
The document discusses continuous feature development. It defines a feature as a set of expected functional behaviors from a client. Continuous feature development involves incrementally building these expected behaviors. This approach is needed because clients' expectations, business needs, user perceptions, and competitive advantages are continually changing. Managing continuous feature development presents challenges like integrating new features, maintaining stability, seamless integration, and managing trust. The document recommends practices like acceptance test-driven development, test-driven development, behavior-driven development, continuous integration, coding in feature branches, code reviews, maintaining a production branch, using staging servers, and continuous integration to help address these challenges.
The document discusses various ColdFusion features for more modern coding, covering:
1. CFML history and top features introduced over different ColdFusion versions from CF1 to CF11.
2. CFScript support, including syntax examples for tags without bodies, tags with bodies, loops, if/else statements in both tag and script formats.
3. The queryExecute function, member functions, Elvis operator, closures, map and reduce functions, and first class functions/callbacks in ColdFusion.
This document introduces CommandBox, a ColdFusion command line interface (CLI) tool that provides features like a package manager, REPL environment, integrated server, and automation capabilities. It allows developers to install packages, run CFML code interactively, start ad-hoc servers, and automate tasks. CommandBox integrates with services like ForgeBox to provide a central repository of CFML packages that can be installed and managed.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
This document discusses building automated acceptance tests that are stable and maintainable for continuous delivery. It emphasizes that developers should own acceptance testing by writing tests in the same way they write production code. This includes writing many unit and regression tests, optimizing for test execution, using immutable environments like Docker for isolation, and leveraging techniques like parallelization and separation of concerns with domain-specific languages. The document also provides examples of testing strategies, tools, and processes that can help achieve this goal.
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
Description
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
## Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
How do I write Testable Javascript so I can Test my CF API on Server and ClientGavin Pickin
The document discusses various topics related to testing APIs and web applications including:
- Different types of tests like unit tests, integration tests, and end-to-end tests
- Popular testing frameworks like Jasmine, Mocha, and TestBox
- Using testing frameworks like Jasmine with Node.js, Grunt, and in the browser
- Examples of writing tests with Jasmine and TestBox for ColdFusion applications and APIs
Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
That's great, but how do we test it? In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet).
So how do I write unit tests, what units are there, and how do I make my code look like that? JavaScript is a flexible language, and with great flexibility comes great complexity and responsibility. Take your JavaScript spaghetti and make it unit testable.
Attendees should have some exposure to JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.
BDD Testing and Automating from the trenches - Presented at Into The Box June...Gavin Pickin
In this session, we'll learn what TDD and BDD testing is in CFML and ColdFusion, using Testbox. We'll look at some of the myths surrounding testing, and how to get started with testing, and how it can make you more efficient, improve code quality, code confidence, and how automation can make your life as a developer more pleasant than what you face currently, living in the trenches
This session will build up on the ColdBox RESTful services session by creating a TestBox test suite for the RESTful service. We will review everything from installing TestBox, creating BDD specs, running them in different formats and finally automate it via Jenkins for continuous integration.
The document discusses testing strategies for migrating from Drupal 7 to Drupal 8. It introduces various testing tools that are well-suited for Drupal 8 like PHPUnit, Behat, and PhantomJS. It emphasizes the importance of acceptance testing and behavior driven development to test business value. The document also recommends writing modular object-oriented code, using autoloaders and Composer to more easily migrate code and testing between versions.
- Testing JavaScript code helps ensure quality and allows for refactoring and code handovers. Unit, integration, and functional testing methodologies were discussed.
- Siesta was introduced as a JavaScript testing tool that supports unit and functional testing for Ext JS and Sencha Touch. It allows simulating user interactions and verifying results.
- Writing testable code through separation of concerns, avoiding direct DOM manipulation, and supporting dependency injection were recommended to facilitate automated testing. Continuous integration was also recommended for running tests regularly.
Quick tour to front end unit testing using jasmineGil Fink
This document discusses front-end unit testing using the Jasmine testing framework. It explains why unit testing is important, introduces behavior-driven development and the Jasmine framework. It also provides an overview of setting up Jasmine, creating test suites and specs, using matchers, and testing asynchronous code. The document demonstrates how to set up the testing environment, write tests with Jasmine, and integrate Jasmine with the Karma test runner.
This document discusses the importance of unit testing JavaScript code. It provides reasons for testing JavaScript, such as avoiding bugs when refactoring code or introducing errors. The document discusses how to write testable JavaScript by separating business logic from views. It also recommends choosing JavaScript unit testing tools like Jasmine and Siesta, and integrating tests into continuous integration processes to run automatically on commits. Functional testing tools like Selenium are also mentioned for testing user interactions across browsers.
This document provides an overview of testing with Behat, a behavior-driven development framework for PHP. It discusses how Behat allows writing tests focused on describing features and behaviors using a domain-specific language. Key points include how Behat scenarios map to executable acceptance criteria, how contexts are used to define step implementations, and how Behat can be integrated with browser automation tools like Mink and Selenium to test web applications. The document also provides examples of running Behat tests against external APIs and refactoring code based on test results.
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
The document introduces JavaScript testing and test-driven development (TDD). It discusses why software projects fail, challenges of testing JavaScript code, and how to use the Mocha and ChaiJS frameworks for TDD and behavior-driven development (BDD). It provides an example of writing unit tests for a user service function using TDD principles, implementing the code to pass the tests, and running the tests with Mocha. Benefits of testing code include short feedback cycles, high test coverage, documentation of specifications, and less time spent debugging.
This document discusses test-driven development with JavaFX. It covers testing JavaFX applications at the unit, integration, and system levels. It also discusses continuous integration/continuous delivery and different tools that can be used for testing JavaFX applications, including TestFX, MarvinFX, JemmyFX, and Automaton. TestFX is highlighted as the recommended tool, with details provided on how to interact with JavaFX applications using its fluent API. The document also discusses using the view object pattern to write more readable tests and testing JavaFX applications that use DataFX or Afterburner.fx frameworks. It provides an example of using CDI to inject mocks when testing.
TDD is now mainstream but a lot people don't know or don't remember what is its purpose. TDD is about software design not testing or catching bug. TDD helps developers to shape and create software with "good" design, what is a "good" design is something that we will discuss in the topic.
A la découverte des google/test (aka gtest)Thierry Gayet
Google Test is a unit testing framework that was initially developed by Google and is now maintained by the open source community. It allows writing small unit tests in C++ and C that run quickly and in isolation. Some key features include being portable, having a rich set of assertions for verifying results, and making it easy to organize tests into test fixtures to reuse setup and teardown code across multiple tests. Writing thorough unit tests is important for code quality and the ability to safely refactor and add new features over time without introducing bugs.
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
The document discusses introducing unit testing to legacy C++ code. It covers choosing a testing framework, writing initial tests and mocks, and various refactoring techniques like wrapping dependencies, extracting components, and adding non-intrusive C seams to facilitate testing. The goal is to incrementally make the code more testable while maintaining functionality through practices like test-driven development.
This document summarizes a presentation about testing in Craft CMS. The presentation covers:
1) The types of tests including unit, functional, and acceptance tests and how they help projects.
2) How to set up and run Codeception tests in Craft including installing Codeception, setting up directories and files, and adding tests.
3) Tips for successful testing like using fixtures, offloading tests to a queue, and different types of tests like email, Twig, performance and accessibility testing.
This document provides an overview of Gatling, an open-source load testing tool developed using Scala. It discusses Gatling's focus on web applications, simplicity, high performance, good reports, and easy integration with CI tools. It then covers setting up Gatling, including prerequisites, writing a sample test, and key concepts like scenarios, simulations, and reports.
Test all the things! Automated testing with Drupal 8Sam Becker
With Drupal 8 released, one of the most important aspects of building a website or module has changed dramatically for the better. Developers now have a myriad of tools at their disposal to be able to test their code. If you are interested in improving your code and preventing bugs, but are unfamiliar with acronyms like BTB, KTB and WTB, this session is for you. If you’ve dabbled in testing but haven’t explored the depths of PHPUnit or Mink, then this session is for you.
Similar to 3 WAYS TO TEST YOUR COLDFUSION API - (20)
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
Feeling lost in the trenches of complex SQL queries and manual database interaction? Join us for a beginner-friendly mission to conquer your data with ColdFusion ORM powered by Hibernate! Whether you're a fresh recruit in the coding field or a seasoned veteran navigating legacy ColdFusion applications, this session equips you with the tools and strategies to level up your development game. We will cover ORM session management, ORM settings, caching strategies, virtual service layers, dynamic finders, dynamic counters, and an enhanced Hibernate Criteria builder for ColdFusion to create easy and programmatic HQL queries. We will even see how to build automatic CRUD APIs using only your ORM definitions. Ready to win?
Ortus Solutions is your web development expert. Planning, Design, Consulting, Mentorship, Implementation, Maintenance, and cutting-edge Software tools. All in one place.
Battlefield ORM : Learn the strategies and tactics to win with ColdFusion ORM powered by Hibernate!
We have gone through the pain and frustrations of maturing with technology such as an Object Relational Mapper (ORM) powered by Hibernate. This advanced session will cover how to leverage the ColdFusion ORM to start creating amazing, fun, and smell-great applications, and you might even see flying unicorns as well.
We will cover ORM session management, ORM settings, caching strategies, virtual service layers, dynamic finders, dynamic counters, and an enhanced Hibernate Criteria builder for ColdFusion to create easy and programmatic HQL queries. We will even see how to build automatic CRUD APIs using only your ORM definitions.
Ready to win?
You need to write a script you can call from cron to upload a directory of files to S3. Or perhaps zip log files and E-mail them? Or import a CSV into the DB. What do you use? Bash? Python? Node? No silly, you use CFML! ColdFusion developers have been able to write pure CLI scripts with CommandBox CLI for years now and it beats the pants of bash or Node. There's tools for creating interactive wizards, progress bar animations, colored console text output, and easy parameter handling. And the best thing is, CommandBox Task Runners are written in CFML so they can do anything CFML can do. Come learn how quick and easy Task Runners are to use so CFML can become the go-to language to use for anything.
Handling credentials, secrets and settings is a crucial aspect of any project. Developers must ensure that sensitive data is kept safe and secure from unauthorized access. However, ensuring safety shouldn't compromise local development convenience. Therefore, it's essential to adopt an approach that provides both security and ease of use.
“Transitioning from WordPress to ContentBox: A Powerful ColdFusion Alternative”
Are you a web developer tired of working with WordPress and its limitations? Look no further than ContentBox, a robust, open-source ColdFusion-based content management system built on the powerful ColdBox framework. While WordPress is popular due to its ease of use and extensive plugin ecosystem, it can sometimes fall short in terms of scalability and security. With ContentBox, you can enjoy the flexibility and stability of ColdFusion, a language we all know and love.
This session will introduce you to ContentBox CMS, what it is, what you can do with it, and why you should consider ContentBox for your next ColdFusion project. We will also compare it to WordPress and show why you would want to use ContentBox instead. Finally, we will discuss modern hosting options and how you can get up and running with a ContentBox site in the cloud using Digital Ocean.
This training class can be ran in GitHub codespaces with all the required software pre-installed. So just make sure you create a GitHub account, go to the repository: https://github.com/ColdBox/Building-Human-Friendly-Scheduled-Tasks and click on Start a Codesapace Button.
If not, you will need the latest CommandBox CLI installed: https://www.ortussolutions.com/products/commandbox
Come learn about of the flagship features of CommandBox Pro. CommandBox Multi-site allows you to completely replace your web server with CommandBox, hosting multiple websites all in a single process. Each site has its own web root, rewrites, logs, configuration, and HTTP bindings! This is a major new enhancement to CommandBox servers and finally bring CommandBox on par with other web servers and allows you to simplify your entire tech stack down to a single moving part for deployment.
This document provides an overview of OAuth and OpenID Connect specifications and grant types. It begins with introductions and defining key terms like tokens, scopes, and claims. It then explains the four main grant types - Authorization Code Flow, Implicit Flow, Resource Owner Password Flow, and Client Credentials Flow. The document notes extensions and recommends the Authorization Code Flow with PKCE for most use cases. It discusses related specifications around JSON Web Tokens, introspection, and revocation. It closes by emphasizing the need to understand which combination of specifications are required for a given implementation.
Some security vulnerabilities are more dangerous than others, or at least more commonly exploited. In this session, we'll look at the top 25 most dangerous software weaknesses and learn how to mitigate them in your CFML code.
Target Audience
Developers looking to learn when to use NoSQL databases over relational databases and who wonder how to model data for NoSQL
Assumed knowledge of the topic
Basic data modeling/database design principles
The objective of the topic
Learn data modeling with NoSQL databases, and how it differs from relational database data modeling., We will also look at good opportunities for using a NoSQL database and when a relational database is still the way to go. We will see why many NoSQL databases don’t pass the ACID (Atomicity, Consistency, Isolation, Durability) test on purpose and what this means to you, the developer.
In this session, you will learn how to extend and customize a ContentBox application. Get a deep understanding of leveraging custom modules and dynamic pages to create highly customized and engaging ContentBox apps.
Sometimes there are things that we need to customize to fill our business needs, and ContentBox allows you to create custom modules to take care of those special needs.
Some security vulnerabilities are more dangerous than others, or at least more commonly exploited. In this session we'll look at the top 25 most dangerous software weaknesses and learn how to mitigate them in your CFML code.
CBWIRE is a ColdBox module that makes building modern, reactive CFML apps a breeze without needing JavaScript frameworks such as Vue or React, and without the hassle of creating unnecessary APIs. In this session, we will learn CBWIRE, how to use it, and why you would want to. We also cover CBWIRE version 3, which brings a greatly simplified component syntax and many other requested features from the community.
Intended Audience
This session is intended for developers looking to build modern applications with less JavaScript. Attendees will need familiarity with ColdBox and CFML.
In this session, we will explore various practical applications the OpenAI API. We will begin with an introduction to the API and an overview of its capabilities. Then, we will examine several examples of how the API can be used, including natural language processing, chatbots, content creation, and translation. We will also take a look at cbopenai, a new ColdBox module for working with OpenAI. We will discuss how to get started with the API, including setting up an account, selecting the appropriate API, and integrating it into existing workflows. We will also explore the limitations and considerations when using OpenAI, and discuss potential advancements in practical AI.
Intended Audience
Participants should have a basic understanding of programming concepts and experience working with APIs.
A logistical look at microservice style applications created at scale from practical experience. Purpose is to present the strengths and purpose of microservice solutions to empower teams working with them or considering them for their projects. Technology will include JavaScript and Java solutions in examples. Hosting concerns will include self-hosted and cloud considerations. Some attention given to comparison to standard or monolith solutions, but not much. Q&A by design as part of this talk. Willing to refine the scope and focus to fit conference leadership preference.
Target Audience: developers, architects, managers, and teams working in or considering microservice architecture for their projects.
We all want our web apps and APIs to respond quickly and scale to dizzying heights of traffic. The traditional request/response cycle of web applications gets us part way to that goal, but it certainly won't get us to being the next Amazon. Asynchronous messaging is a powerful architectural pattern that will help us avoid fundamental problems with scaling while keeping our CFML apps fast and responsive. In this session, we'll look at how systems like Amazon's Simple Queue Service (SQS) and Simple Notification Service (SNS) - along with similar systems in Azure and Google Cloud Platform - can help you build highly responsive, highly scalable CFML apps and services.
Everyone has been hearing about Machine learning and AI for a while now, but recently, it exploded.
Like you, Ortus and the CFML Community have been playing with AI too, and one of the end results is ChatGPT Box.
AI is cool, and for some people scary, but a lot of people wonder if there is really any true value for us developers, or our businesses. In this session we’ll discuss what ChatGPT Box is, why we created it, what types of problems it solves, why we are using AI to solve those problems, and how we trained and tamed our own AI.
We will also touch on some of the science behind the scenes, to help you understand the moving parts, and how ChatGPT Box v1.0.0 is just a drop in the ocean of the possibilities, we’ll touch on some ideas we have, and in the end, using ChatGPT Box can make you a much more productive Ortusian Developer!
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
3 WAYS TO TEST YOUR COLDFUSION API -
1. 3 WAYS TO TEST YOUR
COLDFUSION API
Gavin Pickin
cf.Objective() 2017
2. Agenda
● Who Am I?
● State of the Room?
● CF API
● Ways to test your API?
● Overview of Testing Tools
● Using Testing in your Workflow
● Installing Jasmine
● Installing Testbox
● Live Demo
3. Who am I?
Gavin Pickin – developing Web Apps since late 90s
● Software Consultant for Ortus Solutions
● ContentBox Evangelist
What else do you need to know?
● Blog - http://www.gpickin.com
● Twitter – http://twitter.com/gpickin
● Github - https://github.com/gpickin
Let’s get on with the show.
4. State of the Room
● A few questions for you guys
● If you have arms, use them.
5. APIs in CFML
Most CF Apps are moving towards providing an API for multiple consumers
CF has many REST API Solutions and even more with CF 2016
● Built in CF
● Built in Railo/Lucee
● Coldbox API
● Taffy
6. Ways to Test your Code
● Click around in the browser yourself
● Setup Selenium / Web Driver to
click around for you
● Structured Programmatic Tests
7. Types of Testing
● Black/White Box
● Unit Testing
● Integration Testing
● Functional Tests
● System Tests
● End to End Tests
● Sanity Testing
● Regression Test
● Acceptance Tests
● Load Testing
● Stress Test
● Performance Tests
● Usability Tests
● + More
8.
9. Integration Testing
● Integration Tests several of the pieces together
● Most of the types of tests are variations of an Integration
Test
● Can include mocks but can full end to end tests including
DB / APIs
10. Unit Testing
“unit testing is a software verification and validation method in
which a programmer tests if individual units of source code
are fit for use. A unit is the smallest testable part of an
application”
- wikipedia
11. Unit Testing can...
● Can improve code quality -> quick error discovery
● Code confidence via immediate verification
● Can expose high coupling
● Will encourage refactoring to produce > testable code
● Remember: Testing is all about behavior and expectations
12. Styles – TDD vs BDD
● TDD = Test Driven Development
○ Write Tests
○ Run them and they Fail
○ Write Functions to Fulfill the Tests
○ Tests should pass
○ Refactor in confidence
Test focus on Functionality
13. Styles - TDD vs BDD
● BDD = Behavior Driven Development
Actually similar to TDD except:
● Focuses on Behavior and Specifications
● Specs (tests) are fluent and readable
● Readability makes them great for all levels of testing in the
organization
Hard to find TDD examples in JS that are not using BDD describe and it
blocks
14. TDD Example
Test( ‘Email address must not be blank’, function(){
notEqual(email, “”, "failed");
});
15. BDD Example
Describe( ‘Email Address’, function(){
It(‘should not be blank’, function(){
expect(email).not.toBe(“”);
});
});
20. CF Testing Tools
* MxUnit was the standard
* TestBox is the new standard
Other options
21. TestBox
TestBox is a next generation testing framework for ColdFusion
(CFML) that is based on BDD (Behavior Driven Development)
for providing a clean obvious syntax for writing tests.
It contains not only a testing framework, runner, assertions
and expectations library but also ships with MockBox, A
Mocking & Stubbing Framework,.
It also supports xUnit style of testing and MXUnit
compatibilities.
23. TestBox BDD Example
describe("Hello world function", function() {
it(”contains the word world", function() {
expect(helloWorld()).toContain("world");
});
});
24. TestBox New BDD Example
feature( "Box Size", function(){
describe( "In order to know what size box I need
As a distribution manager
I want to know the volume of the box", function(){
scenario( "Get box volume", function(){
given( "I have entered a width of 20
And a height of 30
And a depth of 40", function(){
when( "I run the calculation", function(){
then( "the result should be 24000", function(){
27. Jasmine
*Jasmine comes ready to go out of the box
*Fluent Syntax – BDD Style
*Includes lots of matchers
*Has spies included
*Very popular, lots of support
*Angular uses Jasmine with Karma (CLI)
*Headless running and plays well with CI servers
28. Jasmine - Cons
Async testing in 1.3 can be a headache
*Async testing in 2.0 is hard to find
blog posts on (I need to write one)
*Expects *spec.js suffix for test files
*This can be modified depending on
how you are running the tests
29. Jasmine – Sample Test
describe("Hello world function", function() {
it(”contains the word world", function() {
expect(helloWorld()).toContain("world");
});
});
30. Mocha
*Simple Setup
*Simple Async testing
*Works great with other Assertion libraries like Chai ( not
included )
*Solid Support with CI Servers, with Plugins for others
*Opinion says Mocha blazing the trail for new features
31. Mocha - Cons
*Requires other Libraries for key features
*No Assertion Library included
*No Mocking / Spied included
*Need to create the runner manually
*Newer to the game so not as popular or supported as
others but gaining traction.
32. Mocha – BDD Sample Test
var expect = require('chai').expect;
describe(’Hello World Function', function(){
it('should contain the word world', function(){
expect(helloWorld()).to.contain(’world');
})
})
33. QUnit
*The oldest of the main testing frameworks
*Is popular due to use in jQuery and age
*Ember’s default Unit testing Framework
34. QUnit - Cons
*Development slowed down since
2013 (but still under development)
*Syntax – No BDD style
*Assertion libraries – limited matchers
39. Refactoring Spaghetti
*Things to refactor to make your code testable
*Code should not be one big chunk of Javascript in
onReady()
*Deep nested callbacks & Anon functions cannot
easily be singled out and tested
*Remove Tight Coupling – DOM access for example
40. Refactoring Spaghetti
*Lets look at some code
*This isn’t BEST PRACTICE, its BETTER PRACTICE than
you were doing
*Its not really refactoring if you don’t have tests, its
“moving code and asking for trouble”
Kev McCabe
43. Using Testing in your Workflow
*Using HTML Test Runners
*Keep a Browser open
*F5 refresh tests
44. Command Line Tests
*Run Jasmine – manual
*Run tests at the end of each section of work
*Run Grunt-Watch – automatic
*Runs Jasmine on every file change
*Grunt can run other tasks as well,
minification etc
45. Testing in your IDE
*Browser Views
*Eclipse allows you to open files in web view
– uses HTML Runner
*Run Jasmine / Grunt / Karma in IDE Console
*Fairly Easy to setup
*See Demo– Sublime Text 2 (if we have time)
46. Live Demo and Examples
*Install / Run Jasmine Standalone for Browser
*Install / Run Jasmine with NodeJs
*Install / Run Jasmine with Grunt Watch
*Install / Run Testbox in Browser
47. Install / Run Jasmine for In-Browser Testing
Download standalone package from Github (I have 2.1.3)
https://github.com/jasmine/jasmine/tree/master/dist
Unzip into your /tests folder
Run /tests/SpecRunner.html to see example tests
53. Installing Jasmine with NodeJS
Edit Jasmine.json to update Locations for Spec Files and Helper Files
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
]
}
54. Running Jasmine Tests with NodeJS
$ Jasmine
Started
F
Failures:
1) A suite contains spec with an expectation
Message:
Expected true to be false.
Stack:
Error: Expected true to be false.
at Object.<anonymous>
(/Users/gavinpickin/Dropbox/Apps/testApp/www/spec/test_spec.js:3:1
8)
1 spec, 1 failure
55. Running Jasmine Tests with NodeJS
*Jasmine-Node is great for Node
*Jasmine Node doesn’t have a headless browser
*Hard to test Browser code
*So what should I use?
59. Configuring Jasmine with Grunt Watcher
// gruntfile.js part 3
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
};
60. Example Jasmine Spec with Grunt Watcher
describe("Forgotten Password Form", function() {
it("should warn you if the email is invalid before making Ajax Call",
function() {
expect( isEmailInputInvalid('') ).toBe(true);
expect( isEmailInputInvalid('dddddddddd') ).toBe(true);
expect( isEmailInputInvalid('dddddd@') ).toBe(true);
expect( isEmailInputInvalid('dddddd@ddddd') ).toBe(true);
expect( isEmailInputInvalid('dddddd@ddddddd.') ).toBe(true);
expect( isEmailInputInvalid('dddddd@ddddddd.com') ).toBe(false);
61. Example Jasmine Spec with Grunt Watcher
describe("Login Form", function() {
it("should set status correct status message with successful Ajax
Response", function() {
spyOn( window, "setStatusMessage");
processLoginAjaxDone('{"RESULT":"200"}');
expect(setStatusMessage).toHaveBeenCalled();
expect(setStatusMessage).toHaveBeenCalledWith(
‘TARDIS Access Granted - Please wait for the Doctor to take you for
a spin');
});
62. Example Jasmine Spec with Grunt Watcher
describe("Login API", function() {
it("should return a failing Ajax Response", function() {
spyOn( window, "processLoginAjaxDone");
loginButtonEventHandlerProcess( 'gavin@gavin.co.nz', 'password');
expect(processLoginAjaxDone).toHaveBeenCalled();
expect(processLoginAjaxDone).toHaveBeenCalledWith(
‘{"RESULT":400}');
expect(processLoginAjaxFail).not.toHaveBeenCalled();
64. Unit Tests and Async Calls
*You want Unit Tests to test the unit and not it’s
dependencies
*You want Unit Tests to run quick
*You should mock the API in the Ajax call
*But we want to test the API
*So essentially, we’re writing an integration test.
65. How to wait for Async
describe("Login API", function() {
beforeEach(function( done ) {
spyOn( window, "processLoginAjaxDone").and.callFake(
function(){ done(); });
spyOn( window, "processLoginAjaxFail").and.callFake(
function(){ done(); });
loginButtonEventHandlerProcess('gavin@gavin.co.nz', 'password');
});
it("should return a failing Ajax Response", function() { });
});
66. How to wait for Async
describe("Login API", function() {
beforeEach(function( done ) {
…
});
it("should return a failing Ajax Response", function() {
expect(processLoginAjaxDone).toHaveBeenCalled();
expect(processLoginAjaxDone).toHaveBeenCalledWith(
'{"RESULT":400}');
expect(processLoginAjaxFail).not.toHaveBeenCalled();
});
70. Create a runner.cfm
*<cfsetting showDebugOutput="false">
*<!--- Executes all tests in the 'specs' folder with simple reporter by
default --->
*<cfparam name="url.reporter" default="simple">
*<cfparam name="url.directory" default="tests.specs">
*<cfparam name="url.recurse" default="true"
type="boolean">
*<cfparam name="url.bundles" default="">
*<cfparam name="url.labels" default="">
71. Create a Test Suite
// tests/specs/CFCTest.cfc
component extends="testbox.system.BaseSpec" {
function run() {
it( "will error with incorrect login", function(){
var oTest = new cfcs.userServiceRemote();
expect( oTest.login( 'gavin@gavin.com',
'topsecret').result ).toBe('400');
});
}
72. Create a 2nd
Test Suite
// tests/specs/APITest.cfc
component extends="testbox.system.BaseSpec" {
function run() {
describe("userService API Login", function(){
it( "will error with incorrect login", function(){
var email = "gavin@gavin.com";
var password = "topsecret”;
var result = "";
http
url="http://www.testableapi.local.com:8504/cfcs/userServiceRemote.cfc?method=log
in&email=#email#&password=#password#" result="result”;
expect( DeserializeJSON(result.filecontent).result ).toBe('400');
});
});
82. Testbox Runner JSON
*Testbox has several runners, you have seen the HTML one, this
Runner uses the JSON runner and then formats it.
*http://www.testableapi.local.com:8504/tests/runner.cfm?rep
orter=JSON&directory=%2Ftests%2Fspecs&recurse=true
83. Running in Sublime Text 2
*Install PackageControl into Sublime Text
*Install Grunt from PackageControl
*https://packagecontrol.io/packages/Grunt
*Update Grunt Sublime Settings for paths
{
"exec_args": { "path": "/bin:/usr/bin:/usr/local/bin” }
}
*Then Command Shift P – grunt