- What good is broken code?
- What if we told you that top CIOs know the way around the inevitably of human nature?
- Why Should CIOs Care About Testing?
- Automated Testing Tools
- TestBox and MockBox
- Creating a Modern Testing Environment
- The Bottom Line on Testing for CIOs
- Into The Box 2019 ColdFusion talks
What good is broken code?
All it does is wreak havoc in your ColdFusion developers and amongst users in your workplace. And the biggest problem is… Your team will produce broken code. There’s really no way around it. Nobody’s perfect.
What if we told you that top CIOs know the way around the inevitably of human nature?
It’s actually quite simple: Testing!
Testing is just as important as code creation. However, manual testing options can be very drawn out and tedious. That’s why it’s important to automate with tools such as TestBox and MockBox.
In this article, you will learn:
Why CIOs should care about testing
Why automation is important
What is TestBox and what does it do?
What is MockBox and what does it do?
How to create a modern testing environment
Why Should CIOs Care About Testing?
By now, we should all know why testing makes a developer’s life easier. But how about for the CIO? Is it really that important?
You should take an extremely keen interest in their team’s testing procedures and protocol. Testing doesn’t just affect the development and programming cycle. It can ultimately hurt your bottom line and the company’s reputation.
Here are 6 major reasons why CIOs should care about modern testing:
1) Happier stakeholders and their bosses in the C-Suite
CEOs, board members, and other executives like to know that their team is doing everything they can to promote the well-being of their company. Testing is one great way that you can prove to the higher-ups that you care about your division’s productivity. It can also instill in them greater confidence in your ability to lead.
2) Reduced risk of project disaster
When you and your team don’t perform adequate testing, your customers do. Because the more they find wrong, the less happy they will be. One of your goals should be to produce the best product that you can. Failing to test prevents you from achieving in that. Nothing destroys a company’s reputation faster than releasing a low-quality application or something worse… like a security breach. So make sure you test your code and applications prior to release to minimize the risk of disaster.
Related: A Comprehensive Guide to Running a Successful CFML Project
3) Faster time to market through Agile testing
Traditionally, testing has always been done after the project has been completed. However, modern Agile testing guidelines dictate that testing should be done throughout development. Ultimately, this will save you more time and resources. Here are some guidelines you should follow when switching to Agile testing.
- Test continuously throughout the development process.
- Everybody tests–from the developers to the business analysts.
- Reduce your testing documentation. Testing results and info often gets lost in a sea of documentation paperwork. Reusable checklists can help to correct this.
- Keep your code clean.
- Automate your unit testing.
4) Increased efficiency with automated testing
Testing can be tedious work. With manual testing, developers input long lines of monotonous code. This can lead to complacency errors. This is completely avoidable. Through the use of automated testing, your applications and code will be tested with pinpoint precision every single time. Automated testing also frees up your development team to do other priority tasks.
5) Better feedback loops
Having a team of dedicated testers for post-production does have some advantages. But there are some glaring disadvantages to modern Agile testing as well, such as delayed feedback. A tester may be able to find errors and bugs, but how long will it take for the devs to know it’s there? By including your developers in the testing process, fixes can be made almost instantaneously without the use of excess documentation and time wasted. This results in an all-around better application and development experience.
6) Measured return on developer investment
As CIO, there’s a good chance that you’re meticulously tracking the productivity of your employees–especially your developers. And what better way to monitor the performance of them than through testing? Using modern testing methods allows you to know just how elite your team is and whether or not you need to make adjustments.
Automated Testing Tools
I mentioned the efficiency of automated testing over manual testing above. But there are also other advantages of shifting to them.
Did you know automated testing can have a directly positive effect on your team’s morale?
As a CIO, you know firsthand just how vital team morale can be.
So, how does automated testing help
Manual testing is the definition of monotonous, repetitive, and boring. Instead of tasking your developers with something easily automated, get them working on challenging new tasks. This will not only boost morale, but maximize the productivity of your team.
Another huge benefit that automation testing tools have is the ability to create virtual environments. These allow for bottom-line savings on hardware, personnel, and server considerations.
TestBox and MockBox
When it comes to third-party tools for your ColdFusion, Ortus Solutions probably sits right at the top of your list. They provide wicked support for all things ColdFusion. Modern testing and mocking solutions included. For this, they have created TestBox and MockBox.
TestBox is a cutting-edge testing framework designed specifically for CFML. It is primarily based on Behavior Driven Development or BDD. Now while the application is geared more for BDD, traditional xUnit style testing is also supported.
Aside from supporting BDD and xUnit testing, TestBox also comes with a huge array of other capabilities including:
- Testing life-cycle methods.
- Ability to extend and create custom test runners.
- Ability to extend and create custom test reporters.
- Extensible reporters, bundled with tons of them:
- JUnit 4 XML
- Text (80's style)
- TAP (Test Anything Protocol)
- Simple HTML
- Min – Minimalistic Heaven
- Asynchronous testing
- Multi-suite capabilities
- Test skipping
- Suite skipping
- Dynamic skipping support via runtime executions.
- Test one or more suites exclusively.
- Test one or more tests/specs exclusively.
- Test labels and tagging.
- Testing debug output stream.
- Clickable suite titles to filter test execution.
It also comes with MockBox.
Going hand in hand with TestBox is MockBox–Ortus Solutions’ advanced mocking and stubbing application. It can be utilized from within the TestBox environment or as its own standalone respect in any other testing framework or application running CFML.
According to Ortus, MockBox is just as stacked as TestBox when it comes to capabilities. Here are just some of the things you can do with MockBox:
- Create mock objects for you and keep their methods intact.
- Create mock objects and wipe out their methods.
- Create stub objects for objects that don't even exist yet.
- Decorate instantiated objects with mocking capabilities.
- Mock internal object properties.
- Have a method return 1 or more expected results.
- State-Machine Results. Have a method recycle the results as it is called consecutively.
- Method call counter.
- Method arguments call logging.
- Ability to mock private/package methods.
- Ability to mock exceptions from methods or make a method through a controlled exception.
- Ability to change the return type of methods or preserve their signature.
- Ability to make methods return results according to argument signatures.
Creating a Modern Testing Environment
Using a modern testing environment is critical to keeping your company running in tip-top shape. The lack of a mature testing environment can lead to absolute chaos during the run-up to deploying new code. So, minimize the amount of resources you will spend going back to revise broken code and prevent established bugs from spreading by detecting them early
There are many quality improvements that are made using modern testing such as:
- Code coverage
- Automated testing
- Code review
- Bug modeling and prevention
But how do you begin setting up a modern testing environment?
A typical set up includes:
- A staging server where you test (ideally using Docker to mirror your production setup).
- A Continuous Integration tool such as Jenkins that automatically pushes new changes for testing.
- Automated testing using TestBox.
- Automatic reporting of any bugs and preventing buggy branches being merged into production code.
The Bottom Line on Testing for CIOs
So what’s the skinny on testing for CIOs?
Modern, automated testing of your ColdFusion applications isn’t just some option. It’s the only option.
Tools such as TestBox and MockBox are available to make your testing life easier. Use these as part of your testing setup and create a modern testing environment to drive your team to success.
Are you using automated testing with TestBox and MockBox? If not, what are you doing to fulfill your testing needs? What are some neat tips and tricks you have learned to make your automated testing run smoother?
Share your experiences in the comments below. And if you like what you read, you can always check us out on our Facebook group: CF Alive Inner Circle. There we have many other awesome resources, group discussions, and FB Live interviews with some of the biggest names in ColdFusion!
Into The Box 2019 ColdFusion talks
All of this and much more will be discussed at Into The Box 2019 in a few days. Make sure you show up. But, if you can't, I will let you know what you've missed.
And to continue learning how to make your ColdFusion apps more modern and alive, I encourage you to download our free ColdFusion Alive Best Practices Checklist.
Because… perhaps you are responsible for a mission-critical or revenue-generating CF application that you don’t trust 100%, where implementing new features is a painful ad-hoc process with slow turnaround even for simple requests.
What if you have no contingency plan for a sudden developer departure or a server outage? Perhaps every time a new freelancer works on your site, something breaks. Or your application availability, security, and reliability are poor.
And if you are depending on ColdFusion for your job, then you can’t afford to let your CF development methods die on the vine.
You’re making a high-stakes bet that everything is going to be OK using the same old app creation ways in that one language — forever.
All it would take is for your fellow CF developer to quit or for your CIO to decide to leave the (falsely) perceived sinking ship of CFML and you could lose everything—your project, your hard-won CF skills, and possibly even your job.
Luckily, there are a number of simple, logical steps you can take now to protect yourself from these obvious risks.
No Brainer ColdFusion Best Practices to Ensure You Thrive No Matter What Happens Next
ColdFusion Alive Best Practices Checklist
Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.
√ Easily create a consistent server architecture across development, testing, and production
√ A modern test environment to prevent bugs from spreading
√ Automated continuous integration tools that work well with CF
√ A portable development environment baked into your codebase… for free!
Learn about these and many more strategies in our free ColdFusion Alive Best Practices Checklist.