This document discusses software testing techniques and strategies. It introduces testing pyramids that prioritize unit testing and outlines different levels of testing including automated testing of code, services, UI, and full integration. Specific CFML and JavaScript testing approaches are covered. Test-driven development (TDD) principles and the benefits of writing tests first are explained. The document provides links to additional CF Objective conference sessions on related testing topics.
5. INVERTED TESTING
PYRAMID
E x p l o r a t o r y
Acceptance*
Integration*
Unit
Tests** Automated Tests
http://nud.gr/QIZntJ
6. AUTOMATED TESTS
Comment from my Unit Testing Session @
CF Summit:
This one I liked the least. Seems like overkill to
write 10 times more code just to test one tiny piece
of the application. I can understand how it would
be helpful for large teams where the work is split
among multiple developers, but for a small team
and a rapid dev cycle, this just seems like
unnecessary overhead. I wasn't convinced of the
real-world applicability.
If this was you I hope I can convince you
http://nud.gr/QIZntJ
9. DATABASE TESTING
To be honest – not found a good one
So test using TestBox
This is actually good!
You need a DB Instance just for this.
So you can tear it down and refresh as needed
http://nud.gr/QIZntJ
10. CFML
Testing of Beans
• Make sure they hold the data you intended
• Have any special functions?
Services
• SRP
• Right calls
Handlers
• If using a MVC framework make sure it’s doing what you
wanted
http://nud.gr/QIZntJ
11. JAVASCRIPT
Yes you can test your JavaScript
Test Plain JavaScript
jQuery calls
AngularJS applications
http://nud.gr/QIZntJ
12. FULL INTEGRATION
TESTS
Testing in different browsers
Create a Framework
Make it interesting for the business
• They will really care about this level!
• Once you show them it working
http://nud.gr/QIZntJ
14. TDD
Why do we do TDD? We do TDD for one overriding reason
and several less important reasons. The less important
reasons are:
• We spend less time debugging.
• The tests act as accurate, precise, and unambiguous
documentation at the lowest level of the system.
• Writing tests first requires decoupling that other testing
strategies do not; and we believe that such decoupling is
beneficial.
Those are ancillary benefits of TDD; and they are debatable.
There is, however, one benefit that, given certain conditions
are met, cannot be debated:
Robert “Uncle Bob” Martin
http://blog.8thlight.com/uncle-bob/2014/04/25/MonogamousTDD.html
http://nud.gr/QIZntJ
15. TDD
If you have a test suite that you trust
so much that you are willing to deploy
the system based solely on those
tests passing; and if that test suite
can be executed in seconds, or
minutes, then you can quickly and
easily clean the code without fear.
Robert “Uncle Bob” Martin
http://blog.8thlight.com/uncle-bob/2014/04/25/MonogamousTDD.html
http://nud.gr/QIZntJ
18. OTHER SESSIONS @
CF OBJECTIVE
Thursday @ 10:15am
Stop Making Excuses And Start Testing Your JavaScript! - Ryan Anklam
Thursday @ 11:30am
BDD - Change the way you code - Luis Majano
Thursday @ 4:15pm
Updating/Hotfixing ColdFusion 10, 9 and 8: Tips and Traps - Charlie Arehart
Friday @ 11:30am
Leveling-Up at Javascript: Organization, Performance & Testing - Raymond
Camden
Friday @ 1:45pm
Real World Selenium Testing - Mary Jo Sminkey
http://nud.gr/QIZntJ
21. ABOUT ME
Software Craftsmanship Mentor
@ General Electric
• ColdFusion since 1996 (v2)
• London CFML & Web
Community Leader
• Scrum Master
• Kanban Practitioner
• Agile Coach
T: @bigmadkev
W: BigMadKev.com
http://nud.gr/QIZntJ